src/mess/video/galaxy.c
| r2709 | r2710 | |
| 47 | 47 | emu_timer *gal_video_timer = NULL; |
| 48 | 48 | |
| 49 | 49 | TIMER_CALLBACK( gal_video ) |
| 50 | | { |
| 50 | { |
| 51 | 51 | int y,x; |
| 52 | 52 | if (galaxy_interrupts_enabled==TRUE) { |
| 53 | 53 | UINT8 *gfx = memory_region(REGION_GFX1); |
| 54 | 54 | UINT8 dat = (gal_latch_value & 0x3c) >> 2; |
| 55 | | if ((gal_cnt > 96 * 2) && (gal_cnt < 96 * 210)) { // display on screen just first 208 lines |
| 56 | | if (((gal_cnt) % 2)==0) { //fetch code |
| 57 | | UINT16 addr = (cpunum_get_reg(0, Z80_I) << 8) | cpunum_get_reg(0, Z80_R) | ((gal_latch_value & 0x80) ^ 0x80); |
| 58 | | if (first==0 && (cpunum_get_reg(0, Z80_R) & 0x1f) ==0) { |
| 59 | | // Due to a fact that on real processor latch value is set at |
| 60 | | // the end of last cycle we need to skip dusplay of double |
| 61 | | // first char in each row |
| 62 | | code = 0xff; |
| 63 | | first = 1; |
| 64 | | } else { |
| 65 | | code = program_read_byte(addr) & 0xbf; |
| 66 | | code += (code & 0x80) >> 1; |
| 67 | | code = gfx[(code & 0x7f) +(dat << 7 )]; |
| 68 | | first = 0; |
| 55 | if ((gal_cnt > 48 * 2) && (gal_cnt < 48 * 210)) { // display on screen just first 208 lines |
| 56 | UINT8 mode = cpunum_get_reg(0, Z80_IM); |
| 57 | UINT16 addr = (cpunum_get_reg(0, Z80_I) << 8) | cpunum_get_reg(0, Z80_R) | ((gal_latch_value & 0x80) ^ 0x80); |
| 58 | if (mode == 1) { |
| 59 | if (first==0 && (cpunum_get_reg(0, Z80_R) & 0x1f) ==0) { |
| 60 | // Due to a fact that on real processor latch value is set at |
| 61 | // the end of last cycle we need to skip dusplay of double |
| 62 | // first char in each row |
| 63 | code = 0xff; |
| 64 | first = 1; |
| 65 | } else { |
| 66 | code = program_read_byte(addr) & 0xbf; |
| 67 | code += (code & 0x80) >> 1; |
| 68 | code = gfx[(code & 0x7f) +(dat << 7 )]; |
| 69 | first = 0; |
| 70 | } |
| 71 | y = gal_cnt / 48 - 2; |
| 72 | x = (gal_cnt % 48) * 8; |
| 73 | |
| 74 | *BITMAP_ADDR16(tmpbitmap, y, x ) = (code >> 0) & 1; x++; |
| 75 | *BITMAP_ADDR16(tmpbitmap, y, x ) = (code >> 1) & 1; x++; |
| 76 | *BITMAP_ADDR16(tmpbitmap, y, x ) = (code >> 2) & 1; x++; |
| 77 | *BITMAP_ADDR16(tmpbitmap, y, x ) = (code >> 3) & 1; x++; |
| 78 | *BITMAP_ADDR16(tmpbitmap, y, x ) = (code >> 4) & 1; x++; |
| 79 | *BITMAP_ADDR16(tmpbitmap, y, x ) = (code >> 5) & 1; x++; |
| 80 | *BITMAP_ADDR16(tmpbitmap, y, x ) = (code >> 6) & 1; x++; |
| 81 | *BITMAP_ADDR16(tmpbitmap, y, x ) = (code >> 7) & 1; |
| 69 | 82 | } |
| 70 | | y = gal_cnt / 96 - 2; |
| 71 | | x = (gal_cnt % 96)*4; |
| 83 | if (mode == 2) { |
| 84 | code = program_read_byte(addr); |
| 85 | y = gal_cnt / 48 - 2; |
| 86 | x = (gal_cnt % 48) * 8; |
| 87 | if (x < 11*8 || x > 42*8) code = 0xff; |
| 72 | 88 | *BITMAP_ADDR16(tmpbitmap, y, x ) = (code >> 0) & 1; x++; |
| 73 | 89 | *BITMAP_ADDR16(tmpbitmap, y, x ) = (code >> 1) & 1; x++; |
| 74 | 90 | *BITMAP_ADDR16(tmpbitmap, y, x ) = (code >> 2) & 1; x++; |
| r2709 | r2710 | |
| 77 | 93 | *BITMAP_ADDR16(tmpbitmap, y, x ) = (code >> 5) & 1; x++; |
| 78 | 94 | *BITMAP_ADDR16(tmpbitmap, y, x ) = (code >> 6) & 1; x++; |
| 79 | 95 | *BITMAP_ADDR16(tmpbitmap, y, x ) = (code >> 7) & 1; |
| 80 | | } |
| 96 | } |
| 81 | 97 | } |
| 82 | 98 | gal_cnt++; |
| 83 | | } |
| 99 | } |
| 84 | 100 | } |
| 85 | 101 | |
| 86 | 102 | VIDEO_START ( galaxy ) |
src/mess/drivers/galaxy.c
| r2709 | r2710 | |
| 39 | 39 | |
| 40 | 40 | static ADDRESS_MAP_START (galaxy_mem, ADDRESS_SPACE_PROGRAM, 8) |
| 41 | 41 | AM_RANGE(0x0000, 0x0fff) AM_ROM |
| 42 | | AM_RANGE(0x2000, 0x2037) AM_MIRROR(0x07c0) AM_READ( galaxy_keyboard_r ) |
| 43 | | AM_RANGE(0x2038, 0x203f) AM_MIRROR(0x07c0) AM_READWRITE( galaxy_latch_r, galaxy_latch_w ) |
| 42 | AM_RANGE(0x2000, 0x203f) AM_MIRROR(0x07c0) AM_READWRITE ( galaxy_keyboard_r, galaxy_latch_w ) |
| 44 | 43 | ADDRESS_MAP_END |
| 45 | 44 | |
| 46 | 45 | static ADDRESS_MAP_START (galaxyp_mem, ADDRESS_SPACE_PROGRAM, 8) |
| 47 | 46 | AM_RANGE(0x0000, 0x0fff) AM_ROM // ROM A |
| 48 | 47 | AM_RANGE(0x1000, 0x1fff) AM_ROM // ROM B |
| 49 | | AM_RANGE(0x2000, 0x2037) AM_MIRROR(0x07c0) AM_READ( galaxy_keyboard_r ) |
| 50 | | AM_RANGE(0x2038, 0x203f) AM_MIRROR(0x07c0) AM_READWRITE( galaxy_latch_r, galaxy_latch_w ) |
| 48 | AM_RANGE(0x2000, 0x203f) AM_MIRROR(0x07c0) AM_READWRITE ( galaxy_keyboard_r, galaxy_latch_w ) |
| 51 | 49 | AM_RANGE(0xe000, 0xefff) AM_ROM // ROM C |
| 52 | 50 | AM_RANGE(0xf000, 0xffff) AM_ROM // ROM D |
| 53 | 51 | ADDRESS_MAP_END |
| r2709 | r2710 | |
| 206 | 204 | |
| 207 | 205 | MDRV_VIDEO_START( generic_bitmapped ) |
| 208 | 206 | MDRV_VIDEO_UPDATE( galaxy ) |
| 209 | | |
| 207 | |
| 210 | 208 | /* snapshot */ |
| 211 | 209 | MDRV_SNAPSHOT_ADD(galaxy, "gal", 0) |
| 212 | 210 | |