src/mess/drivers/act.c
| r6246 | r6247 | |
| 14 | 14 | #include "driver.h" |
| 15 | 15 | #include "cpu/i86/i86.h" |
| 16 | 16 | #include "video/mc6845.h" |
| 17 | | #include "machine/8255ppi.h" |
| 17 | #include "machine/i8255a.h" |
| 18 | 18 | #include "machine/wd17xx.h" |
| 19 | 19 | #include "devices/flopdrv.h" |
| 20 | 20 | #include "cpu/z80/z80daisy.h" |
| r6246 | r6247 | |
| 238 | 238 | ADDRESS_MAP_UNMAP_HIGH |
| 239 | 239 | AM_RANGE(0x0000, 0x0003) AM_DEVREADWRITE8("pic8259_master",pic8259_r, pic8259_w,0x00ff) |
| 240 | 240 | AM_RANGE(0x0040, 0x0047) AM_READWRITE8(act_fdc_r, act_fdc_w,0x00ff) |
| 241 | | AM_RANGE(0x0048, 0x004f) AM_DEVREADWRITE8("ppi8255_0", ppi8255_r, ppi8255_w,0x00ff) |
| 241 | AM_RANGE(0x0048, 0x004f) AM_DEVREADWRITE8("ppi8255_0", i8255a_r, i8255a_w,0x00ff) |
| 242 | 242 | // AM_RANGE(0x0050, 0x0051) sound gen |
| 243 | 243 | AM_RANGE(0x0058, 0x005f) AM_DEVREADWRITE8("pit8253",pit8253_r,pit8253_w,0x00ff) |
| 244 | 244 | AM_RANGE(0x0060, 0x0067) AM_READWRITE8(act_sio_r,act_sio_w,0x00ff) |
| r6246 | r6247 | |
| 344 | 344 | wd17xx_set_side(dev,(data & 0x04)>>2); |
| 345 | 345 | } |
| 346 | 346 | |
| 347 | | static const ppi8255_interface ppi8255_intf = |
| 347 | static I8255A_INTERFACE( ppi8255_intf ) |
| 348 | 348 | { |
| 349 | 349 | DEVCB_NULL, /* Port A read */ |
| 350 | 350 | DEVCB_HANDLER(act_portb_r), /* Port B read */ |
| r6246 | r6247 | |
| 496 | 496 | |
| 497 | 497 | // MDRV_MC6845_ADD("crtc", MC6845, XTAL_3_579545MHz/2, mc6845_intf) /* hand tuned to get ~50 fps */ |
| 498 | 498 | |
| 499 | | // MDRV_PPI8255_ADD("ppi8255_0", ppi8255_intf ) |
| 499 | // MDRV_I8255A_ADD("ppi8255_0", ppi8255_intf ) |
| 500 | 500 | MDRV_WD2793_ADD("fdc", act_wd2797_interface ) |
| 501 | 501 | |
| 502 | 502 | MDRV_GFXDECODE(act_f1) |
| r6246 | r6247 | |
| 525 | 525 | |
| 526 | 526 | MDRV_MC6845_ADD("crtc", MC6845, XTAL_3_579545MHz/2, mc6845_intf) /* hand tuned to get ~50 fps */ |
| 527 | 527 | |
| 528 | | MDRV_PPI8255_ADD("ppi8255_0", ppi8255_intf ) |
| 528 | MDRV_I8255A_ADD("ppi8255_0", ppi8255_intf ) |
| 529 | 529 | MDRV_WD2793_ADD("fdc", act_wd2797_interface ) |
| 530 | 530 | MDRV_PIC8259_ADD( "pic8259_master", pic8259_master_config ) |
| 531 | 531 | MDRV_PIT8253_ADD( "pit8253", pit8253_config ) |
src/mess/drivers/x1.c
| r6246 | r6247 | |
| 176 | 176 | #include "cpu/z80/z80daisy.h" |
| 177 | 177 | #include "machine/z80ctc.h" |
| 178 | 178 | #include "machine/z80sio.h" |
| 179 | | #include "machine/8255ppi.h" |
| 179 | #include "machine/i8255a.h" |
| 180 | 180 | #include "machine/z80dma.h" |
| 181 | 181 | #include "sound/ay8910.h" |
| 182 | 182 | #include "video/mc6845.h" |
| r6246 | r6247 | |
| 1278 | 1278 | else if(offset >= 0x0ff8 && offset <= 0x0fff) { return x1_fdc_r(space, offset-0xff8); } |
| 1279 | 1279 | else if(offset >= 0x1400 && offset <= 0x17ff) { return x1_pcg_r(space, offset-0x1400); } |
| 1280 | 1280 | else if(offset >= 0x1900 && offset <= 0x19ff) { return sub_io_r(space, 0); } |
| 1281 | | else if(offset >= 0x1a00 && offset <= 0x1aff) { return ppi8255_r(devtag_get_device(space->machine, "ppi8255_0"), (offset-0x1a00) & 3); } |
| 1281 | else if(offset >= 0x1a00 && offset <= 0x1aff) { return i8255a_r(devtag_get_device(space->machine, "ppi8255_0"), (offset-0x1a00) & 3); } |
| 1282 | 1282 | else if(offset >= 0x1b00 && offset <= 0x1bff) { return ay8910_r(devtag_get_device(space->machine, "ay"), 0); } |
| 1283 | 1283 | // else if(offset >= 0x1f80 && offset <= 0x1f8f) { return z80dma_r(devtag_get_device(space->machine, "dma"), 0); } |
| 1284 | 1284 | // else if(offset >= 0x1f90 && offset <= 0x1f91) { return z80sio_c_r(devtag_get_device(space->machine, "sio"), (offset-0x1f90) & 1); } |
| r6246 | r6247 | |
| 1312 | 1312 | else if(offset >= 0x1400 && offset <= 0x17ff) { x1_pcg_w(space, offset-0x1400,data); } |
| 1313 | 1313 | else if(offset == 0x1800 || offset == 0x1801) { x1_6845_w(space, offset-0x1800, data); } |
| 1314 | 1314 | else if(offset >= 0x1900 && offset <= 0x19ff) { sub_io_w(space, 0,data); } |
| 1315 | | else if(offset >= 0x1a00 && offset <= 0x1aff) { ppi8255_w(devtag_get_device(space->machine, "ppi8255_0"), (offset-0x1a00) & 3,data); } |
| 1315 | else if(offset >= 0x1a00 && offset <= 0x1aff) { i8255a_w(devtag_get_device(space->machine, "ppi8255_0"), (offset-0x1a00) & 3,data); } |
| 1316 | 1316 | else if(offset >= 0x1b00 && offset <= 0x1bff) { ay8910_data_w(devtag_get_device(space->machine, "ay"), 0,data); } |
| 1317 | 1317 | else if(offset >= 0x1c00 && offset <= 0x1cff) { ay8910_address_w(devtag_get_device(space->machine, "ay"), 0,data); } |
| 1318 | 1318 | else if(offset >= 0x1d00 && offset <= 0x1dff) { rom_bank_1_w(space,0,data); } |
| r6246 | r6247 | |
| 1348 | 1348 | else if(offset >= 0x0ff8 && offset <= 0x0fff) { return x1_fdc_r(space, offset-0xff8); } |
| 1349 | 1349 | else if(offset >= 0x1400 && offset <= 0x17ff) { return x1_pcg_r(space, offset-0x1400); } |
| 1350 | 1350 | else if(offset >= 0x1900 && offset <= 0x19ff) { return sub_io_r(space, 0); } |
| 1351 | | else if(offset >= 0x1a00 && offset <= 0x1aff) { return ppi8255_r(devtag_get_device(space->machine, "ppi8255_0"), (offset-0x1a00) & 3); } |
| 1351 | else if(offset >= 0x1a00 && offset <= 0x1aff) { return i8255a_r(devtag_get_device(space->machine, "ppi8255_0"), (offset-0x1a00) & 3); } |
| 1352 | 1352 | else if(offset >= 0x1b00 && offset <= 0x1bff) { return ay8910_r(devtag_get_device(space->machine, "ay"), 0); } |
| 1353 | 1353 | else if(offset >= 0x1f80 && offset <= 0x1f8f) { return z80dma_r(devtag_get_device(space->machine, "dma"), 0); } |
| 1354 | 1354 | else if(offset >= 0x1f90 && offset <= 0x1f91) { return z80sio_c_r(devtag_get_device(space->machine, "sio"), (offset-0x1f90) & 1); } |
| r6246 | r6247 | |
| 1389 | 1389 | else if(offset >= 0x1400 && offset <= 0x17ff) { x1_pcg_w(space, offset-0x1400,data); } |
| 1390 | 1390 | else if(offset == 0x1800 || offset == 0x1801) { x1_6845_w(space, offset-0x1800, data); } |
| 1391 | 1391 | else if(offset >= 0x1900 && offset <= 0x19ff) { sub_io_w(space, 0,data); } |
| 1392 | | else if(offset >= 0x1a00 && offset <= 0x1aff) { ppi8255_w(devtag_get_device(space->machine, "ppi8255_0"), (offset-0x1a00) & 3,data); } |
| 1392 | else if(offset >= 0x1a00 && offset <= 0x1aff) { i8255a_w(devtag_get_device(space->machine, "ppi8255_0"), (offset-0x1a00) & 3,data); } |
| 1393 | 1393 | else if(offset >= 0x1b00 && offset <= 0x1bff) { ay8910_data_w(devtag_get_device(space->machine, "ay"), 0,data); } |
| 1394 | 1394 | else if(offset >= 0x1c00 && offset <= 0x1cff) { ay8910_address_w(devtag_get_device(space->machine, "ay"), 0,data); } |
| 1395 | 1395 | else if(offset >= 0x1d00 && offset <= 0x1dff) { rom_bank_1_w(space,0,data); } |
| r6246 | r6247 | |
| 1514 | 1514 | cassette_output(devtag_get_device(device->machine,"cass"),(data & 0x01) ? +1.0 : -1.0); |
| 1515 | 1515 | } |
| 1516 | 1516 | |
| 1517 | | static const ppi8255_interface ppi8255_intf = |
| 1517 | static I8255A_INTERFACE( ppi8255_intf ) |
| 1518 | 1518 | { |
| 1519 | 1519 | DEVCB_HANDLER(x1_porta_r), /* Port A read */ |
| 1520 | 1520 | DEVCB_HANDLER(x1_portb_r), /* Port B read */ |
| r6246 | r6247 | |
| 2129 | 2129 | |
| 2130 | 2130 | MDRV_DEVICE_ADD("x1kb", DEVICE_GET_INFO_NAME(x1_keyboard_getinfo), 0) |
| 2131 | 2131 | |
| 2132 | | MDRV_PPI8255_ADD( "ppi8255_0", ppi8255_intf ) |
| 2132 | MDRV_I8255A_ADD( "ppi8255_0", ppi8255_intf ) |
| 2133 | 2133 | |
| 2134 | 2134 | MDRV_MACHINE_RESET(x1) |
| 2135 | 2135 | |
src/mess/drivers/pc98.c
| r6246 | r6247 | |
| 225 | 225 | |
| 226 | 226 | #include "driver.h" |
| 227 | 227 | #include "cpu/i386/i386.h" |
| 228 | | #include "machine/8255ppi.h" |
| 228 | #include "machine/i8255a.h" |
| 229 | 229 | #include "machine/pit8253.h" |
| 230 | 230 | #include "machine/8237dma.h" |
| 231 | 231 | #include "machine/pic8259.h" |
| r6246 | r6247 | |
| 317 | 317 | return 0x18; //FIXME: kludge to get over a probable PPI bug. |
| 318 | 318 | |
| 319 | 319 | if(offset & 1) |
| 320 | | return ppi8255_r(devtag_get_device(space->machine, "ppi8255_0"), (offset & 6) >> 1); |
| 320 | return i8255a_r(devtag_get_device(space->machine, "ppi8255_0"), (offset & 6) >> 1); |
| 321 | 321 | |
| 322 | 322 | logerror("RS-232c R access %02x\n",offset >> 1); |
| 323 | 323 | return 0xff; |
| r6246 | r6247 | |
| 327 | 327 | static WRITE8_HANDLER( sys_port_w ) |
| 328 | 328 | { |
| 329 | 329 | if(offset & 1) |
| 330 | | ppi8255_w(devtag_get_device(space->machine, "ppi8255_0"), (offset & 6) >> 1, data); |
| 330 | i8255a_w(devtag_get_device(space->machine, "ppi8255_0"), (offset & 6) >> 1, data); |
| 331 | 331 | else |
| 332 | 332 | logerror("RS-232c W access %02x %02x\n",offset >> 1,data); |
| 333 | 333 | } |
| r6246 | r6247 | |
| 335 | 335 | static READ8_HANDLER( sio_port_r ) |
| 336 | 336 | { |
| 337 | 337 | if(!(offset & 1)) |
| 338 | | return ppi8255_r(devtag_get_device(space->machine, "ppi8255_1"), (offset & 6) >> 1); |
| 338 | return i8255a_r(devtag_get_device(space->machine, "ppi8255_1"), (offset & 6) >> 1); |
| 339 | 339 | |
| 340 | 340 | logerror("keyboard R access %02x\n",offset >> 1); |
| 341 | 341 | return 0xff; |
| r6246 | r6247 | |
| 345 | 345 | static WRITE8_HANDLER( sio_port_w ) |
| 346 | 346 | { |
| 347 | 347 | if(!(offset & 1)) |
| 348 | | ppi8255_w(devtag_get_device(space->machine, "ppi8255_1"), (offset & 6) >> 1, data); |
| 348 | i8255a_w(devtag_get_device(space->machine, "ppi8255_1"), (offset & 6) >> 1, data); |
| 349 | 349 | else |
| 350 | 350 | logerror("keyboard W access %02x %02x\n",offset >> 1,data); |
| 351 | 351 | } |
| r6246 | r6247 | |
| 780 | 780 | //printf("PPI Port C write %02x\n",data); |
| 781 | 781 | } |
| 782 | 782 | |
| 783 | | static const ppi8255_interface ppi8255_intf = |
| 783 | static I8255A_INTERFACE( ppi8255_intf ) |
| 784 | 784 | { |
| 785 | 785 | DEVCB_HANDLER(pc98_porta_r), /* Port A read */ |
| 786 | 786 | DEVCB_HANDLER(pc98_portb_r), /* Port B read */ |
| r6246 | r6247 | |
| 810 | 810 | } |
| 811 | 811 | |
| 812 | 812 | |
| 813 | | static const ppi8255_interface printer_intf = |
| 813 | static I8255A_INTERFACE( printer_intf ) |
| 814 | 814 | { |
| 815 | 815 | DEVCB_HANDLER(printer_porta_r), /* Port A read */ |
| 816 | 816 | DEVCB_HANDLER(printer_portb_r), /* Port B read */ |
| r6246 | r6247 | |
| 950 | 950 | |
| 951 | 951 | MDRV_MACHINE_RESET(pc9801) |
| 952 | 952 | |
| 953 | | MDRV_PPI8255_ADD( "ppi8255_0", ppi8255_intf ) |
| 954 | | MDRV_PPI8255_ADD( "ppi8255_1", printer_intf ) |
| 953 | MDRV_I8255A_ADD( "ppi8255_0", ppi8255_intf ) |
| 954 | MDRV_I8255A_ADD( "ppi8255_1", printer_intf ) |
| 955 | 955 | MDRV_PIT8253_ADD( "pit8253", pit8253_config ) |
| 956 | 956 | MDRV_DMA8237_ADD( "dma8237_1", dma8237_1_config ) |
| 957 | 957 | MDRV_PIC8259_ADD( "pic8259_master", pic8259_master_config ) |