src/mess/drivers/camplynx.c
| r5011 | r5012 | |
| 62 | 62 | |
| 63 | 63 | The work so far is without the benefit of manuals, schematic etc [Robbbert] |
| 64 | 64 | |
| 65 | | Sound is working. The cassette save also uses the sound dac, but the |
| 66 | | output should be redirected to the cassette. This isn't done yet. |
| 65 | Cassette operation is strange indeed. Save takes the dac output and directs |
| 66 | it to the tape. Load takes over line 0 of the keyboard and uses bits 0 and 5. |
| 67 | 67 | |
| 68 | 68 | To Do: |
| 69 | 69 | 128k, 96k: everything |
| r5011 | r5012 | |
| 84 | 84 | |
| 85 | 85 | static const device_config *mc6845; |
| 86 | 86 | |
| 87 | static WRITE8_HANDLER( camplynx_bank_w ) |
| 88 | { |
| 89 | /* This is very incomplete, just enough to get the computer working. |
| 90 | Also, as it happens twice for every scanline of every character, |
| 91 | it causes a huge slowdown. */ |
| 92 | |
| 93 | if (!data) |
| 94 | memory_set_bank(space->machine, 1, 0); |
| 95 | else |
| 96 | if (data & 2) |
| 97 | memory_set_bank(space->machine, 1, 1); |
| 98 | else |
| 99 | if (data & 4) |
| 100 | memory_set_bank(space->machine, 1, 2); |
| 101 | else |
| 102 | logerror("cannot understand bankswitch command %X\n",data); |
| 103 | } |
| 104 | |
| 105 | |
| 87 | 106 | static ADDRESS_MAP_START( camplynx_mem, ADDRESS_SPACE_PROGRAM, 8) |
| 88 | 107 | ADDRESS_MAP_UNMAP_HIGH |
| 89 | 108 | AM_RANGE(0x0000,0x5fff) AM_ROM |
| 90 | | AM_RANGE(0x6000,0xffff) AM_RAM |
| 91 | | AM_RANGE(0x8000,0x9fff) AM_BASE(&videoram) |
| 109 | AM_RANGE(0x6000,0x7fff) AM_RAM |
| 110 | AM_RANGE(0x8000,0xffff) AM_RAMBANK(1) |
| 92 | 111 | ADDRESS_MAP_END |
| 93 | 112 | |
| 94 | 113 | static ADDRESS_MAP_START( camp96_mem, ADDRESS_SPACE_PROGRAM, 8) |
| 95 | 114 | ADDRESS_MAP_UNMAP_HIGH |
| 96 | 115 | AM_RANGE(0x0000,0x5fff) AM_ROM |
| 97 | 116 | AM_RANGE(0x6000,0xdfff) AM_RAM |
| 98 | | AM_RANGE(0xe000,0xffff) AM_ROM |
| 99 | | AM_RANGE(0x8000,0x9fff) AM_BASE(&videoram) |
| 117 | AM_RANGE(0x6000,0x7fff) AM_RAM |
| 118 | AM_RANGE(0x8000,0xffff) AM_RAMBANK(1) |
| 119 | // AM_RANGE(0xe000,0xffff) AM_ROM |
| 120 | // AM_RANGE(0x8000,0x9fff) AM_BASE(&videoram) |
| 100 | 121 | ADDRESS_MAP_END |
| 101 | 122 | |
| 102 | 123 | static ADDRESS_MAP_START( camplynx_io , ADDRESS_SPACE_IO, 8) |
| 103 | 124 | ADDRESS_MAP_UNMAP_HIGH |
| 104 | | AM_RANGE(0x007f,0x007f) AM_MIRROR(0xff00) AM_WRITE(SMH_NOP) /* these 2 seem to be */ |
| 105 | | AM_RANGE(0x0080,0x0080) AM_MIRROR(0xff00) AM_WRITE(SMH_NOP) /* for bankswitching */ |
| 125 | AM_RANGE(0x007f,0x007f) AM_MIRROR(0xff00) AM_WRITE(camplynx_bank_w) |
| 126 | AM_RANGE(0x0080,0x0080) AM_MIRROR(0xff00) AM_WRITE(SMH_NOP) /* to be emulated */ |
| 106 | 127 | AM_RANGE(0x0080,0x0080) AM_READ_PORT("LINE0") |
| 107 | 128 | AM_RANGE(0x0180,0x0180) AM_READ_PORT("LINE1") |
| 108 | 129 | AM_RANGE(0x0280,0x0280) AM_READ_PORT("LINE2") |
| r5011 | r5012 | |
| 203 | 224 | { |
| 204 | 225 | } |
| 205 | 226 | |
| 227 | static const UINT8 camplynx_palette[16*3] = |
| 228 | { |
| 229 | 0x00, 0x00, 0x00, /* 0 Black */ |
| 230 | 0x00, 0x00, 0xff, /* 1 Blue */ |
| 231 | 0xff, 0x00, 0x00, /* 2 Red */ |
| 232 | 0xff, 0x00, 0xff, /* 3 Magenta */ |
| 233 | 0x00, 0xff, 0x00, /* 4 Green */ |
| 234 | 0x00, 0xff, 0xff, /* 5 Cyan */ |
| 235 | 0xff, 0xff, 0x00, /* 6 Yellow */ |
| 236 | 0xff, 0xff, 0xff, /* 7 White */ |
| 237 | }; |
| 238 | |
| 239 | static PALETTE_INIT( camplynx ) |
| 240 | { |
| 241 | UINT8 r, b, g, i=0, color_count = 8; |
| 242 | |
| 243 | while (color_count--) |
| 244 | { |
| 245 | r = camplynx_palette[i++]; g = camplynx_palette[i++]; b = camplynx_palette[i++]; |
| 246 | palette_set_color(machine, 7-color_count, MAKE_RGB(r, g, b)); |
| 247 | } |
| 248 | } |
| 249 | |
| 206 | 250 | static MC6845_UPDATE_ROW( camplynx_update_row ) |
| 207 | 251 | { |
| 208 | | UINT8 gfx,fg=1,bg=0; |
| 209 | | |
| 252 | UINT8 *RAM = memory_region(device->machine, "maincpu"); |
| 253 | UINT8 r,g,b; |
| 210 | 254 | UINT16 x, *p = BITMAP_ADDR16(bitmap, y, 0); |
| 211 | 255 | |
| 212 | 256 | for (x = (y << 5); x < x_count + (y << 5); x++) |
| 213 | 257 | { |
| 214 | | gfx = videoram[x]; |
| 215 | | if (x == cursor_x) gfx^=0xff; // not used - cursor is generated in software |
| 258 | r = RAM[0x14000|x]; |
| 259 | g = RAM[0x1c000|x]; |
| 260 | b = RAM[0x10000|x]; |
| 216 | 261 | |
| 217 | | *p = ( gfx & 0x80 ) ? fg : bg; p++; |
| 218 | | *p = ( gfx & 0x40 ) ? fg : bg; p++; |
| 219 | | *p = ( gfx & 0x20 ) ? fg : bg; p++; |
| 220 | | *p = ( gfx & 0x10 ) ? fg : bg; p++; |
| 221 | | *p = ( gfx & 0x08 ) ? fg : bg; p++; |
| 222 | | *p = ( gfx & 0x04 ) ? fg : bg; p++; |
| 223 | | *p = ( gfx & 0x02 ) ? fg : bg; p++; |
| 224 | | *p = ( gfx & 0x01 ) ? fg : bg; p++; |
| 262 | *p = ((r & 0x80) ? 2 : 0) | ((g & 0x80) ? 4 : 0) | ((b & 0x80) ? 1 : 0); p++; |
| 263 | *p = ((r & 0x40) ? 2 : 0) | ((g & 0x40) ? 4 : 0) | ((b & 0x40) ? 1 : 0); p++; |
| 264 | *p = ((r & 0x20) ? 2 : 0) | ((g & 0x20) ? 4 : 0) | ((b & 0x20) ? 1 : 0); p++; |
| 265 | *p = ((r & 0x10) ? 2 : 0) | ((g & 0x10) ? 4 : 0) | ((b & 0x10) ? 1 : 0); p++; |
| 266 | *p = ((r & 0x08) ? 2 : 0) | ((g & 0x08) ? 4 : 0) | ((b & 0x08) ? 1 : 0); p++; |
| 267 | *p = ((r & 0x04) ? 2 : 0) | ((g & 0x04) ? 4 : 0) | ((b & 0x04) ? 1 : 0); p++; |
| 268 | *p = ((r & 0x02) ? 2 : 0) | ((g & 0x02) ? 4 : 0) | ((b & 0x02) ? 1 : 0); p++; |
| 269 | *p = ((r & 0x01) ? 2 : 0) | ((g & 0x01) ? 4 : 0) | ((b & 0x01) ? 1 : 0); p++; |
| 225 | 270 | } |
| 226 | 271 | } |
| 227 | 272 | |
| r5011 | r5012 | |
| 266 | 311 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 267 | 312 | MDRV_SCREEN_SIZE(512, 480) |
| 268 | 313 | MDRV_SCREEN_VISIBLE_AREA(0, 511, 0, 479) |
| 269 | | MDRV_PALETTE_LENGTH(2) |
| 270 | | MDRV_PALETTE_INIT(black_and_white) |
| 314 | MDRV_PALETTE_LENGTH(8) |
| 315 | MDRV_PALETTE_INIT(camplynx) |
| 271 | 316 | |
| 272 | 317 | MDRV_MC6845_ADD("crtc", MC6845, XTAL_12MHz / 8 /*? dot clock divided by dots per char */, camplynx_crtc6845_interface) |
| 273 | 318 | |
| r5011 | r5012 | |
| 287 | 332 | MDRV_CPU_PROGRAM_MAP(camp96_mem) |
| 288 | 333 | MACHINE_DRIVER_END |
| 289 | 334 | |
| 335 | static DRIVER_INIT( camplynx ) |
| 336 | { |
| 337 | UINT8 *RAM = memory_region(machine, "maincpu"); |
| 338 | memory_configure_bank(machine, 1, 0, 3, &RAM[0x8000], 0x8000); |
| 339 | } |
| 340 | |
| 290 | 341 | /* ROM definition */ |
| 291 | 342 | ROM_START( camplynx ) |
| 292 | | ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF ) |
| 343 | ROM_REGION( 0x30000, "maincpu", ROMREGION_ERASEFF ) |
| 293 | 344 | ROM_LOAD( "lynx48-1.rom", 0x0000, 0x2000, CRC(56feec44) SHA1(7ded5184561168e159a30fa8e9d3fde5e52aa91a) ) |
| 294 | 345 | ROM_LOAD( "lynx48-2.rom", 0x2000, 0x2000, CRC(d894562e) SHA1(c08a78ecb4eb05baa4c52488fce3648cd2688744) ) |
| 295 | | ROM_FILL(0x8cf,1,0xc9) // cheap rotten hack |
| 296 | 346 | ROM_END |
| 297 | 347 | |
| 298 | 348 | ROM_START( camply96 ) |
| 299 | | ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF ) |
| 349 | ROM_REGION( 0x30000, "maincpu", ROMREGION_ERASEFF ) |
| 300 | 350 | ROM_LOAD( "lynx96-1.rom", 0x0000, 0x2000, CRC(56feec44) SHA1(7ded5184561168e159a30fa8e9d3fde5e52aa91a) ) |
| 301 | 351 | ROM_LOAD( "lynx96-2.rom", 0x2000, 0x2000, CRC(d894562e) SHA1(c08a78ecb4eb05baa4c52488fce3648cd2688744) ) |
| 302 | 352 | ROM_LOAD( "lynx96-3.rom", 0x4000, 0x2000, CRC(21f11709) SHA1(f86a729b01de286197c550974f7825c12815a4f4) ) |
| 303 | 353 | ROM_LOAD( "dosrom.rom", 0xe000, 0x2000, CRC(011e106a) SHA1(e77f0ca99790551a7122945f3194516b2390fb69) ) |
| 304 | | ROM_FILL(0x8cf,1,0xc9) // cheap rotten hack |
| 305 | 354 | ROM_END |
| 306 | 355 | |
| 307 | 356 | ROM_START( camply128 ) |
| r5011 | r5012 | |
| 328 | 377 | |
| 329 | 378 | /* Driver */ |
| 330 | 379 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT CONFIG COMPANY FULLNAME FLAGS */ |
| 331 | | COMP( 1983, camplynx, 0, 0, camplynx, camplynx, 0, camp48, "Camputers", "Lynx 48", GAME_NOT_WORKING) |
| 332 | | COMP( 1983, camply96, camplynx, 0, camp96, camplynx, 0, camp96, "Camputers", "Lynx 96", GAME_NOT_WORKING) |
| 380 | COMP( 1983, camplynx, 0, 0, camplynx, camplynx, camplynx, camp48, "Camputers", "Lynx 48", GAME_NOT_WORKING) |
| 381 | COMP( 1983, camply96, camplynx, 0, camp96, camplynx, camplynx, camp96, "Camputers", "Lynx 96", GAME_NOT_WORKING) |
| 333 | 382 | COMP( 1983, camply128, camplynx, 0, camp96, camplynx, 0, camp128, "Camputers", "Lynx 128", GAME_NOT_WORKING) |