src/mess/drivers/camplynx.c
| r5023 | r5024 | |
| 62 | 62 | |
| 63 | 63 | The work so far is without the benefit of manuals, schematic etc [Robbbert] |
| 64 | 64 | |
| 65 | 48k, 96k: |
| 65 | 66 | Cassette operation is strange indeed. Save takes the dac output and directs |
| 66 | 67 | it to the tape. Load takes over line 0 of the keyboard and uses bits 0 and 5. |
| 67 | 68 | |
| 68 | 69 | To Do: |
| 69 | | 128k, 96k: everything |
| 70 | | |
| 71 | | 48k: |
| 72 | 70 | - find Break key |
| 73 | | - colour |
| 74 | | - banking |
| 71 | - banking (it is incomplete atm) |
| 75 | 72 | - devices (cassette, disk) |
| 76 | 73 | - find out the mc6845 clock frequency |
| 74 | - check out the roms (48k, 96k), they could be wrong |
| 77 | 75 | |
| 78 | 76 | ****************************************************************************/ |
| 79 | 77 | |
| r5023 | r5024 | |
| 84 | 82 | |
| 85 | 83 | static const device_config *mc6845; |
| 86 | 84 | |
| 85 | /* These bankswitch handlers are very incomplete, just enough to get the |
| 86 | computer working. Also, as it happens 6 times for every scanline |
| 87 | of every character, it causes a huge slowdown. */ |
| 88 | |
| 87 | 89 | static WRITE8_HANDLER( camplynx_bank_w ) |
| 88 | 90 | { |
| 89 | | /* This is very incomplete, just enough to get the computer working. |
| 90 | | Also, as it happens 6 times for every scanline of every character, |
| 91 | | it causes a huge slowdown. */ |
| 92 | | |
| 93 | 91 | if (!data) |
| 94 | 92 | memory_set_bank(space->machine, 1, 0); |
| 95 | 93 | else |
| r5023 | r5024 | |
| 99 | 97 | if (data & 4) |
| 100 | 98 | memory_set_bank(space->machine, 1, 2); |
| 101 | 99 | else |
| 102 | | logerror("cannot understand bankswitch command %X\n",data); |
| 100 | logerror("%04X: Cannot understand bankswitch command %X\n",cpu_get_pc(space->cpu), data); |
| 103 | 101 | } |
| 104 | 102 | |
| 105 | 103 | static WRITE8_HANDLER( lynx128_bank_w ) |
| r5023 | r5024 | |
| 127 | 125 | memory_set_bankptr(mem->machine, 18, memory_region(mem->machine, "maincpu") + 0x1e000); |
| 128 | 126 | } |
| 129 | 127 | else |
| 130 | | if (data == 0xc0) |
| 128 | if ((data == 0xc0) || (data == 0xe0)) |
| 131 | 129 | { |
| 132 | 130 | memory_set_bankptr(mem->machine, 1, memory_region(mem->machine, "maincpu") + 0x00000); |
| 133 | 131 | memory_set_bankptr(mem->machine, 2, memory_region(mem->machine, "maincpu") + 0x02000); |
| r5023 | r5024 | |
| 147 | 145 | memory_set_bankptr(mem->machine, 18, memory_region(mem->machine, "maincpu") + 0x2e000); |
| 148 | 146 | } |
| 149 | 147 | else |
| 150 | | if (data == 0xe0) |
| 148 | if ((data == 0xce) || (data == 0xee)) |
| 151 | 149 | { |
| 152 | | memory_set_bankptr(mem->machine, 1, memory_region(mem->machine, "maincpu") + 0x00000); |
| 153 | | memory_set_bankptr(mem->machine, 2, memory_region(mem->machine, "maincpu") + 0x02000); |
| 154 | | memory_set_bankptr(mem->machine, 3, memory_region(mem->machine, "maincpu") + 0x04000); |
| 155 | | memory_set_bankptr(mem->machine, 4, memory_region(mem->machine, "maincpu") + 0x16000); |
| 156 | | memory_set_bankptr(mem->machine, 5, memory_region(mem->machine, "maincpu") + 0x18000); |
| 157 | | memory_set_bankptr(mem->machine, 6, memory_region(mem->machine, "maincpu") + 0x1a000); |
| 158 | | memory_set_bankptr(mem->machine, 7, memory_region(mem->machine, "maincpu") + 0x0c000); |
| 159 | | memory_set_bankptr(mem->machine, 8, memory_region(mem->machine, "maincpu") + 0x0e000); |
| 150 | memory_set_bankptr(mem->machine, 1, memory_region(mem->machine, "maincpu") + 0x20000); |
| 151 | memory_set_bankptr(mem->machine, 2, memory_region(mem->machine, "maincpu") + 0x22000); |
| 152 | memory_set_bankptr(mem->machine, 3, memory_region(mem->machine, "maincpu") + 0x24000); |
| 153 | memory_set_bankptr(mem->machine, 4, memory_region(mem->machine, "maincpu") + 0x26000); |
| 154 | memory_set_bankptr(mem->machine, 5, memory_region(mem->machine, "maincpu") + 0x28000); |
| 155 | memory_set_bankptr(mem->machine, 6, memory_region(mem->machine, "maincpu") + 0x2a000); |
| 156 | memory_set_bankptr(mem->machine, 7, memory_region(mem->machine, "maincpu") + 0x2c000); |
| 157 | memory_set_bankptr(mem->machine, 8, memory_region(mem->machine, "maincpu") + 0x2e000); |
| 160 | 158 | memory_set_bankptr(mem->machine, 11, memory_region(mem->machine, "maincpu") + 0x20000); |
| 161 | 159 | memory_set_bankptr(mem->machine, 12, memory_region(mem->machine, "maincpu") + 0x22000); |
| 162 | 160 | memory_set_bankptr(mem->machine, 13, memory_region(mem->machine, "maincpu") + 0x24000); |
| r5023 | r5024 | |
| 167 | 165 | memory_set_bankptr(mem->machine, 18, memory_region(mem->machine, "maincpu") + 0x2e000); |
| 168 | 166 | } |
| 169 | 167 | else |
| 170 | | logerror("cannot understand bankswitch command %X\n",data); |
| 168 | logerror("%04X: Cannot understand bankswitch command %X\n",cpu_get_pc(space->cpu), data); |
| 171 | 169 | } |
| 172 | 170 | |
| 173 | 171 | static ADDRESS_MAP_START( camplynx_mem, ADDRESS_SPACE_PROGRAM, 8) |
| r5023 | r5024 | |
| 185 | 183 | ADDRESS_MAP_END |
| 186 | 184 | |
| 187 | 185 | static ADDRESS_MAP_START( lynx128_mem, ADDRESS_SPACE_PROGRAM, 8) |
| 188 | | AM_RANGE(0x0000,0x1fff) AM_RAMBANK(1) |
| 189 | | AM_RANGE(0x2000,0x3fff) AM_RAMBANK(2) |
| 190 | | AM_RANGE(0x4000,0x5fff) AM_RAMBANK(3) |
| 191 | | AM_RANGE(0x6000,0x7fff) AM_RAMBANK(4) |
| 192 | | AM_RANGE(0x8000,0x9fff) AM_RAMBANK(5) |
| 193 | | AM_RANGE(0xa000,0xbfff) AM_RAMBANK(6) |
| 194 | | AM_RANGE(0xc000,0xdfff) AM_RAMBANK(7) |
| 195 | | AM_RANGE(0xe000,0xffff) AM_RAMBANK(8) |
| 196 | 186 | ADDRESS_MAP_END |
| 197 | 187 | |
| 198 | 188 | static ADDRESS_MAP_START( camplynx_io , ADDRESS_SPACE_IO, 8) |
| r5023 | r5024 | |
| 393 | 383 | UINT8 r,g,b; |
| 394 | 384 | UINT16 x, *p = BITMAP_ADDR16(bitmap, y, 0); |
| 395 | 385 | |
| 396 | | for (x = (y << 5); x < x_count + (y << 5); x++) |
| 386 | for (x = (y << 6); x < x_count + (y << 6); x++) |
| 397 | 387 | { |
| 398 | 388 | r = RAM[0x20100+x]; |
| 399 | 389 | g = RAM[0x28100+x]; |
| r5023 | r5024 | |
| 436 | 426 | }; |
| 437 | 427 | |
| 438 | 428 | static const mc6845_interface lynx128_crtc6845_interface = { |
| 439 | | "screen", |
| 440 | | 8, |
| 429 | "screen", /* screen name */ |
| 430 | 8, /* dots per character */ |
| 441 | 431 | NULL, |
| 442 | | lynx128_update_row, |
| 432 | lynx128_update_row, /* callback to display one scanline */ |
| 443 | 433 | NULL, |
| 444 | 434 | DEVCB_NULL, |
| 445 | 435 | DEVCB_NULL, |
| 446 | | DEVCB_HANDLER(lynx128_irq), |
| 436 | DEVCB_HANDLER(lynx128_irq), /* callback when cursor pin changes state */ |
| 447 | 437 | DEVCB_NULL, |
| 448 | 438 | NULL |
| 449 | 439 | }; |