src/mess/machine/exidy.c
| r5952 | r5953 | |
| 5 | 5 | *******************************************************************************/ |
| 6 | 6 | |
| 7 | 7 | #include "driver.h" |
| 8 | #include "cpu/z80/z80.h" |
| 8 | 9 | #include "sound/speaker.h" |
| 9 | 10 | #include "sound/wave.h" |
| 10 | 11 | #include "machine/ctronics.h" |
| r5952 | r5953 | |
| 334 | 335 | UINT8 data=0x7f; |
| 335 | 336 | |
| 336 | 337 | /* bit 7 = printer busy |
| 337 | | 0 = printer is not busy */ |
| 338 | 0 = printer is not busy */ |
| 338 | 339 | |
| 339 | 340 | data |= centronics_busy_r(printer) << 7; |
| 340 | 341 | |
| r5952 | r5953 | |
| 390 | 391 | } |
| 391 | 392 | } |
| 392 | 393 | |
| 394 | /****************************************************************************** |
| 395 | Snapshot Handling |
| 396 | ******************************************************************************/ |
| 397 | |
| 398 | SNAPSHOT_LOAD(exidy) |
| 399 | { |
| 400 | UINT8 *ptr = memory_region(image->machine, "maincpu"); |
| 401 | const device_config *cpu = cputag_get_cpu(image->machine, "maincpu"); |
| 402 | const UINT8 header[28]; |
| 403 | |
| 404 | /* check size */ |
| 405 | if (snapshot_size != 0x1001c) |
| 406 | { |
| 407 | image_seterror(image, IMAGE_ERROR_INVALIDIMAGE, "Snapshot must be 65564 bytes"); |
| 408 | return INIT_FAIL; |
| 409 | } |
| 410 | |
| 411 | /* get the header */ |
| 412 | image_fread(image, &header, sizeof(header)); |
| 413 | |
| 414 | /* write it to ram */ |
| 415 | image_fread(image, ptr, 0x10000); |
| 416 | |
| 417 | /* patch CPU registers */ |
| 418 | cpu_set_reg(cpu, Z80_I, header[0]); |
| 419 | cpu_set_reg(cpu, Z80_HL2, header[1] | (header[2] << 8)); |
| 420 | cpu_set_reg(cpu, Z80_DE2, header[3] | (header[4] << 8)); |
| 421 | cpu_set_reg(cpu, Z80_BC2, header[5] | (header[6] << 8)); |
| 422 | cpu_set_reg(cpu, Z80_AF2, header[7] | (header[8] << 8)); |
| 423 | cpu_set_reg(cpu, Z80_HL, header[9] | (header[10] << 8)); |
| 424 | cpu_set_reg(cpu, Z80_DE, header[11] | (header[12] << 8)); |
| 425 | cpu_set_reg(cpu, Z80_BC, header[13] | (header[14] << 8)); |
| 426 | cpu_set_reg(cpu, Z80_IY, header[15] | (header[16] << 8)); |
| 427 | cpu_set_reg(cpu, Z80_IX, header[17] | (header[18] << 8)); |
| 428 | cpu_set_reg(cpu, Z80_IFF1, header[19]&2 ? 1 : 0); |
| 429 | cpu_set_reg(cpu, Z80_IFF2, header[19]&4 ? 1 : 0); |
| 430 | cpu_set_reg(cpu, Z80_R, header[20]); |
| 431 | cpu_set_reg(cpu, Z80_AF, header[21] | (header[22] << 8)); |
| 432 | cpu_set_reg(cpu, REG_GENSP, header[23] | (header[24] << 8)); |
| 433 | cpu_set_reg(cpu, Z80_IM, header[25]); |
| 434 | cpu_set_reg(cpu, REG_GENPC, header[26] | (header[27] << 8)); |
| 435 | |
| 436 | return INIT_PASS; |
| 437 | } |
| 438 | |
| 393 | 439 | MACHINE_START( exidy ) |
| 394 | 440 | { |
| 395 | 441 | // serial_timer = timer_alloc(machine, exidy_serial_timer_callback, NULL); |
src/mess/drivers/exidy.c
| r5952 | r5953 | |
| 156 | 156 | static ADDRESS_MAP_START( exidy_mem, ADDRESS_SPACE_PROGRAM, 8) |
| 157 | 157 | ADDRESS_MAP_UNMAP_HIGH |
| 158 | 158 | AM_RANGE(0x0000, 0x07ff) AM_RAMBANK(1) |
| 159 | | AM_RANGE(0x0800, 0x7fff) AM_RAM /* ram 32k machine */ |
| 160 | | AM_RANGE(0x8000, 0xbbff) AM_READWRITE(exidy_read_ff, SMH_NOP) |
| 161 | | AM_RANGE(0xbc00, 0xbcff) AM_ROM /* disk bios */ |
| 159 | AM_RANGE(0x0800, 0xbbff) AM_RAM AM_REGION("maincpu", 0x0800) |
| 160 | AM_RANGE(0xbc00, 0xbcff) AM_ROM /* disk bios */ |
| 162 | 161 | AM_RANGE(0xbd00, 0xbdff) AM_READWRITE(exidy_read_ff, SMH_NOP) |
| 163 | 162 | AM_RANGE(0xbe00, 0xbe03) AM_DEVREADWRITE("wd179x", wd17xx_r, wd17xx_w) |
| 164 | 163 | AM_RANGE(0xbe04, 0xbfff) AM_READWRITE(exidy_read_ff, SMH_NOP) |
| 165 | | AM_RANGE(0xc000, 0xefff) AM_ROM /* rom pac and bios */ |
| 164 | AM_RANGE(0xc000, 0xefff) AM_ROM /* rom pac and bios */ |
| 166 | 165 | AM_RANGE(0xf000, 0xf7ff) AM_RAM AM_REGION("maincpu", 0xf000) /* screen ram */ |
| 167 | | AM_RANGE(0xf800, 0xfbff) AM_ROM /* char rom */ |
| 168 | | AM_RANGE(0xfc00, 0xffff) AM_RAM AM_REGION("maincpu", 0xfc00) /* programmable chars */ |
| 166 | AM_RANGE(0xf800, 0xfbff) AM_ROM /* char rom */ |
| 167 | AM_RANGE(0xfc00, 0xffff) AM_RAM AM_REGION("maincpu", 0xfc00) /* programmable chars */ |
| 169 | 168 | ADDRESS_MAP_END |
| 170 | 169 | |
| 171 | 170 | static ADDRESS_MAP_START( exidyd_mem, ADDRESS_SPACE_PROGRAM, 8) |
| 172 | 171 | ADDRESS_MAP_UNMAP_HIGH |
| 173 | 172 | AM_RANGE(0x0000, 0x07ff) AM_RAMBANK(1) |
| 174 | | AM_RANGE(0x0800, 0xbfff) AM_RAM /* ram 48k cassette-based machine */ |
| 175 | | AM_RANGE(0xc000, 0xefff) AM_ROM /* rom pac and bios */ |
| 173 | AM_RANGE(0x0800, 0xbfff) AM_RAM AM_REGION("maincpu", 0x0800) |
| 174 | AM_RANGE(0xc000, 0xefff) AM_ROM /* rom pac and bios */ |
| 176 | 175 | AM_RANGE(0xf000, 0xf7ff) AM_RAM AM_REGION("maincpu", 0xf000) /* screen ram */ |
| 177 | | AM_RANGE(0xf800, 0xfbff) AM_ROM /* char rom */ |
| 178 | | AM_RANGE(0xfc00, 0xffff) AM_RAM AM_REGION("maincpu", 0xfc00) /* programmable chars */ |
| 176 | AM_RANGE(0xf800, 0xfbff) AM_ROM /* char rom */ |
| 177 | AM_RANGE(0xfc00, 0xffff) AM_RAM AM_REGION("maincpu", 0xfc00) /* programmable chars */ |
| 179 | 178 | ADDRESS_MAP_END |
| 180 | 179 | |
| 181 | 180 | static ADDRESS_MAP_START( exidy_io, ADDRESS_SPACE_IO, 8) |
| r5952 | r5953 | |
| 392 | 391 | MDRV_CENTRONICS_ADD("centronics", standard_centronics) |
| 393 | 392 | |
| 394 | 393 | /* quickload */ |
| 394 | MDRV_SNAPSHOT_ADD("snapshot", exidy, "snp", 2) |
| 395 | 395 | MDRV_Z80BIN_QUICKLOAD_ADD("quickload", exidy, 2) |
| 396 | 396 | |
| 397 | 397 | MDRV_CASSETTE_ADD( "cassette1", exidy_cassette_config ) |