src/mess/drivers/c10.c
| r9572 | r9573 | |
| 4 | 4 | |
| 5 | 5 | 30/08/2010 Skeleton driver |
| 6 | 6 | |
| 7 | Driver currently gets to a loop where it waits for an interrupt. |
| 8 | The interrupt routine presumably writes to FE69 which the loop is |
| 9 | constantly looking at. |
| 10 | |
| 7 | 11 | ****************************************************************************/ |
| 8 | 12 | |
| 9 | 13 | #include "emu.h" |
| 10 | 14 | #include "cpu/z80/z80.h" |
| 11 | 15 | |
| 12 | | static UINT8 *c10_ram; |
| 16 | static const UINT8 *FNT; |
| 17 | static const UINT8 *videoram; |
| 13 | 18 | |
| 14 | 19 | static ADDRESS_MAP_START(c10_mem, ADDRESS_SPACE_PROGRAM, 8) |
| 15 | 20 | ADDRESS_MAP_UNMAP_HIGH |
| 16 | | AM_RANGE(0x0000, 0xffff) AM_RAM AM_BASE(&c10_ram) |
| 21 | AM_RANGE(0x0000, 0x0fff) AM_RAMBANK("boot") |
| 22 | AM_RANGE(0x1000, 0x7fff) AM_RAM |
| 23 | AM_RANGE(0x8000, 0xbfff) AM_ROM |
| 24 | AM_RANGE(0xc000, 0xffff) AM_RAM AM_REGION("maincpu", 0xc000) |
| 17 | 25 | ADDRESS_MAP_END |
| 18 | 26 | |
| 19 | 27 | static ADDRESS_MAP_START( c10_io, ADDRESS_SPACE_IO, 8 ) |
| r9572 | r9573 | |
| 24 | 32 | static INPUT_PORTS_START( c10 ) |
| 25 | 33 | INPUT_PORTS_END |
| 26 | 34 | |
| 35 | /* after the first 4 bytes have been read from ROM, switch the ram back in */ |
| 36 | static TIMER_CALLBACK( c10_reset ) |
| 37 | { |
| 38 | memory_set_bank(machine, "boot", 0); |
| 39 | } |
| 40 | |
| 27 | 41 | static MACHINE_RESET(c10) |
| 28 | 42 | { |
| 29 | | UINT8* bios = memory_region(machine, "maincpu"); |
| 30 | | |
| 31 | | memcpy(c10_ram,bios, 0x4000); |
| 32 | | memcpy(c10_ram+0x8000,bios, 0x4000); |
| 43 | memory_set_bank(machine, "boot", 1); |
| 44 | timer_set(machine, ATTOTIME_IN_USEC(4), NULL, 0, c10_reset); |
| 33 | 45 | } |
| 34 | 46 | |
| 35 | 47 | static VIDEO_START( c10 ) |
| 36 | 48 | { |
| 49 | FNT = memory_region(machine, "chargen"); |
| 50 | videoram = memory_region(machine, "maincpu")+0xf0a2; |
| 37 | 51 | } |
| 38 | 52 | |
| 53 | /* This system appears to have inline attribute bytes of unknown meaning. |
| 54 | Currently they are ignored. The word at FAB5 looks like it might be cursor location. */ |
| 39 | 55 | static VIDEO_UPDATE( c10 ) |
| 40 | 56 | { |
| 57 | //static UINT8 framecnt=0; |
| 58 | UINT8 y,ra,chr,gfx; |
| 59 | UINT16 sy=0,ma=0,x,xx; |
| 60 | |
| 61 | //framecnt++; |
| 62 | |
| 63 | for (y = 0; y < 25; y++) |
| 64 | { |
| 65 | for (ra = 0; ra < 10; ra++) |
| 66 | { |
| 67 | UINT16 *p = BITMAP_ADDR16(bitmap, sy++, 0); |
| 68 | |
| 69 | xx = ma; |
| 70 | for (x = ma; x < ma + 80; x++) |
| 71 | { |
| 72 | gfx = 0; |
| 73 | if (ra < 9) |
| 74 | { |
| 75 | chr = videoram[xx++]; |
| 76 | |
| 77 | // /* Take care of flashing characters */ |
| 78 | // if ((chr < 0x80) && (framecnt & 0x08)) |
| 79 | // chr |= 0x80; |
| 80 | |
| 81 | if (chr & 0x80) // ignore attribute bytes |
| 82 | x--; |
| 83 | else |
| 84 | { |
| 85 | gfx = FNT[(chr<<4) | ra ]; |
| 86 | |
| 87 | /* Display a scanline of a character */ |
| 88 | *p = ( gfx & 0x80 ) ? 1 : 0; p++; |
| 89 | *p = ( gfx & 0x40 ) ? 1 : 0; p++; |
| 90 | *p = ( gfx & 0x20 ) ? 1 : 0; p++; |
| 91 | *p = ( gfx & 0x10 ) ? 1 : 0; p++; |
| 92 | *p = ( gfx & 0x08 ) ? 1 : 0; p++; |
| 93 | *p = ( gfx & 0x04 ) ? 1 : 0; p++; |
| 94 | *p = ( gfx & 0x02 ) ? 1 : 0; p++; |
| 95 | *p = ( gfx & 0x01 ) ? 1 : 0; p++; |
| 96 | } |
| 97 | } |
| 98 | } |
| 99 | } |
| 100 | ma+=96; |
| 101 | } |
| 41 | 102 | return 0; |
| 42 | 103 | } |
| 43 | 104 | |
| r9572 | r9573 | |
| 73 | 134 | MDRV_SCREEN_REFRESH_RATE(60) |
| 74 | 135 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */ |
| 75 | 136 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 76 | | MDRV_SCREEN_SIZE(256, 192) /* border size not accurate */ |
| 77 | | MDRV_SCREEN_VISIBLE_AREA(0, 256 - 1, 0, 192 - 1) |
| 137 | MDRV_SCREEN_SIZE(640, 250) |
| 138 | MDRV_SCREEN_VISIBLE_AREA(0, 639, 0, 249) |
| 78 | 139 | MDRV_GFXDECODE(c10) |
| 79 | 140 | |
| 80 | 141 | MDRV_PALETTE_LENGTH(2) |
| r9572 | r9573 | |
| 84 | 145 | MDRV_VIDEO_UPDATE(c10) |
| 85 | 146 | MACHINE_CONFIG_END |
| 86 | 147 | |
| 148 | DRIVER_INIT( c10 ) |
| 149 | { |
| 150 | UINT8 *RAM = memory_region(machine, "maincpu"); |
| 151 | memory_configure_bank(machine, "boot", 0, 2, &RAM[0x0000], 0x8000); |
| 152 | } |
| 87 | 153 | |
| 88 | 154 | /* ROM definition */ |
| 89 | 155 | ROM_START( c10 ) |
| 90 | 156 | ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF ) |
| 91 | | ROM_LOAD( "c10_cros.bin", 0x0000, 0x4000, CRC(2ccf5983) SHA1(52f7c497f5284bf5df9eb0d6e9142bb1869d8c24)) |
| 157 | ROM_LOAD( "c10_cros.bin", 0x8000, 0x4000, CRC(2ccf5983) SHA1(52f7c497f5284bf5df9eb0d6e9142bb1869d8c24)) |
| 92 | 158 | ROM_REGION( 0x2000, "chargen", 0 ) |
| 93 | 159 | ROM_LOAD( "c10_char.bin", 0x0000, 0x2000, CRC(cb530b6f) SHA1(95590bbb433db9c4317f535723b29516b9b9fcbf)) |
| 94 | 160 | ROM_END |
| r9572 | r9573 | |
| 96 | 162 | /* Driver */ |
| 97 | 163 | |
| 98 | 164 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS */ |
| 99 | | COMP( 1982, c10, 0, 0, c10, c10, 0, "Cromemco", "C-10", GAME_NOT_WORKING | GAME_NO_SOUND) |
| 165 | COMP( 1982, c10, 0, 0, c10, c10, c10, "Cromemco", "C-10", GAME_NOT_WORKING | GAME_NO_SOUND) |