Previous 15994 Revisions Next

r10495 Friday 18th February, 2011 at 17:16:51 UTC by Angelo Salese
[UPD7220]: Added sketchy text drawing routines for QC-10 and A5105
[src/mess/drivers]a5105.c qx10.c
[src/mess/video]upd7220.c upd7220.h

src/mess/video/upd7220.c
r10494r10495
10311031   int im, wd, area;
10321032   int y, sy = 0;
10331033
1034   for (area = 0; area < 4; area++)
1034   for (area = 0; area < 1; area++)
10351035   {
10361036      get_text_partition(upd7220, area, &sad, &len, &im, &wd);
10371037
10381038      for (y = sy; y < sy + len; y++)
10391039      {
10401040         addr = sad + (y * upd7220->pitch);
1041         if (upd7220->draw_text_func) upd7220->draw_text_func(device, bitmap, addr, y, wd);
1041         if (upd7220->draw_text_func) upd7220->draw_text_func(device, bitmap, upd7220->vram, addr, y, wd, upd7220->pitch);
10421042      }
10431043
10441044      sy = y + 1;
r10494r10495
10951095         if (im)
10961096            draw_graphics_line(device, bitmap, addr, y, wd);
10971097         else
1098            if (upd7220->draw_text_func) upd7220->draw_text_func(device, bitmap, addr, y, wd);
1098            if (upd7220->draw_text_func) upd7220->draw_text_func(device, bitmap, upd7220->vram, addr, y, wd, upd7220->pitch);
10991099      }
11001100
11011101      sy = y + 1;
src/mess/video/upd7220.h
r10494r10495
5757typedef void (*upd7220_display_pixels_func)(device_t *device, bitmap_t *bitmap, int y, int x, UINT32 address, UINT16 data);
5858#define UPD7220_DISPLAY_PIXELS(name) void name(device_t *device, bitmap_t *bitmap, int y, int x, UINT32 address, UINT16 data)
5959
60typedef void (*upd7220_draw_text_line)(device_t *device, bitmap_t *bitmap, UINT32 addr, int y, int wd);
61#define UPD7220_DRAW_TEXT_LINE(name) void name(device_t *device, bitmap_t *bitmap, UINT32 addr, int y, int wd)
60typedef void (*upd7220_draw_text_line)(device_t *device, bitmap_t *bitmap, UINT16 *vram, UINT32 addr, int y, int wd, int pitch);
61#define UPD7220_DRAW_TEXT_LINE(name) void name(device_t *device, bitmap_t *bitmap, UINT16 *vram, UINT32 addr, int y, int wd, int pitch)
6262
6363typedef struct _upd7220_interface upd7220_interface;
6464struct _upd7220_interface
src/mess/drivers/qx10.c
r10494r10495
524524
525525static UPD7220_DRAW_TEXT_LINE( hgdc_draw_text )
526526{
527   qx10_state *state = device->machine->driver_data<qx10_state>();
528   int x;
529   int xi,yi;
530   int tile;
527531
532   for( x = 0; x < pitch; x++ )
533   {
534      tile = (vram[addr+x] & 0x7f);
535
536      for( yi = 0; yi < 16; yi++)
537      {
538         for( xi = 0; xi < 8; xi++)
539         {
540            UINT8 pen = (state->m_char_rom[tile*16+yi] >> xi) & 1;
541
542            if((y * 16 + yi + 16) < 480)  //todo: screen limits, offsetted
543               *BITMAP_ADDR16(bitmap, y * 16 + yi + 16, x * 8 + xi + 352) = pen;
544         }
545      }
546   }
528547}
529548
530549static UPD7220_INTERFACE( hgdc_intf )
src/mess/drivers/a5105.c
r10494r10495
268268
269269static MACHINE_RESET(a5105)
270270{
271
271272}
272273
273274
r10494r10495
326327
327328static UPD7220_DISPLAY_PIXELS( hgdc_display_pixels )
328329{
329   int i;
330   //int i;
330331
331   for (i = 0; i < 16; i++)
332   {
333      if (BIT(data, i)) *BITMAP_ADDR16(bitmap, y, x + i) = 1;
334   }
332   //for (i = 0; i < 16; i++)
333   //{
334   //   if (BIT(data, i)) *BITMAP_ADDR16(bitmap, y, x + i) = 1;
335   //}
335336}
336337
337338static UPD7220_DRAW_TEXT_LINE( hgdc_draw_text )
338339{
340   a5105_state *state = device->machine->driver_data<a5105_state>();
341   int x;
342   int xi,yi;
343   int tile;
339344
345   for( x = 0; x < pitch; x++ )
346   {
347      tile = (vram[addr+x] & 0xff);
348
349      for( yi = 0; yi < 8; yi++)
350      {
351         for( xi = 0; xi < 8; xi++)
352         {
353            UINT8 pen = (state->m_char_rom[tile*8+yi] >> xi) & 1;
354
355            if((y * 8 + yi + 40) < 200) // TODO: screen borders, offsetted
356               *BITMAP_ADDR16(bitmap, y * 8 + yi + 40, x * 8 + xi + 240) = pen;
357         }
358      }
359   }
340360}
341361
342362static UPD7220_INTERFACE( hgdc_intf )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team