trunk/src/mess/drivers/pc.c
| r20445 | r20446 | |
| 195 | 195 | AM_RANGE(0x0060, 0x0063) AM_DEVREADWRITE("ppi8255", i8255_device, read, write) |
| 196 | 196 | AM_RANGE(0x0080, 0x0087) AM_READWRITE(pc_page_r, pc_page_w) |
| 197 | 197 | AM_RANGE(0x00a0, 0x00a0) AM_WRITE(pc_nmi_enable_w ) |
| 198 | | AM_RANGE(0x0200, 0x0207) AM_READWRITE_LEGACY(pc_JOY_r, pc_JOY_w) |
| 198 | AM_RANGE(0x0200, 0x0207) AM_DEVREADWRITE("joy", pc_joy_device, joy_port_r, joy_port_w) |
| 199 | 199 | AM_RANGE(0x0240, 0x0257) AM_READWRITE(pc_rtc_r, pc_rtc_w) |
| 200 | 200 | AM_RANGE(0x0278, 0x027b) AM_DEVREADWRITE_LEGACY("lpt_2", pc_lpt_r, pc_lpt_w) |
| 201 | 201 | AM_RANGE(0x02e8, 0x02ef) AM_DEVREADWRITE("ins8250_3", ins8250_device, ins8250_r, ins8250_w) |
| r20445 | r20446 | |
| 221 | 221 | AM_RANGE(0x0070, 0x007f) AM_RAM // needed for Poisk-2 |
| 222 | 222 | AM_RANGE(0x0080, 0x0087) AM_READWRITE8(pc_page_r, pc_page_w, 0xffff) |
| 223 | 223 | AM_RANGE(0x00a0, 0x00a1) AM_WRITE8(pc_nmi_enable_w, 0x00ff ) |
| 224 | | AM_RANGE(0x0200, 0x0207) AM_READWRITE8_LEGACY(pc_JOY_r, pc_JOY_w, 0xffff) |
| 224 | AM_RANGE(0x0200, 0x0207) AM_DEVREADWRITE8("joy", pc_joy_device, joy_port_r, joy_port_w, 0xffff) |
| 225 | 225 | AM_RANGE(0x0240, 0x0257) AM_READWRITE8(pc_rtc_r, pc_rtc_w, 0xffff) |
| 226 | 226 | AM_RANGE(0x0278, 0x027b) AM_DEVREADWRITE8_LEGACY("lpt_2", pc_lpt_r, pc_lpt_w, 0xffff) |
| 227 | 227 | AM_RANGE(0x02e8, 0x02ef) AM_DEVREADWRITE8("ins8250_3", ins8250_device, ins8250_r, ins8250_w, 0xffff) |
| r20445 | r20446 | |
| 296 | 296 | AM_RANGE(0x0060, 0x0063) AM_DEVREADWRITE8("ppi8255", i8255_device, read, write, 0xffff) |
| 297 | 297 | AM_RANGE(0x0080, 0x0087) AM_READWRITE8(pc_page_r, pc_page_w, 0xffff) |
| 298 | 298 | AM_RANGE(0x00a0, 0x00a1) AM_READWRITE8(unk_r, pc_nmi_enable_w, 0x00ff ) |
| 299 | | AM_RANGE(0x0200, 0x0207) AM_READWRITE8_LEGACY(pc_JOY_r, pc_JOY_w, 0xffff) |
| 299 | AM_RANGE(0x0200, 0x0207) AM_DEVREADWRITE8("joy", pc_joy_device, joy_port_r, joy_port_w, 0xffff) |
| 300 | 300 | AM_RANGE(0x0240, 0x0257) AM_READWRITE8(pc_rtc_r, pc_rtc_w, 0xffff) |
| 301 | 301 | AM_RANGE(0x0278, 0x027b) AM_DEVREADWRITE8_LEGACY("lpt_2", pc_lpt_r, pc_lpt_w, 0xffff) |
| 302 | 302 | AM_RANGE(0x02e8, 0x02ef) AM_DEVREADWRITE8("ins8250_3", ins8250_device, ins8250_r, ins8250_w, 0xffff) |
| r20445 | r20446 | |
| 327 | 327 | AM_RANGE(0x0040, 0x0043) AM_DEVREADWRITE_LEGACY("pit8253", pit8253_r, pit8253_w) |
| 328 | 328 | AM_RANGE(0x0060, 0x0063) AM_READWRITE_LEGACY(europc_pio_r, europc_pio_w) |
| 329 | 329 | AM_RANGE(0x0080, 0x0087) AM_READWRITE(pc_page_r, pc_page_w) |
| 330 | | AM_RANGE(0x0200, 0x0207) AM_READWRITE_LEGACY(pc_JOY_r, pc_JOY_w) |
| 330 | AM_RANGE(0x0200, 0x0207) AM_DEVREADWRITE("joy", pc_joy_device, joy_port_r, joy_port_w) |
| 331 | 331 | AM_RANGE(0x0250, 0x025f) AM_READWRITE_LEGACY(europc_jim_r, europc_jim_w) |
| 332 | 332 | AM_RANGE(0x0278, 0x027b) AM_DEVREADWRITE_LEGACY("lpt_2", pc_lpt_r, pc_lpt_w) |
| 333 | 333 | AM_RANGE(0x02e0, 0x02e0) AM_READ_LEGACY(europc_jim2_r) |
| r20445 | r20446 | |
| 362 | 362 | AM_RANGE(0x0060, 0x0063) AM_READWRITE_LEGACY(tandy1000_pio_r, tandy1000_pio_w) |
| 363 | 363 | AM_RANGE(0x0080, 0x0087) AM_READWRITE(pc_page_r, pc_page_w) |
| 364 | 364 | AM_RANGE(0x00c0, 0x00c0) AM_DEVWRITE("sn76496", ncr7496_device, write) |
| 365 | | AM_RANGE(0x0200, 0x0207) AM_READWRITE_LEGACY(pc_JOY_r, pc_JOY_w) |
| 365 | AM_RANGE(0x0200, 0x0207) AM_DEVREADWRITE("joy", pc_joy_device, joy_port_r, joy_port_w) |
| 366 | 366 | AM_RANGE(0x02f8, 0x02ff) AM_DEVREADWRITE("ins8250_1", ins8250_device, ins8250_r, ins8250_w) |
| 367 | 367 | AM_RANGE(0x0378, 0x037f) AM_READWRITE_LEGACY(pc_t1t_p37x_r, pc_t1t_p37x_w) |
| 368 | 368 | AM_RANGE(0x03bc, 0x03be) AM_DEVREADWRITE_LEGACY("lpt_0", pc_lpt_r, pc_lpt_w) |
| r20445 | r20446 | |
| 392 | 392 | AM_RANGE(0x0060, 0x0063) AM_READWRITE8_LEGACY(tandy1000_pio_r, tandy1000_pio_w, 0xffff) |
| 393 | 393 | AM_RANGE(0x0080, 0x0087) AM_READWRITE8(pc_page_r, pc_page_w, 0xffff) |
| 394 | 394 | AM_RANGE(0x00c0, 0x00c1) AM_DEVWRITE8("sn76496", ncr7496_device, write, 0xffff) |
| 395 | | AM_RANGE(0x0200, 0x0207) AM_READWRITE8_LEGACY(pc_JOY_r, pc_JOY_w, 0xffff) |
| 395 | AM_RANGE(0x0200, 0x0207) AM_DEVREADWRITE8("joy", pc_joy_device, joy_port_r, joy_port_w, 0xffff) |
| 396 | 396 | AM_RANGE(0x02f8, 0x02ff) AM_DEVREADWRITE8("ins8250_1", ins8250_device, ins8250_r, ins8250_w, 0xffff) |
| 397 | 397 | AM_RANGE(0x0378, 0x037f) AM_READWRITE8_LEGACY(pc_t1t_p37x_r, pc_t1t_p37x_w, 0xffff) |
| 398 | 398 | AM_RANGE(0x03bc, 0x03bf) AM_DEVREADWRITE8_LEGACY("lpt_0", pc_lpt_r, pc_lpt_w, 0xffff) |
| r20445 | r20446 | |
| 423 | 423 | AM_RANGE(0x0060, 0x0063) AM_READWRITE8_LEGACY(tandy1000_pio_r, tandy1000_pio_w, 0xffff) |
| 424 | 424 | AM_RANGE(0x0080, 0x0087) AM_READWRITE8(pc_page_r, pc_page_w, 0xffff) |
| 425 | 425 | AM_RANGE(0x00c0, 0x00c1) AM_DEVWRITE8("sn76496", ncr7496_device, write, 0xffff) |
| 426 | | AM_RANGE(0x0200, 0x0207) AM_READWRITE8_LEGACY(pc_JOY_r, pc_JOY_w, 0xffff) |
| 426 | AM_RANGE(0x0200, 0x0207) AM_DEVREADWRITE8("joy", pc_joy_device, joy_port_r, joy_port_w, 0xffff) |
| 427 | 427 | AM_RANGE(0x02f8, 0x02ff) AM_DEVREADWRITE8("ins8250_1", ins8250_device, ins8250_r, ins8250_w, 0xffff) |
| 428 | 428 | AM_RANGE(0x0378, 0x037f) AM_READWRITE8_LEGACY(pc_t1t_p37x_r, pc_t1t_p37x_w, 0xffff) |
| 429 | 429 | AM_RANGE(0x03bc, 0x03bf) AM_DEVREADWRITE8_LEGACY("lpt_0", pc_lpt_r, pc_lpt_w, 0xffff) |
| r20445 | r20446 | |
| 455 | 455 | AM_RANGE(0x00c0, 0x00c0) AM_DEVWRITE("sn76496", sn76496_device, write) |
| 456 | 456 | AM_RANGE(0x00f2, 0x00f2) AM_WRITE(pcjr_fdc_dor_w) |
| 457 | 457 | AM_RANGE(0x00f4, 0x00f5) AM_DEVICE("upd765", upd765a_device, map) |
| 458 | | AM_RANGE(0x0200, 0x0207) AM_READWRITE_LEGACY(pc_JOY_r, pc_JOY_w) |
| 458 | AM_RANGE(0x0200, 0x0207) AM_DEVREADWRITE("joy", pc_joy_device, joy_port_r, joy_port_w) |
| 459 | 459 | AM_RANGE(0x02f8, 0x02ff) AM_DEVREADWRITE("ins8250_1", ins8250_device, ins8250_r, ins8250_w) |
| 460 | 460 | AM_RANGE(0x0378, 0x037f) AM_READWRITE_LEGACY(pc_t1t_p37x_r, pc_t1t_p37x_w) |
| 461 | 461 | AM_RANGE(0x03bc, 0x03be) AM_DEVREADWRITE_LEGACY("lpt_0", pc_lpt_r, pc_lpt_w) |
| r20445 | r20446 | |
| 538 | 538 | PORT_BIT( 0x02, 0x02, IPT_UNUSED ) /* no turbo switch */ |
| 539 | 539 | PORT_BIT( 0x01, 0x01, IPT_UNUSED ) |
| 540 | 540 | |
| 541 | | PORT_INCLUDE( pc_joystick ) /* IN15 - IN19 */ |
| 542 | 541 | PORT_INCLUDE( pcvideo_cga ) |
| 543 | 542 | INPUT_PORTS_END |
| 544 | 543 | |
| r20445 | r20446 | |
| 607 | 606 | PORT_BIT( 0x02, 0x02, IPT_UNUSED ) /* no turbo switch */ |
| 608 | 607 | PORT_BIT( 0x01, 0x01, IPT_UNUSED ) |
| 609 | 608 | |
| 610 | | PORT_INCLUDE( pc_joystick ) /* IN15 - IN19 */ |
| 611 | 609 | PORT_INCLUDE( pcvideo_cga ) |
| 612 | 610 | INPUT_PORTS_END |
| 613 | 611 | |
| r20445 | r20446 | |
| 658 | 656 | |
| 659 | 657 | EUROPC_KEYBOARD |
| 660 | 658 | |
| 661 | | PORT_INCLUDE( pc_joystick ) /* IN15 - IN19 */ |
| 662 | 659 | PORT_INCLUDE( pcvideo_cga ) |
| 663 | 660 | INPUT_PORTS_END |
| 664 | 661 | |
| r20445 | r20446 | |
| 730 | 727 | PORT_BIT( 0x01, 0x01, IPT_UNUSED ) |
| 731 | 728 | |
| 732 | 729 | // PORT_INCLUDE( at_keyboard ) /* IN4 - IN11 */ |
| 733 | | PORT_INCLUDE( pc_joystick ) /* IN15 - IN19 */ |
| 734 | 730 | PORT_INCLUDE( pcvideo_cga ) |
| 735 | 731 | INPUT_PORTS_END |
| 736 | 732 | |
| r20445 | r20446 | |
| 770 | 766 | PORT_BIT( 0x01, 0x01, IPT_UNUSED ) |
| 771 | 767 | |
| 772 | 768 | PORT_INCLUDE( t1000_keyboard ) |
| 773 | | PORT_INCLUDE( pc_joystick ) /* IN15 - IN19 */ |
| 774 | 769 | INPUT_PORTS_END |
| 775 | 770 | |
| 776 | 771 | static INPUT_PORTS_START( ibmpcjr ) |
| r20445 | r20446 | |
| 999 | 994 | MCFG_PC_LPT_ADD("lpt_0", pc_lpt_config) |
| 1000 | 995 | MCFG_PC_LPT_ADD("lpt_1", pc_lpt_config) |
| 1001 | 996 | MCFG_PC_LPT_ADD("lpt_2", pc_lpt_config) |
| 997 | MCFG_PC_JOY_ADD("joy") |
| 1002 | 998 | |
| 1003 | 999 | MCFG_PC_FDC_XT_ADD("fdc") |
| 1004 | 1000 | |
| r20445 | r20446 | |
| 1064 | 1060 | MCFG_RS232_PORT_ADD( "serport1", ibm5150_serport_config[1], ibm5150_com, NULL, NULL ) |
| 1065 | 1061 | MCFG_RS232_PORT_ADD( "serport2", ibm5150_serport_config[2], ibm5150_com, NULL, NULL ) |
| 1066 | 1062 | MCFG_RS232_PORT_ADD( "serport3", ibm5150_serport_config[3], ibm5150_com, NULL, NULL ) |
| 1063 | MCFG_PC_JOY_ADD("joy") |
| 1067 | 1064 | |
| 1068 | 1065 | /* video hardware */ |
| 1069 | 1066 | MCFG_FRAGMENT_ADD( pcvideo_aga ) |
| r20445 | r20446 | |
| 1130 | 1127 | MCFG_PC_LPT_ADD("lpt_0", pc_lpt_config) |
| 1131 | 1128 | MCFG_PC_LPT_ADD("lpt_1", pc_lpt_config) |
| 1132 | 1129 | MCFG_PC_LPT_ADD("lpt_2", pc_lpt_config) |
| 1130 | MCFG_PC_JOY_ADD("joy") |
| 1133 | 1131 | |
| 1134 | 1132 | MCFG_PC_FDC_XT_ADD("fdc") |
| 1135 | 1133 | |
| r20445 | r20446 | |
| 1183 | 1181 | MCFG_PC_LPT_ADD("lpt_0", pc_lpt_config) |
| 1184 | 1182 | MCFG_PC_LPT_ADD("lpt_1", pc_lpt_config) |
| 1185 | 1183 | MCFG_PC_LPT_ADD("lpt_2", pc_lpt_config) |
| 1184 | MCFG_PC_JOY_ADD("joy") |
| 1186 | 1185 | |
| 1187 | 1186 | MCFG_PC_FDC_XT_ADD("fdc") |
| 1188 | 1187 | MCFG_FLOPPY_DRIVE_ADD("fdc:0", ibmpc_floppies, "35dd", 0, pc_state::floppy_formats) |
| r20445 | r20446 | |
| 1231 | 1230 | MCFG_PC_LPT_ADD("lpt_0", pc_lpt_config) |
| 1232 | 1231 | MCFG_PC_LPT_ADD("lpt_1", pc_lpt_config) |
| 1233 | 1232 | MCFG_PC_LPT_ADD("lpt_2", pc_lpt_config) |
| 1233 | MCFG_PC_JOY_ADD("joy") |
| 1234 | 1234 | |
| 1235 | 1235 | MCFG_PC_FDC_XT_ADD("fdc") |
| 1236 | 1236 | MCFG_FLOPPY_DRIVE_ADD("fdc:0", ibmpc_floppies, "35dd", 0, pc_state::floppy_formats) |
| r20445 | r20446 | |
| 1299 | 1299 | MCFG_PC_LPT_ADD("lpt_0", pc_lpt_config) |
| 1300 | 1300 | MCFG_PC_LPT_ADD("lpt_1", pc_lpt_config) |
| 1301 | 1301 | MCFG_PC_LPT_ADD("lpt_2", pc_lpt_config) |
| 1302 | MCFG_PC_JOY_ADD("joy") |
| 1302 | 1303 | |
| 1303 | 1304 | /* cassette */ |
| 1304 | 1305 | MCFG_CASSETTE_ADD( CASSETTE_TAG, ibm5150_cassette_interface ) |
| r20445 | r20446 | |
| 1539 | 1540 | MCFG_PC_LPT_ADD("lpt_0", pc_lpt_config) |
| 1540 | 1541 | MCFG_PC_LPT_ADD("lpt_1", pc_lpt_config) |
| 1541 | 1542 | MCFG_PC_LPT_ADD("lpt_2", pc_lpt_config) |
| 1543 | MCFG_PC_JOY_ADD("joy") |
| 1542 | 1544 | |
| 1543 | 1545 | MCFG_PC_FDC_XT_ADD("fdc") |
| 1544 | 1546 | |
| r20445 | r20446 | |
| 1594 | 1596 | MCFG_PC_LPT_ADD("lpt_0", pc_lpt_config) |
| 1595 | 1597 | MCFG_PC_LPT_ADD("lpt_1", pc_lpt_config) |
| 1596 | 1598 | MCFG_PC_LPT_ADD("lpt_2", pc_lpt_config) |
| 1599 | MCFG_PC_JOY_ADD("joy") |
| 1597 | 1600 | |
| 1598 | 1601 | MCFG_PC_FDC_XT_ADD("fdc") |
| 1599 | 1602 | |
| r20445 | r20446 | |
| 1648 | 1651 | MCFG_PC_LPT_ADD("lpt_0", pc_lpt_config) |
| 1649 | 1652 | MCFG_PC_LPT_ADD("lpt_1", pc_lpt_config) |
| 1650 | 1653 | MCFG_PC_LPT_ADD("lpt_2", pc_lpt_config) |
| 1654 | MCFG_PC_JOY_ADD("joy") |
| 1651 | 1655 | |
| 1652 | 1656 | MCFG_PC_FDC_XT_ADD("fdc") |
| 1653 | 1657 | |
| r20445 | r20446 | |
| 1702 | 1706 | MCFG_PC_LPT_ADD("lpt_0", pc_lpt_config) |
| 1703 | 1707 | MCFG_PC_LPT_ADD("lpt_1", pc_lpt_config) |
| 1704 | 1708 | MCFG_PC_LPT_ADD("lpt_2", pc_lpt_config) |
| 1709 | MCFG_PC_JOY_ADD("joy") |
| 1705 | 1710 | |
| 1706 | 1711 | MCFG_PC_FDC_XT_ADD("fdc") |
| 1707 | 1712 | |
| r20445 | r20446 | |
| 1756 | 1761 | MCFG_PC_LPT_ADD("lpt_0", pc_lpt_config) |
| 1757 | 1762 | MCFG_PC_LPT_ADD("lpt_1", pc_lpt_config) |
| 1758 | 1763 | MCFG_PC_LPT_ADD("lpt_2", pc_lpt_config) |
| 1764 | MCFG_PC_JOY_ADD("joy") |
| 1759 | 1765 | |
| 1760 | 1766 | MCFG_PC_FDC_XT_ADD("fdc") |
| 1761 | 1767 | |
trunk/src/mess/drivers/amstr_pc.c
| r20445 | r20446 | |
| 88 | 88 | AM_RANGE(0x0078, 0x0079) AM_READWRITE8_LEGACY(pc1640_mouse_x_r, pc1640_mouse_x_w, 0xffff) |
| 89 | 89 | AM_RANGE(0x007a, 0x007b) AM_READWRITE8_LEGACY(pc1640_mouse_y_r, pc1640_mouse_y_w, 0xffff) |
| 90 | 90 | AM_RANGE(0x0080, 0x0087) AM_READWRITE8(pc_page_r, pc_page_w, 0xffff) |
| 91 | | AM_RANGE(0x0200, 0x0207) AM_READWRITE8_LEGACY(pc_JOY_r, pc_JOY_w, 0xffff) |
| 91 | AM_RANGE(0x0200, 0x0207) AM_DEVREADWRITE8("joy", pc_joy_device, joy_port_r, joy_port_w, 0xffff) |
| 92 | 92 | AM_RANGE(0x0278, 0x027b) AM_READ8_LEGACY(pc200_port278_r, 0xffff) AM_DEVWRITE8_LEGACY("lpt_2", pc_lpt_w, 0x00ff) |
| 93 | 93 | AM_RANGE(0x02e8, 0x02ef) AM_DEVREADWRITE8("ins8250_3", ins8250_device, ins8250_r, ins8250_w, 0xffff) |
| 94 | 94 | AM_RANGE(0x02f8, 0x02ff) AM_DEVREADWRITE8("ins8250_1", ins8250_device, ins8250_r, ins8250_w, 0xffff) |
| r20445 | r20446 | |
| 116 | 116 | AM_RANGE(0x0078, 0x0079) AM_READWRITE8_LEGACY(pc1640_mouse_x_r, pc1640_mouse_x_w, 0xffff) |
| 117 | 117 | AM_RANGE(0x007a, 0x007b) AM_READWRITE8_LEGACY(pc1640_mouse_y_r, pc1640_mouse_y_w, 0xffff) |
| 118 | 118 | AM_RANGE(0x0080, 0x0087) AM_READWRITE8(pc_page_r, pc_page_w, 0xffff) |
| 119 | | AM_RANGE(0x0200, 0x0207) AM_READWRITE8_LEGACY(pc_JOY_r, pc_JOY_w, 0xffff) |
| 119 | AM_RANGE(0x0200, 0x0207) AM_DEVREADWRITE8("joy", pc_joy_device, joy_port_r, joy_port_w, 0xffff) |
| 120 | 120 | AM_RANGE(0x0278, 0x027b) AM_READ8_LEGACY(pc200_port278_r, 0xffff) AM_DEVWRITE8_LEGACY("lpt_2", pc_lpt_w, 0x00ff) |
| 121 | 121 | AM_RANGE(0x02e8, 0x02ef) AM_DEVREADWRITE8("ins8250_3", ins8250_device, ins8250_r, ins8250_w, 0xffff) |
| 122 | 122 | AM_RANGE(0x02f8, 0x02ff) AM_DEVREADWRITE8("ins8250_1", ins8250_device, ins8250_r, ins8250_w, 0xffff) |
| r20445 | r20446 | |
| 196 | 196 | PORT_BIT( 0x01, 0x01, IPT_UNUSED ) |
| 197 | 197 | |
| 198 | 198 | PORT_INCLUDE( at_keyboard ) /* IN4 - IN11 */ |
| 199 | | PORT_INCLUDE( pc_joystick ) /* IN15 - IN19 */ |
| 200 | 199 | |
| 201 | 200 | PORT_START("VIDEO") /* IN20 */ |
| 202 | 201 | PORT_CONFNAME( 0x03, 0x03, "IDA character set") |
| r20445 | r20446 | |
| 299 | 298 | |
| 300 | 299 | MCFG_PC_FDC_XT_ADD("fdc") |
| 301 | 300 | |
| 301 | MCFG_PC_JOY_ADD("joy") |
| 302 | |
| 302 | 303 | MCFG_FLOPPY_DRIVE_ADD("fdc:0", ibmpc_floppies, "525dd", 0, ibmpc_floppy_formats) |
| 303 | 304 | MCFG_FLOPPY_DRIVE_ADD("fdc:1", ibmpc_floppies, "525dd", 0, ibmpc_floppy_formats) |
| 304 | 305 | |
| r20445 | r20446 | |
| 370 | 371 | |
| 371 | 372 | MCFG_PC_FDC_XT_ADD("fdc") |
| 372 | 373 | |
| 374 | MCFG_PC_JOY_ADD("joy") |
| 375 | |
| 373 | 376 | MCFG_FLOPPY_DRIVE_ADD("fdc:0", ibmpc_floppies, "525dd", 0, ibmpc_floppy_formats) |
| 374 | 377 | MCFG_FLOPPY_DRIVE_ADD("fdc:1", ibmpc_floppies, "525dd", 0, ibmpc_floppy_formats) |
| 375 | 378 | |
trunk/src/mess/machine/pc_joy.c
| r20445 | r20446 | |
| 9 | 9 | #include "emu.h" |
| 10 | 10 | #include "pc_joy.h" |
| 11 | 11 | |
| 12 | | |
| 13 | | static attotime JOY_time; |
| 14 | | |
| 15 | | |
| 16 | | READ8_HANDLER ( pc_JOY_r ) |
| 12 | READ8_MEMBER ( pc_joy_device::joy_port_r ) |
| 17 | 13 | { |
| 18 | 14 | UINT8 data = 0xf; |
| 19 | 15 | int delta; |
| 20 | | attotime new_time = space.machine().time(); |
| 21 | | ioport_port *joystick_port = space.machine().root_device().ioport("pc_joy"); |
| 22 | | delta = ((new_time - JOY_time) * 256 * 1000).seconds; |
| 16 | attotime new_time = machine().time(); |
| 17 | delta = ((new_time - m_stime) * 256 * 1000).seconds; |
| 23 | 18 | |
| 24 | | if (joystick_port != NULL) |
| 25 | | { |
| 26 | | data = joystick_port->read() ^ 0xf0; |
| 19 | data = m_btn->read() ^ 0xf0; |
| 27 | 20 | |
| 28 | | /* timer overflow? Nope, otherwise some HWs can't verify the port properly */ |
| 29 | | //if ((new_time - JOY_time) > attotime::from_msec(10)) |
| 30 | | //{ |
| 31 | | //} |
| 32 | | //else |
| 33 | | { |
| 34 | | if (space.machine().root_device().ioport("pc_joy_1")->read() < delta) data &= ~0x01; |
| 35 | | if (space.machine().root_device().ioport("pc_joy_2")->read() < delta) data &= ~0x02; |
| 36 | | if (space.machine().root_device().ioport("pc_joy_3")->read() < delta) data &= ~0x04; |
| 37 | | if (space.machine().root_device().ioport("pc_joy_4")->read() < delta) data &= ~0x08; |
| 38 | | } |
| 39 | | } |
| 40 | | else |
| 41 | | { |
| 42 | | data = 0xf0; |
| 43 | | // TODO: find decay rate with no joystick connected |
| 44 | | } |
| 21 | /* timer overflow? Nope, otherwise some HWs can't verify the port properly */ |
| 22 | //if ((new_time - JOY_time) > attotime::from_msec(10)) |
| 23 | //{ |
| 24 | //} |
| 25 | //else |
| 26 | |
| 27 | if (m_x1->read() < delta) data &= ~0x01; |
| 28 | if (m_y1->read() < delta) data &= ~0x02; |
| 29 | if (m_x2->read() < delta) data &= ~0x04; |
| 30 | if (m_y2->read() < delta) data &= ~0x08; |
| 45 | 31 | return data; |
| 46 | 32 | } |
| 47 | 33 | |
| 48 | 34 | |
| 49 | 35 | |
| 50 | | WRITE8_HANDLER ( pc_JOY_w ) |
| 36 | WRITE8_MEMBER ( pc_joy_device::joy_port_w ) |
| 51 | 37 | { |
| 52 | | JOY_time = space.machine().time(); |
| 38 | m_stime = machine().time(); |
| 53 | 39 | } |
| 54 | 40 | |
| 55 | | INPUT_PORTS_START( pc_joystick_none ) |
| 56 | | PORT_START("pc_joy") |
| 57 | | PORT_BIT ( 0xffff, 0x0000, IPT_UNUSED ) |
| 58 | | PORT_START("pc_joy_1") |
| 59 | | PORT_BIT ( 0xffff, 0x0000, IPT_UNUSED ) |
| 60 | | PORT_START("pc_joy_2") |
| 61 | | PORT_BIT ( 0xffff, 0x0000, IPT_UNUSED ) |
| 62 | | PORT_START("pc_joy_3") |
| 63 | | PORT_BIT ( 0xffff, 0x0000, IPT_UNUSED ) |
| 64 | | PORT_START("pc_joy_4") |
| 65 | | PORT_BIT ( 0xffff, 0x0000, IPT_UNUSED ) |
| 66 | | INPUT_PORTS_END |
| 67 | | |
| 68 | | |
| 69 | | |
| 70 | | INPUT_PORTS_START( pc_joystick ) |
| 71 | | PORT_START("pc_joy") |
| 41 | static INPUT_PORTS_START( pc_joystick ) |
| 42 | PORT_START("btn") |
| 72 | 43 | PORT_BIT ( 0xf, 0xf, IPT_UNUSED ) |
| 73 | 44 | PORT_BIT( 0x0010, 0x0000, IPT_BUTTON1) PORT_NAME("Joystick 1 Button 1") |
| 74 | 45 | PORT_BIT( 0x0020, 0x0000, IPT_BUTTON2) PORT_NAME("Joystick 1 Button 2") |
| 75 | 46 | PORT_BIT( 0x0040, 0x0000, IPT_BUTTON1) PORT_NAME("Joystick 2 Button 1") PORT_CODE(JOYCODE_BUTTON1) PORT_PLAYER(2) |
| 76 | 47 | PORT_BIT( 0x0080, 0x0000, IPT_BUTTON2) PORT_NAME("Joystick 2 Button 2") PORT_CODE(JOYCODE_BUTTON2) PORT_PLAYER(2) |
| 77 | 48 | |
| 78 | | PORT_START("pc_joy_1") |
| 49 | PORT_START("x1") |
| 79 | 50 | PORT_BIT(0xff,0x80,IPT_AD_STICK_X) PORT_SENSITIVITY(100) PORT_KEYDELTA(1) PORT_MINMAX(1,0xff) PORT_CODE_DEC(KEYCODE_LEFT) PORT_CODE_INC(KEYCODE_RIGHT) PORT_CODE_DEC(JOYCODE_X_LEFT_SWITCH) PORT_CODE_INC(JOYCODE_X_RIGHT_SWITCH) |
| 80 | 51 | |
| 81 | | PORT_START("pc_joy_2") |
| 52 | PORT_START("y1") |
| 82 | 53 | PORT_BIT(0xff,0x80,IPT_AD_STICK_Y) PORT_SENSITIVITY(100) PORT_KEYDELTA(1) PORT_MINMAX(1,0xff) PORT_CODE_DEC(KEYCODE_UP) PORT_CODE_INC(KEYCODE_DOWN) PORT_CODE_DEC(JOYCODE_Y_UP_SWITCH) PORT_CODE_INC(JOYCODE_Y_DOWN_SWITCH) |
| 83 | 54 | |
| 84 | | PORT_START("pc_joy_3") |
| 55 | PORT_START("x2") |
| 85 | 56 | PORT_BIT(0xff,0x80,IPT_AD_STICK_X) PORT_SENSITIVITY(100) PORT_KEYDELTA(1) PORT_MINMAX(1,0xff) PORT_CODE_DEC(JOYCODE_X_LEFT_SWITCH) PORT_CODE_INC(JOYCODE_X_RIGHT_SWITCH) PORT_PLAYER(2) |
| 86 | 57 | |
| 87 | | PORT_START("pc_joy_4") |
| 58 | PORT_START("y2") |
| 88 | 59 | PORT_BIT(0xff,0x80,IPT_AD_STICK_Y) PORT_SENSITIVITY(100) PORT_KEYDELTA(1) PORT_MINMAX(1,0xff) PORT_CODE_DEC(JOYCODE_Y_UP_SWITCH) PORT_CODE_INC(JOYCODE_Y_DOWN_SWITCH) PORT_PLAYER(2) |
| 89 | 60 | INPUT_PORTS_END |
| 90 | 61 | |
| 91 | 62 | const device_type PC_JOY = &device_creator<pc_joy_device>; |
| 92 | 63 | |
| 93 | 64 | pc_joy_device::pc_joy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 94 | | : device_t(mconfig, PC_JOY, "PC joystick", tag, owner, clock) |
| 65 | : device_t(mconfig, PC_JOY, "PC joystick", tag, owner, clock), |
| 66 | m_btn(*this, "btn"), |
| 67 | m_x1(*this, "x1"), |
| 68 | m_y1(*this, "y1"), |
| 69 | m_x2(*this, "x2"), |
| 70 | m_y2(*this, "y2") |
| 95 | 71 | { |
| 96 | 72 | } |
| 97 | 73 | |