src/mess/drivers/pc9801.c
| r10692 | r10693 | |
| 21 | 21 | #include "machine/8237dma.h" |
| 22 | 22 | #include "machine/pic8259.h" |
| 23 | 23 | #include "machine/upd765.h" |
| 24 | #include "machine/upd1990a.h" |
| 24 | 25 | #include "sound/beep.h" |
| 25 | 26 | #include "video/upd7220.h" |
| 26 | 27 | #include "imagedev/flopdrv.h" |
| r10692 | r10693 | |
| 298 | 299 | if((offset & 1) == 0) |
| 299 | 300 | { |
| 300 | 301 | if(offset == 0) |
| 301 | | printf("Write to RTC port [%02x] <- %02x\n",offset+0x20,data); |
| 302 | { |
| 303 | upd1990a_c0_w(space->machine->device("upd1990a"), (data & 0x01) >> 0); |
| 304 | upd1990a_c1_w(space->machine->device("upd1990a"), (data & 0x02) >> 1); |
| 305 | upd1990a_c2_w(space->machine->device("upd1990a"), (data & 0x04) >> 2); |
| 306 | upd1990a_stb_w(space->machine->device("upd1990a"), (data & 0x08) >> 3); |
| 307 | upd1990a_clk_w(space->machine->device("upd1990a"), (data & 0x10) >> 4); |
| 308 | upd1990a_data_in_w(space->machine->device("upd1990a"), (data & 0x20) >> 5); |
| 309 | if(data & 0xc0) |
| 310 | printf("RTC write to undefined bits %02x\n",data & 0xc0); |
| 311 | } |
| 302 | 312 | else |
| 303 | 313 | printf("Write to undefined port [%02x] <- %02x\n",offset+0x20,data); |
| 304 | 314 | } |
| r10692 | r10693 | |
| 990 | 1000 | PORT_BIT(0x80,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME(" un 7-8") PORT_IMPULSE(1) PORT_CHANGED(key_stroke, 0x7f) //PORT_CODE(KEYCODE_M) PORT_CHAR('M') |
| 991 | 1001 | |
| 992 | 1002 | PORT_START("DSW1") |
| 993 | | PORT_DIPNAME( 0x01, 0x00, "DSW1" ) |
| 994 | | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| 995 | | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 996 | | PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) ) // error beep if OFF |
| 1003 | PORT_BIT(0x01, IP_ACTIVE_HIGH,IPT_SPECIAL) PORT_READ_LINE_DEVICE("upd1990a", upd1990a_data_out_r) |
| 1004 | PORT_DIPNAME( 0x02, 0x00, "DSW1" ) // error beep if OFF |
| 997 | 1005 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) |
| 998 | 1006 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 999 | 1007 | PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) ) |
| r10692 | r10693 | |
| 1331 | 1339 | NULL |
| 1332 | 1340 | }; |
| 1333 | 1341 | |
| 1342 | static UPD1990A_INTERFACE( pc9801_upd1990a_intf ) |
| 1343 | { |
| 1344 | DEVCB_NULL, |
| 1345 | DEVCB_NULL |
| 1346 | }; |
| 1334 | 1347 | |
| 1335 | 1348 | /**************************************** |
| 1336 | 1349 | * |
| r10692 | r10693 | |
| 1358 | 1371 | return r; |
| 1359 | 1372 | } |
| 1360 | 1373 | |
| 1374 | static MACHINE_START(pc9801) |
| 1375 | { |
| 1376 | cpu_set_irq_callback(machine->device("maincpu"), irq_callback); |
| 1361 | 1377 | |
| 1378 | upd1990a_cs_w(machine->device("upd1990a"), 1); |
| 1379 | upd1990a_oe_w(machine->device("upd1990a"), 1); |
| 1380 | } |
| 1381 | |
| 1362 | 1382 | static MACHINE_RESET(pc9801) |
| 1363 | 1383 | { |
| 1364 | 1384 | pc9801_state *state = machine->driver_data<pc9801_state>(); |
| 1365 | 1385 | |
| 1366 | | cpu_set_irq_callback(machine->device("maincpu"), irq_callback); |
| 1367 | | |
| 1368 | 1386 | /* this looks like to be some kind of backup ram, system will boot with green colors otherwise */ |
| 1369 | 1387 | { |
| 1370 | 1388 | int i; |
| r10692 | r10693 | |
| 1432 | 1450 | MCFG_CPU_IO_MAP(pc9801_io) |
| 1433 | 1451 | MCFG_CPU_VBLANK_INT("screen",pc9801_vrtc_irq) |
| 1434 | 1452 | |
| 1453 | MCFG_MACHINE_START(pc9801) |
| 1435 | 1454 | MCFG_MACHINE_RESET(pc9801) |
| 1436 | 1455 | |
| 1437 | 1456 | MCFG_PIT8253_ADD( "pit8253", pit8253_config ) |
| r10692 | r10693 | |
| 1441 | 1460 | MCFG_I8255A_ADD( "ppi8255_sys", ppi_system_intf ) |
| 1442 | 1461 | MCFG_I8255A_ADD( "ppi8255_prn", ppi_printer_intf ) |
| 1443 | 1462 | MCFG_I8255A_ADD( "ppi8255_fdd", ppi_fdd_intf ) |
| 1463 | MCFG_UPD1990A_ADD("upd1990a", XTAL_32_768kHz, pc9801_upd1990a_intf) |
| 1444 | 1464 | |
| 1445 | 1465 | MCFG_UPD765A_ADD("upd765_2dd", upd765_2dd_intf) |
| 1446 | 1466 | MCFG_FLOPPY_4_DRIVES_ADD(pc9801_floppy_config) |
src/mess/drivers/pc8801.c
| r10692 | r10693 | |
| 871 | 871 | ---- --x- monitor refresh rate DIP-SW |
| 872 | 872 | ---- ---x (pbsy?) |
| 873 | 873 | */ |
| 874 | | UINT8 cdo; |
| 875 | | |
| 876 | | cdo = (upd1990a_data_out_r(space->machine->device("upd1990a")) & 1) << 4; |
| 877 | | |
| 878 | | return input_port_read(space->machine, "CTRL") | cdo; |
| 874 | return input_port_read(space->machine, "CTRL"); |
| 879 | 875 | } |
| 880 | 876 | |
| 881 | 877 | static WRITE8_HANDLER( pc8801_ctrl_w ) |
| r10692 | r10693 | |
| 1709 | 1705 | PORT_DIPNAME( 0x08, 0x08, "Auto-boot floppy at start-up" ) |
| 1710 | 1706 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) |
| 1711 | 1707 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1712 | | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_VBLANK ) |
| 1708 | PORT_BIT( 0x10, IP_ACTIVE_HIGH,IPT_SPECIAL ) PORT_READ_LINE_DEVICE("upd1990a", upd1990a_data_out_r) |
| 1709 | PORT_BIT( 0x20, IP_ACTIVE_HIGH,IPT_VBLANK ) |
| 1713 | 1710 | PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 1714 | 1711 | |
| 1715 | 1712 | PORT_START("CFG") /* EXSWITCH */ |