src/mess/video/p2000m.c
| r1538 | r1539 | |
| 9 | 9 | #include "driver.h" |
| 10 | 10 | #include "includes/p2000t.h" |
| 11 | 11 | |
| 12 | | static INT8 frame_count; |
| 13 | 12 | |
| 13 | static INT8 frame_count; |
| 14 | |
| 15 | |
| 14 | 16 | VIDEO_START( p2000m ) |
| 15 | 17 | { |
| 16 | 18 | frame_count = 0; |
| 17 | 19 | video_start_generic(machine); |
| 18 | 20 | } |
| 19 | 21 | |
| 20 | | void p2000m_vh_callback (void) |
| 21 | | { |
| 22 | 22 | |
| 23 | | int offs; |
| 24 | | |
| 25 | | if (frame_count++ > 49) frame_count = 0; |
| 26 | | if ((frame_count == 24) | !frame_count) |
| 27 | | { |
| 28 | | for (offs = 0; offs < 2047; offs++) |
| 29 | | { |
| 30 | | if (videoram[offs + 2048] & 0x40) |
| 31 | | dirtybuffer[offs] = 1; |
| 32 | | } |
| 33 | | } |
| 34 | | } |
| 35 | | |
| 36 | 23 | VIDEO_UPDATE( p2000m ) |
| 37 | 24 | { |
| 38 | 25 | int offs, sx, sy, code, loop; |
| 39 | | int full_refresh = 1; |
| 40 | 26 | |
| 41 | | if (full_refresh) |
| 42 | | memset (dirtybuffer, 1, videoram_size); |
| 43 | | |
| 44 | 27 | for (offs = 0; offs < 80 * 24; offs++) |
| 45 | 28 | { |
| 46 | | if (dirtybuffer[offs] | dirtybuffer[offs + 2048]) |
| 29 | sy = (offs / 80) * 10; |
| 30 | sx = (offs % 80) * 6; |
| 31 | |
| 32 | if ((frame_count > 25) && (videoram[offs + 2048] & 0x40)) |
| 33 | code = 32; |
| 34 | else |
| 47 | 35 | { |
| 48 | | sy = (offs / 80) * 10; |
| 49 | | sx = (offs % 80) * 6; |
| 50 | | if ((frame_count > 25) && (videoram[offs + 2048] & 0x40)) code = 32; |
| 51 | | else |
| 36 | code = videoram[offs]; |
| 37 | if ((videoram[offs + 2048] & 0x01) && (code & 0x20)) |
| 52 | 38 | { |
| 53 | | code = videoram[offs]; |
| 54 | | if ((videoram[offs + 2048] & 0x01) && (code & 0x20)) |
| 55 | | { |
| 56 | | code += (code & 0x40) ? 64 : 96; |
| 57 | | } else { |
| 58 | | code &= 0x7f; |
| 59 | | } |
| 60 | | if (code < 32) code = 32; |
| 39 | code += (code & 0x40) ? 64 : 96; |
| 40 | } else { |
| 41 | code &= 0x7f; |
| 61 | 42 | } |
| 43 | if (code < 32) code = 32; |
| 44 | } |
| 62 | 45 | |
| 63 | | drawgfx (bitmap, machine->gfx[0], code, |
| 64 | | videoram[offs + 2048] & 0x08 ? 0 : 1, 0, 0, sx, sy, |
| 65 | | &machine->screen[0].visarea, TRANSPARENCY_NONE, 0); |
| 66 | | if (videoram[offs] & 0x80) |
| 46 | drawgfx (bitmap, machine->gfx[0], code, |
| 47 | videoram[offs + 2048] & 0x08 ? 0 : 1, 0, 0, sx, sy, |
| 48 | &machine->screen[0].visarea, TRANSPARENCY_NONE, 0); |
| 49 | |
| 50 | if (videoram[offs] & 0x80) |
| 51 | { |
| 52 | for (loop = 0; loop < 6; loop++) |
| 67 | 53 | { |
| 68 | | for (loop = 0; loop < 6; loop++) |
| 69 | | { |
| 70 | | *BITMAP_ADDR16(bitmap, sy + 9, sx + loop) = 1; |
| 71 | | } |
| 54 | *BITMAP_ADDR16(bitmap, sy + 9, sx + loop) = 1; |
| 72 | 55 | } |
| 73 | | dirtybuffer[offs] = 0; |
| 74 | 56 | } |
| 75 | 57 | } |
| 58 | |
| 76 | 59 | return 0; |
| 77 | 60 | } |
src/mess/drivers/p2000t.c
| r1538 | r1539 | |
| 54 | 54 | static ADDRESS_MAP_START( p2000t_mem , ADDRESS_SPACE_PROGRAM, 8) |
| 55 | 55 | AM_RANGE(0x0000, 0x0fff) AM_ROM |
| 56 | 56 | AM_RANGE(0x1000, 0x4fff) AM_ROM |
| 57 | | AM_RANGE(0x5000, 0x57ff) AM_READWRITE(videoram_r, videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size) |
| 57 | AM_RANGE(0x5000, 0x57ff) AM_RAM AM_BASE(&videoram) AM_SIZE(&videoram_size) |
| 58 | 58 | AM_RANGE(0x5800, 0x9fff) AM_RAM |
| 59 | 59 | AM_RANGE(0xa000, 0xffff) AM_NOP |
| 60 | 60 | ADDRESS_MAP_END |
| r1538 | r1539 | |
| 62 | 62 | static ADDRESS_MAP_START( p2000m_mem , ADDRESS_SPACE_PROGRAM, 8) |
| 63 | 63 | AM_RANGE(0x0000, 0x0fff) AM_ROM |
| 64 | 64 | AM_RANGE(0x1000, 0x4fff) AM_ROM |
| 65 | | AM_RANGE(0x5000, 0x5fff) AM_READWRITE(videoram_r, videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size) |
| 65 | AM_RANGE(0x5000, 0x5fff) AM_RAM AM_BASE(&videoram) AM_SIZE(&videoram_size) |
| 66 | 66 | AM_RANGE(0x6000, 0x9fff) AM_RAM |
| 67 | 67 | AM_RANGE(0xa000, 0xffff) AM_NOP |
| 68 | 68 | ADDRESS_MAP_END |