src/mess/drivers/scv.c
| r6894 | r6895 | |
| 10 | 10 | #include "devices/cartslot.h" |
| 11 | 11 | |
| 12 | 12 | |
| 13 | | static READ8_HANDLER( scv_porta_r ); |
| 14 | 13 | static WRITE8_HANDLER( scv_porta_w ); |
| 15 | 14 | static READ8_HANDLER( scv_portb_r ); |
| 16 | 15 | static READ8_HANDLER( scv_portc_r ); |
| r6894 | r6895 | |
| 34 | 33 | |
| 35 | 34 | |
| 36 | 35 | static ADDRESS_MAP_START( scv_io, ADDRESS_SPACE_IO, 8 ) |
| 37 | | AM_RANGE( 0x00, 0x00 ) AM_READWRITE( scv_porta_r, scv_porta_w ) |
| 36 | AM_RANGE( 0x00, 0x00 ) AM_WRITE( scv_porta_w ) |
| 38 | 37 | AM_RANGE( 0x01, 0x01 ) AM_READ( scv_portb_r ) |
| 39 | 38 | AM_RANGE( 0x02, 0x02 ) AM_READWRITE( scv_portc_r, scv_portc_w ) |
| 40 | 39 | ADDRESS_MAP_END |
| r6894 | r6895 | |
| 48 | 47 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) PORT_8WAY |
| 49 | 48 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2) PORT_8WAY |
| 50 | 49 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) |
| 50 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 51 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 51 | 52 | |
| 52 | 53 | PORT_START( "PA1" ) |
| 53 | 54 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) PORT_8WAY |
| r6894 | r6895 | |
| 56 | 57 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) PORT_8WAY |
| 57 | 58 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) PORT_8WAY |
| 58 | 59 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) |
| 60 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 61 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 59 | 62 | |
| 60 | 63 | PORT_START( "PA2" ) |
| 64 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 65 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 66 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 67 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 68 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 69 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 61 | 70 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("0") PORT_CODE(KEYCODE_0) |
| 62 | 71 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("1") PORT_CODE(KEYCODE_1) |
| 63 | 72 | |
| 64 | 73 | PORT_START( "PA3" ) |
| 74 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 75 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 76 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 77 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 78 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 79 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 65 | 80 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("2") PORT_CODE(KEYCODE_2) |
| 66 | 81 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("3") PORT_CODE(KEYCODE_3) |
| 67 | 82 | |
| 68 | 83 | PORT_START( "PA4" ) |
| 84 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 85 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 86 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 87 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 88 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 89 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 69 | 90 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("4") PORT_CODE(KEYCODE_4) |
| 70 | 91 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("5") PORT_CODE(KEYCODE_5) |
| 71 | 92 | |
| 72 | 93 | PORT_START( "PA5" ) |
| 94 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 95 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 96 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 97 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 98 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 99 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 73 | 100 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("6") PORT_CODE(KEYCODE_6) |
| 74 | 101 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("7") PORT_CODE(KEYCODE_7) |
| 75 | 102 | |
| 76 | 103 | PORT_START( "PA6" ) |
| 104 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 105 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 106 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 107 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 108 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 109 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 77 | 110 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("8") PORT_CODE(KEYCODE_8) |
| 78 | 111 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("9") PORT_CODE(KEYCODE_9) |
| 79 | 112 | |
| 80 | 113 | PORT_START( "PA7" ) |
| 114 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 115 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 116 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 117 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 118 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 81 | 119 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Cl") PORT_CODE(KEYCODE_BACKSPACE) |
| 82 | 120 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("En") PORT_CODE(KEYCODE_ENTER) |
| 83 | 121 | |
| r6894 | r6895 | |
| 86 | 124 | INPUT_PORTS_END |
| 87 | 125 | |
| 88 | 126 | |
| 89 | | static READ8_HANDLER( scv_porta_r ) |
| 90 | | { |
| 91 | | return 0xff; |
| 92 | | } |
| 93 | | |
| 94 | | |
| 95 | 127 | static WRITE8_HANDLER( scv_porta_w ) |
| 96 | 128 | { |
| 97 | 129 | scv_porta = data; |
| 98 | 130 | } |
| 99 | 131 | |
| 132 | |
| 100 | 133 | static READ8_HANDLER( scv_portb_r ) |
| 101 | 134 | { |
| 102 | | return 0xff; |
| 135 | UINT8 data = 0xff; |
| 136 | |
| 137 | if ( scv_porta & 0x01 ) |
| 138 | data &= input_port_read( space->machine, "PA0" ); |
| 139 | |
| 140 | if ( scv_porta & 0x02 ) |
| 141 | data &= input_port_read( space->machine, "PA1" ); |
| 142 | |
| 143 | if ( scv_porta & 0x04 ) |
| 144 | data &= input_port_read( space->machine, "PA2" ); |
| 145 | |
| 146 | if ( scv_porta & 0x08 ) |
| 147 | data &= input_port_read( space->machine, "PA3" ); |
| 148 | |
| 149 | if ( scv_porta & 0x10 ) |
| 150 | data &= input_port_read( space->machine, "PA4" ); |
| 151 | |
| 152 | if ( scv_porta & 0x20 ) |
| 153 | data &= input_port_read( space->machine, "PA5" ); |
| 154 | |
| 155 | if ( scv_porta & 0x40 ) |
| 156 | data &= input_port_read( space->machine, "PA6" ); |
| 157 | |
| 158 | if ( scv_porta & 0x80 ) |
| 159 | data &= input_port_read( space->machine, "PA7" ); |
| 160 | |
| 161 | return data; |
| 103 | 162 | } |
| 104 | 163 | |
| 105 | 164 | |
| 106 | 165 | static READ8_HANDLER( scv_portc_r ) |
| 107 | 166 | { |
| 108 | | return 0xff; |
| 167 | UINT8 data = 0xff; |
| 168 | |
| 169 | data = ( data & 0xfe ) | ( input_port_read( space->machine, "PC0" ) & 0x01 ); |
| 170 | |
| 171 | return data; |
| 109 | 172 | } |
| 110 | 173 | |
| 111 | 174 | |