src/mess/drivers/fm7.c
| r5037 | r5038 | |
| 585 | 585 | UINT8 ret = 0x00; |
| 586 | 586 | double data = cassette_input(devtag_get_device(space->machine,"cass")); |
| 587 | 587 | const device_config* printer_dev = devtag_get_device(space->machine,"printer"); |
| 588 | UINT8 pdata; |
| 589 | int x; |
| 588 | 590 | |
| 589 | 591 | if(data > 0.03) |
| 590 | 592 | ret |= 0x80; |
| 591 | 593 | |
| 592 | | ret |= 0x40; |
| 594 | if(cassette_get_state(devtag_get_device(space->machine,"cass")) & CASSETTE_MOTOR_DISABLED) |
| 595 | ret |= 0x80; // cassette input is high when not in use. |
| 593 | 596 | |
| 594 | | if(centronics_pe_r(printer_dev)) |
| 595 | | ret |= 0x08; |
| 596 | | if(centronics_ack_r(printer_dev)) |
| 597 | | ret |= 0x04; |
| 598 | | if(centronics_fault_r(printer_dev)) |
| 599 | | ret |= 0x02; |
| 600 | | if(centronics_busy_r(printer_dev)) |
| 601 | | ret |= 0x01; |
| 597 | ret |= 0x70; |
| 602 | 598 | |
| 599 | if(input_port_read(space->machine,"config") & 0x01) |
| 600 | { |
| 601 | ret |= 0x0f; |
| 602 | pdata = centronics_data_r(printer_dev,0); |
| 603 | for(x=0;x<6;x++) |
| 604 | { |
| 605 | if(~pdata & (1<<x)) |
| 606 | if(input_port_read(space->machine,"lptjoy") & (1 << x)) |
| 607 | ret &= ~0x08; |
| 608 | } |
| 609 | } |
| 610 | else |
| 611 | { |
| 612 | if(centronics_pe_r(printer_dev)) |
| 613 | ret |= 0x08; |
| 614 | if(centronics_ack_r(printer_dev)) |
| 615 | ret |= 0x04; |
| 616 | if(centronics_fault_r(printer_dev)) |
| 617 | ret |= 0x02; |
| 618 | if(centronics_busy_r(printer_dev)) |
| 619 | ret |= 0x01; |
| 620 | } |
| 603 | 621 | return ret; |
| 604 | 622 | } |
| 605 | 623 | |
| r5037 | r5038 | |
| 1007 | 1025 | PORT_BIT(0x00000010,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("GRAPH") PORT_CODE(KEYCODE_RALT) |
| 1008 | 1026 | PORT_BIT(0x00000020,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Kana") PORT_CODE(KEYCODE_RCONTROL) PORT_TOGGLE |
| 1009 | 1027 | |
| 1028 | PORT_START("lptjoy") |
| 1029 | PORT_BIT(0x01,IP_ACTIVE_HIGH,IPT_JOYSTICK_RIGHT) PORT_NAME("LPT Joystick Right") PORT_8WAY PORT_PLAYER(1) |
| 1030 | PORT_BIT(0x02,IP_ACTIVE_HIGH,IPT_JOYSTICK_LEFT) PORT_NAME("LPT Joystick Left") PORT_8WAY PORT_PLAYER(1) |
| 1031 | PORT_BIT(0x04,IP_ACTIVE_HIGH,IPT_JOYSTICK_UP) PORT_NAME("LPT Joystick Up") PORT_8WAY PORT_PLAYER(1) |
| 1032 | PORT_BIT(0x08,IP_ACTIVE_HIGH,IPT_JOYSTICK_DOWN) PORT_NAME("LPT Joystick Down") PORT_8WAY PORT_PLAYER(1) |
| 1033 | PORT_BIT(0x10,IP_ACTIVE_HIGH,IPT_BUTTON2) PORT_NAME("LPT Joystick Button 2") PORT_PLAYER(1) |
| 1034 | PORT_BIT(0x20,IP_ACTIVE_HIGH,IPT_BUTTON1) PORT_NAME("LPT Joystick Button 1") PORT_PLAYER(1) |
| 1035 | |
| 1010 | 1036 | PORT_START("DSW") |
| 1011 | 1037 | PORT_DIPNAME(0x01,0x00,"Switch A") PORT_DIPLOCATION("SWA:1") |
| 1012 | 1038 | PORT_DIPSETTING(0x00,DEF_STR( Off )) |
| r5037 | r5038 | |
| 1020 | 1046 | PORT_DIPNAME(0x08,0x00,"Switch D") PORT_DIPLOCATION("SWA:4") |
| 1021 | 1047 | PORT_DIPSETTING(0x00,DEF_STR( Off )) |
| 1022 | 1048 | PORT_DIPSETTING(0x08,DEF_STR( On )) |
| 1049 | |
| 1050 | PORT_START("config") |
| 1051 | PORT_CONFNAME(0x01,0x00,"Printer port device") |
| 1052 | PORT_CONFSETTING(0x00,"Printer") |
| 1053 | PORT_CONFSETTING(0x01,"Dempa Shinbunsha Joystick") |
| 1023 | 1054 | INPUT_PORTS_END |
| 1024 | 1055 | |
| 1025 | 1056 | static DRIVER_INIT(fm7) |