src/mess/drivers/glasgow.c
| r2239 | r2240 | |
| 318 | 318 | { |
| 319 | 319 | UINT16 data; |
| 320 | 320 | data=0x0300; |
| 321 | | key_low=readinputport(0x00); |
| 322 | | key_hi=readinputport(0x01); |
| 321 | key_low = readinputportbytag("LINE0"); |
| 322 | key_hi = readinputportbytag("LINE1"); |
| 323 | 323 | //logerror("Keyboard Offset = %x Data = %x\n ",offset,data); |
| 324 | 324 | if (key_select==key_low){data=data&0x100;} |
| 325 | 325 | if (key_select==key_hi){data=data&0x200;} |
| r2239 | r2240 | |
| 330 | 330 | { |
| 331 | 331 | UINT16 data; |
| 332 | 332 | |
| 333 | | if (key_selector==0) data=readinputport(0x00);else data=readinputport(0x01); |
| 333 | if (key_selector==0) data=readinputportbytag("LINE0");else data=readinputportbytag("LINE1"); |
| 334 | 334 | logerror("read Keyboard Offset = %x Data = %x Select = %x \n ",offset,data,key_selector); |
| 335 | 335 | data=data<<8; |
| 336 | 336 | return data ; |
| r2239 | r2240 | |
| 493 | 493 | static READ32_HANDLER(read_newkeys32) // Dallas 32, Roma 32 |
| 494 | 494 | { |
| 495 | 495 | UINT32 data; |
| 496 | | if (key_selector==0) data=readinputport(0x00);else data=readinputport(0x01); |
| 497 | | //if (key_selector==1) data=readinputport(0x00);else data=0; |
| 496 | if (key_selector==0) data=readinputportbytag("LINE0");else data=readinputportbytag("LINE1"); |
| 497 | //if (key_selector==1) data=readinputportbytag("LINE0");else data=0; |
| 498 | 498 | logerror("read Keyboard Offset = %x Data = %x\n ",offset,data); |
| 499 | 499 | data=data<<24; |
| 500 | 500 | return data ; |
| r2239 | r2240 | |
| 605 | 605 | if (my_cursor != NULL) |
| 606 | 606 | set_cursor (my_cursor); |
| 607 | 607 | |
| 608 | | m_button1=readinputport(0x04); |
| 609 | | m_button2=readinputport(0x05); |
| 608 | m_button1=readinputportbytag("BUTTON_L"); |
| 609 | m_button2=readinputportbytag("BUTTON_R"); |
| 610 | 610 | |
| 611 | 611 | if ( m_button1) MOUSE_BUTTON1_WAIT = 0; |
| 612 | 612 | |
| r2239 | r2240 | |
| 780 | 780 | ADDRESS_MAP_END |
| 781 | 781 | |
| 782 | 782 | static INPUT_PORTS_START( new_keyboard ) //Amsterdam, Dallas 32, Roma, Roma 32 |
| 783 | | PORT_START |
| 783 | PORT_START_TAG("LINE0") |
| 784 | 784 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("A1") PORT_CODE(KEYCODE_A ) |
| 785 | 785 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("B2") PORT_CODE(KEYCODE_B ) |
| 786 | 786 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("C3") PORT_CODE(KEYCODE_C ) |
| r2239 | r2240 | |
| 795 | 795 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F6") PORT_CODE(KEYCODE_6 ) |
| 796 | 796 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("0") PORT_CODE(KEYCODE_9 ) |
| 797 | 797 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("9") PORT_CODE(KEYCODE_0 ) |
| 798 | | PORT_START |
| 798 | PORT_START_TAG("LINE1") |
| 799 | 799 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("INF") PORT_CODE(KEYCODE_F1 ) |
| 800 | 800 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("POS") PORT_CODE(KEYCODE_F2 ) |
| 801 | 801 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("LEV") PORT_CODE(KEYCODE_F3 ) |
| r2239 | r2240 | |
| 807 | 807 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("G7") PORT_CODE(KEYCODE_7 ) |
| 808 | 808 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("H8") PORT_CODE(KEYCODE_8 ) |
| 809 | 809 | |
| 810 | | PORT_START |
| 811 | | PORT_BIT( 0xffff, 0x00, IPT_MOUSE_X) PORT_SENSITIVITY(100) PORT_KEYDELTA(1) PORT_MINMAX(0, 65535) PORT_PLAYER(1) |
| 810 | PORT_START_TAG("MOUSE_X") |
| 811 | PORT_BIT( 0xffff, 0x00, IPT_MOUSE_X) PORT_SENSITIVITY(100) PORT_KEYDELTA(1) PORT_MINMAX(0, 65535) PORT_PLAYER(1) |
| 812 | 812 | |
| 813 | | PORT_START |
| 814 | | PORT_BIT( 0xffff, 0x00, IPT_MOUSE_Y ) PORT_SENSITIVITY(100) PORT_KEYDELTA(1) PORT_MINMAX(0, 65535) PORT_PLAYER(1) |
| 813 | PORT_START_TAG("MOUSE_Y") |
| 814 | PORT_BIT( 0xffff, 0x00, IPT_MOUSE_Y ) PORT_SENSITIVITY(100) PORT_KEYDELTA(1) PORT_MINMAX(0, 65535) PORT_PLAYER(1) |
| 815 | 815 | |
| 816 | | PORT_START |
| 817 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2) PORT_CODE(MOUSECODE_BUTTON1) PORT_NAME("left button") |
| 816 | PORT_START_TAG("BUTTON_L") |
| 817 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2) PORT_CODE(MOUSECODE_BUTTON1) PORT_NAME("left button") |
| 818 | 818 | |
| 819 | | PORT_START |
| 820 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1) PORT_CODE(MOUSECODE_BUTTON2) PORT_NAME("right button") |
| 819 | PORT_START_TAG("BUTTON_R") |
| 820 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1) PORT_CODE(MOUSECODE_BUTTON2) PORT_NAME("right button") |
| 821 | 821 | INPUT_PORTS_END |
| 822 | 822 | |
| 823 | 823 | |
| 824 | 824 | |
| 825 | 825 | static INPUT_PORTS_START( old_keyboard ) //Glasgow,Dallas |
| 826 | | PORT_START |
| 826 | PORT_START_TAG("LINE0") |
| 827 | 827 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("9") PORT_CODE(KEYCODE_9 ) |
| 828 | 828 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("CL") PORT_CODE(KEYCODE_F5 ) |
| 829 | 829 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("C3") PORT_CODE(KEYCODE_C ) |
| r2239 | r2240 | |
| 837 | 837 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F6") PORT_CODE(KEYCODE_6 ) |
| 838 | 838 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("B2") PORT_CODE(KEYCODE_B ) |
| 839 | 839 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("B2") PORT_CODE(KEYCODE_2 ) |
| 840 | | PORT_START |
| 840 | PORT_START_TAG("LINE1") |
| 841 | 841 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("E5") PORT_CODE(KEYCODE_E ) |
| 842 | 842 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("E5") PORT_CODE(KEYCODE_5 ) |
| 843 | 843 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("INF") PORT_CODE(KEYCODE_F1 ) |
| r2239 | r2240 | |
| 850 | 850 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G7") PORT_CODE(KEYCODE_7 ) |
| 851 | 851 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("MEM") PORT_CODE(KEYCODE_F4) |
| 852 | 852 | |
| 853 | | PORT_START |
| 854 | | PORT_BIT( 0xffff, 0x00, IPT_MOUSE_X) PORT_SENSITIVITY(100) PORT_KEYDELTA(1) PORT_MINMAX(0, 65535) PORT_PLAYER(1) |
| 853 | PORT_START_TAG("MOUSE_X") |
| 854 | PORT_BIT( 0xffff, 0x00, IPT_MOUSE_X) PORT_SENSITIVITY(100) PORT_KEYDELTA(1) PORT_MINMAX(0, 65535) PORT_PLAYER(1) |
| 855 | 855 | |
| 856 | | PORT_START |
| 857 | | PORT_BIT( 0xffff, 0x00, IPT_MOUSE_Y ) PORT_SENSITIVITY(100) PORT_KEYDELTA(1) PORT_MINMAX(0, 65535) PORT_PLAYER(1) |
| 856 | PORT_START_TAG("MOUSE_Y") |
| 857 | PORT_BIT( 0xffff, 0x00, IPT_MOUSE_Y ) PORT_SENSITIVITY(100) PORT_KEYDELTA(1) PORT_MINMAX(0, 65535) PORT_PLAYER(1) |
| 858 | 858 | |
| 859 | | PORT_START |
| 860 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2) PORT_CODE(MOUSECODE_BUTTON1) PORT_NAME("left button") |
| 859 | PORT_START_TAG("BUTTON_L") |
| 860 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2) PORT_CODE(MOUSECODE_BUTTON1) PORT_NAME("left button") |
| 861 | 861 | |
| 862 | | PORT_START |
| 863 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1) PORT_CODE(MOUSECODE_BUTTON2) PORT_NAME("right button") |
| 864 | | |
| 865 | | |
| 862 | PORT_START_TAG("BUTTON_R") |
| 863 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1) PORT_CODE(MOUSECODE_BUTTON2) PORT_NAME("right button") |
| 866 | 864 | INPUT_PORTS_END |
| 867 | 865 | |
| 868 | 866 | |
| r2239 | r2240 | |
| 991 | 989 | static float diff_x, diff_y, del_x, del_y; |
| 992 | 990 | |
| 993 | 991 | save_x = m_x; |
| 994 | | save_y = m_y; |
| 992 | save_y = m_y; |
| 995 | 993 | |
| 996 | | m_x=readinputport(0x02); |
| 997 | | m_y=readinputport(0x03); |
| 994 | m_x=readinputportbytag("MOUSE_X"); |
| 995 | m_y=readinputportbytag("MOUSE_Y"); |
| 998 | 996 | |
| 999 | 997 | // logerror("m_x = %d \n ",m_x); |
| 1000 | 998 | // logerror("m_y = %d \n ",m_y); |
src/mess/drivers/a2600.c
| r2239 | r2240 | |
| 1070 | 1070 | static WRITE8_HANDLER( switch_A_w ) |
| 1071 | 1071 | { |
| 1072 | 1072 | /* Left controller port */ |
| 1073 | | if ( readinputport(9) / CATEGORY_SELECT == 0x03 ) { |
| 1073 | if ( readinputportbytag("CONTROLLERS") / CATEGORY_SELECT == 0x03 ) { |
| 1074 | 1074 | keypad_left_column = data / 16; |
| 1075 | 1075 | } |
| 1076 | 1076 | |
| 1077 | 1077 | /* Right controller port */ |
| 1078 | | switch( readinputport(9) % CATEGORY_SELECT ) { |
| 1078 | switch( readinputportbytag("CONTROLLERS") % CATEGORY_SELECT ) { |
| 1079 | 1079 | case 0x03: /* Keypad */ |
| 1080 | 1080 | keypad_right_column = data & 0x0F; |
| 1081 | 1081 | break; |
| r2239 | r2240 | |
| 1091 | 1091 | UINT8 val = 0; |
| 1092 | 1092 | |
| 1093 | 1093 | /* Left controller port PINs 1-4 ( 4321 ) */ |
| 1094 | | switch( readinputport(9) / CATEGORY_SELECT ) { |
| 1094 | switch( readinputportbytag("CONTROLLERS") / CATEGORY_SELECT ) { |
| 1095 | 1095 | case 0x00: /* Joystick */ |
| 1096 | 1096 | case 0x05: /* Joystick w/Boostergrip */ |
| 1097 | | val |= readinputport(6) & 0xF0; |
| 1097 | val |= readinputportbytag("SWA_JOY") & 0xF0; |
| 1098 | 1098 | break; |
| 1099 | 1099 | case 0x01: /* Paddle */ |
| 1100 | | val |= readinputport(7) & 0xF0; |
| 1100 | val |= readinputportbytag("SWA_PAD") & 0xF0; |
| 1101 | 1101 | break; |
| 1102 | 1102 | case 0x02: /* Driving */ |
| 1103 | 1103 | val |= 0xC0; |
| 1104 | | val |= ( driving_lookup[ ( readinputport(12) & 0x18 ) >> 3 ] << 4 ); |
| 1104 | val |= ( driving_lookup[ ( readinputportbytag("WHEEL_L") & 0x18 ) >> 3 ] << 4 ); |
| 1105 | 1105 | break; |
| 1106 | 1106 | case 0x06: /* Trakball CX-22 */ |
| 1107 | 1107 | case 0x07: /* Trakball CX-80 / ST mouse */ |
| r2239 | r2240 | |
| 1112 | 1112 | } |
| 1113 | 1113 | |
| 1114 | 1114 | /* Right controller port PINs 1-4 ( 4321 ) */ |
| 1115 | | switch( readinputport(9) % CATEGORY_SELECT ) { |
| 1115 | switch( readinputportbytag("CONTROLLERS") % CATEGORY_SELECT ) { |
| 1116 | 1116 | case 0x00: /* Joystick */ |
| 1117 | 1117 | case 0x05: /* Joystick w/Boostergrip */ |
| 1118 | | val |= readinputport(6) & 0x0F; |
| 1118 | val |= readinputportbytag("SWA_JOY") & 0x0F; |
| 1119 | 1119 | break; |
| 1120 | 1120 | case 0x01: /* Paddle */ |
| 1121 | | val |= readinputport(7) & 0x0F; |
| 1121 | val |= readinputportbytag("SWA_PAD") & 0x0F; |
| 1122 | 1122 | break; |
| 1123 | 1123 | case 0x02: /* Driving */ |
| 1124 | 1124 | val |= 0x0C; |
| 1125 | | val |= ( driving_lookup[ ( readinputport(13) & 0x18 ) >> 3 ] ); |
| 1125 | val |= ( driving_lookup[ ( readinputportbytag("WHEEL_R") & 0x18 ) >> 3 ] ); |
| 1126 | 1126 | break; |
| 1127 | 1127 | case 0x06: /* Trakball CX-22 */ |
| 1128 | 1128 | case 0x07: /* Trakball CX-80 / ST mouse */ |
| r2239 | r2240 | |
| 1179 | 1179 | |
| 1180 | 1180 | switch( offset ) { |
| 1181 | 1181 | case 0: /* Left controller port PIN 5 */ |
| 1182 | | switch ( readinputport(9) / CATEGORY_SELECT ) { |
| 1182 | switch ( readinputportbytag("CONTROLLERS") / CATEGORY_SELECT ) { |
| 1183 | 1183 | case 0x00: /* Joystick */ |
| 1184 | 1184 | return TIA_INPUT_PORT_ALWAYS_OFF; |
| 1185 | 1185 | case 0x01: /* Paddle */ |
| 1186 | | return readinputport(0); |
| 1186 | return readinputportbytag("PADDLE1"); |
| 1187 | 1187 | case 0x03: /* Keypad */ |
| 1188 | 1188 | for ( i = 0; i < 4; i++ ) { |
| 1189 | 1189 | if ( ! ( ( keypad_left_column >> i ) & 0x01 ) ) { |
| 1190 | | if ( ( readinputport(10) >> 3*i ) & 0x01 ) { |
| 1190 | if ( ( readinputportbytag("KEYPAD_L") >> 3*i ) & 0x01 ) { |
| 1191 | 1191 | return TIA_INPUT_PORT_ALWAYS_ON; |
| 1192 | 1192 | } else { |
| 1193 | 1193 | return TIA_INPUT_PORT_ALWAYS_OFF; |
| r2239 | r2240 | |
| 1196 | 1196 | } |
| 1197 | 1197 | return TIA_INPUT_PORT_ALWAYS_ON; |
| 1198 | 1198 | case 0x05: /* Boostergrip joystick */ |
| 1199 | | return ( readinputport(4) & 0x40 ) ? TIA_INPUT_PORT_ALWAYS_OFF : TIA_INPUT_PORT_ALWAYS_ON; |
| 1199 | return ( readinputportbytag("BUTTONS_L") & 0x40 ) ? TIA_INPUT_PORT_ALWAYS_OFF : TIA_INPUT_PORT_ALWAYS_ON; |
| 1200 | 1200 | default: |
| 1201 | 1201 | return TIA_INPUT_PORT_ALWAYS_OFF; |
| 1202 | 1202 | } |
| 1203 | 1203 | break; |
| 1204 | 1204 | case 1: /* Right controller port PIN 5 */ |
| 1205 | | switch ( readinputport(9) / CATEGORY_SELECT ) { |
| 1205 | switch ( readinputportbytag("CONTROLLERS") / CATEGORY_SELECT ) { |
| 1206 | 1206 | case 0x00: /* Joystick */ |
| 1207 | 1207 | return TIA_INPUT_PORT_ALWAYS_OFF; |
| 1208 | 1208 | case 0x01: /* Paddle */ |
| 1209 | | return readinputport(1); |
| 1209 | return readinputportbytag("PADDLE3"); |
| 1210 | 1210 | case 0x03: /* Keypad */ |
| 1211 | 1211 | for ( i = 0; i < 4; i++ ) { |
| 1212 | 1212 | if ( ! ( ( keypad_left_column >> i ) & 0x01 ) ) { |
| 1213 | | if ( ( readinputport(10) >> 3*i ) & 0x02 ) { |
| 1213 | if ( ( readinputportbytag("KEYPAD_L") >> 3*i ) & 0x02 ) { |
| 1214 | 1214 | return TIA_INPUT_PORT_ALWAYS_ON; |
| 1215 | 1215 | } else { |
| 1216 | 1216 | return TIA_INPUT_PORT_ALWAYS_OFF; |
| r2239 | r2240 | |
| 1219 | 1219 | } |
| 1220 | 1220 | return TIA_INPUT_PORT_ALWAYS_ON; |
| 1221 | 1221 | case 0x05: /* Joystick w/Boostergrip */ |
| 1222 | | return ( readinputport(4) & 0x20 ) ? TIA_INPUT_PORT_ALWAYS_OFF : TIA_INPUT_PORT_ALWAYS_ON; |
| 1222 | return ( readinputportbytag("BUTTONS_L") & 0x20 ) ? TIA_INPUT_PORT_ALWAYS_OFF : TIA_INPUT_PORT_ALWAYS_ON; |
| 1223 | 1223 | default: |
| 1224 | 1224 | return TIA_INPUT_PORT_ALWAYS_OFF; |
| 1225 | 1225 | } |
| 1226 | 1226 | break; |
| 1227 | 1227 | case 2: /* Left controller port PIN 9 */ |
| 1228 | | switch ( readinputport(9) % CATEGORY_SELECT ) { |
| 1228 | switch ( readinputportbytag("CONTROLLERS") % CATEGORY_SELECT ) { |
| 1229 | 1229 | case 0x00: /* Joystick */ |
| 1230 | 1230 | return TIA_INPUT_PORT_ALWAYS_OFF; |
| 1231 | 1231 | case 0x01: /* Paddle */ |
| 1232 | | return readinputport(2); |
| 1232 | return readinputportbytag("PADDLE2"); |
| 1233 | 1233 | case 0x03: /* Keypad */ |
| 1234 | 1234 | for ( i = 0; i < 4; i++ ) { |
| 1235 | 1235 | if ( ! ( ( keypad_right_column >> i ) & 0x01 ) ) { |
| 1236 | | if ( ( readinputport(11) >> 3*i ) & 0x01 ) { |
| 1236 | if ( ( readinputportbytag("KEYPAD_R") >> 3*i ) & 0x01 ) { |
| 1237 | 1237 | return TIA_INPUT_PORT_ALWAYS_ON; |
| 1238 | 1238 | } else { |
| 1239 | 1239 | return TIA_INPUT_PORT_ALWAYS_OFF; |
| r2239 | r2240 | |
| 1242 | 1242 | } |
| 1243 | 1243 | return TIA_INPUT_PORT_ALWAYS_ON; |
| 1244 | 1244 | case 0x05: /* Joystick w/Boostergrip */ |
| 1245 | | return ( readinputport(5) & 0x40 ) ? TIA_INPUT_PORT_ALWAYS_OFF : TIA_INPUT_PORT_ALWAYS_ON; |
| 1245 | return ( readinputportbytag("BUTTONS_R") & 0x40 ) ? TIA_INPUT_PORT_ALWAYS_OFF : TIA_INPUT_PORT_ALWAYS_ON; |
| 1246 | 1246 | default: |
| 1247 | 1247 | return TIA_INPUT_PORT_ALWAYS_OFF; |
| 1248 | 1248 | } |
| 1249 | 1249 | break; |
| 1250 | 1250 | case 3: /* Right controller port PIN 9 */ |
| 1251 | | switch ( readinputport(9) % CATEGORY_SELECT ) { |
| 1251 | switch ( readinputportbytag("CONTROLLERS") % CATEGORY_SELECT ) { |
| 1252 | 1252 | case 0x00: /* Joystick */ |
| 1253 | 1253 | return TIA_INPUT_PORT_ALWAYS_OFF; |
| 1254 | 1254 | case 0x01: /* Paddle */ |
| 1255 | | return readinputport(3); |
| 1255 | return readinputportbytag("PADDLE4"); |
| 1256 | 1256 | case 0x03: /* Keypad */ |
| 1257 | 1257 | for ( i = 0; i < 4; i++ ) { |
| 1258 | 1258 | if ( ! ( ( keypad_right_column >> i ) & 0x01 ) ) { |
| 1259 | | if ( ( readinputport(11) >> 3*i ) & 0x02 ) { |
| 1259 | if ( ( readinputportbytag("KEYPAD_R") >> 3*i ) & 0x02 ) { |
| 1260 | 1260 | return TIA_INPUT_PORT_ALWAYS_ON; |
| 1261 | 1261 | } else { |
| 1262 | 1262 | return TIA_INPUT_PORT_ALWAYS_OFF; |
| r2239 | r2240 | |
| 1265 | 1265 | } |
| 1266 | 1266 | return TIA_INPUT_PORT_ALWAYS_ON; |
| 1267 | 1267 | case 0x05: /* Joystick w/Boostergrip */ |
| 1268 | | return ( readinputport(5) & 0x20 ) ? TIA_INPUT_PORT_ALWAYS_OFF : TIA_INPUT_PORT_ALWAYS_ON; |
| 1268 | return ( readinputportbytag("BUTTONS_R") & 0x20 ) ? TIA_INPUT_PORT_ALWAYS_OFF : TIA_INPUT_PORT_ALWAYS_ON; |
| 1269 | 1269 | default: |
| 1270 | 1270 | return TIA_INPUT_PORT_ALWAYS_OFF; |
| 1271 | 1271 | } |
| 1272 | 1272 | break; |
| 1273 | 1273 | case 4: /* Left controller port PIN 6 */ |
| 1274 | | switch ( readinputport(9) / CATEGORY_SELECT ) { |
| 1274 | switch ( readinputportbytag("CONTROLLERS") / CATEGORY_SELECT ) { |
| 1275 | 1275 | case 0x00: /* Joystick */ |
| 1276 | 1276 | case 0x05: /* Joystick w/Boostergrip */ |
| 1277 | | return readinputport(4); |
| 1277 | return readinputportbytag("BUTTONS_L"); |
| 1278 | 1278 | case 0x01: /* Paddle */ |
| 1279 | 1279 | return 0xff; |
| 1280 | 1280 | case 0x02: /* Driving */ |
| 1281 | | return readinputport(4) << 3; |
| 1281 | return readinputportbytag("BUTTONS_L") << 3; |
| 1282 | 1282 | case 0x03: /* Keypad */ |
| 1283 | 1283 | for ( i = 0; i < 4; i++ ) { |
| 1284 | 1284 | if ( ! ( ( keypad_left_column >> i ) & 0x01 ) ) { |
| 1285 | | if ( ( readinputport(10) >> 3*i ) & 0x04 ) { |
| 1285 | if ( ( readinputportbytag("KEYPAD_L") >> 3*i ) & 0x04 ) { |
| 1286 | 1286 | return 0xff; |
| 1287 | 1287 | } else { |
| 1288 | 1288 | return 0x00; |
| r2239 | r2240 | |
| 1291 | 1291 | } |
| 1292 | 1292 | return 0xff; |
| 1293 | 1293 | case 0x06: /* Trakball CX-22 */ |
| 1294 | | return readinputport(4) << 4; |
| 1294 | return readinputportbytag("BUTTONS_L") << 4; |
| 1295 | 1295 | default: |
| 1296 | 1296 | return 0xff; |
| 1297 | 1297 | } |
| 1298 | 1298 | break; |
| 1299 | 1299 | case 5: /* Right controller port PIN 6 */ |
| 1300 | | switch ( readinputport(9) % CATEGORY_SELECT ) { |
| 1300 | switch ( readinputportbytag("CONTROLLERS") % CATEGORY_SELECT ) { |
| 1301 | 1301 | case 0x00: /* Joystick */ |
| 1302 | 1302 | case 0x05: /* Joystick w/Boostergrip */ |
| 1303 | | return readinputport(5); |
| 1303 | return readinputportbytag("BUTTONS_R"); |
| 1304 | 1304 | case 0x01: /* Paddle */ |
| 1305 | 1305 | return 0xff; |
| 1306 | 1306 | case 0x02: /* Driving */ |
| 1307 | | return readinputport(5) << 3; |
| 1307 | return readinputportbytag("BUTTONS_R") << 3; |
| 1308 | 1308 | case 0x03: /* Keypad */ |
| 1309 | 1309 | for ( i = 0; i < 4; i++ ) { |
| 1310 | 1310 | if ( ! ( ( keypad_right_column >> i ) & 0x01 ) ) { |
| 1311 | | if ( ( readinputport(11) >> 3*i ) & 0x04 ) { |
| 1311 | if ( ( readinputportbytag("KEYPAD_R") >> 3*i ) & 0x04 ) { |
| 1312 | 1312 | return 0xff; |
| 1313 | 1313 | } else { |
| 1314 | 1314 | return 0x00; |
| r2239 | r2240 | |
| 1317 | 1317 | } |
| 1318 | 1318 | return 0xff; |
| 1319 | 1319 | case 0x06: /* Trakball CX-22 */ |
| 1320 | | return readinputport(5) << 4; |
| 1320 | return readinputportbytag("BUTTONS_R") << 4; |
| 1321 | 1321 | default: |
| 1322 | 1322 | return 0xff; |
| 1323 | 1323 | } |
| r2239 | r2240 | |
| 1787 | 1787 | |
| 1788 | 1788 | static INPUT_PORTS_START( a2600 ) |
| 1789 | 1789 | |
| 1790 | | PORT_START /* [0] */ |
| 1790 | PORT_START_TAG("PADDLE1") /* [0] */ |
| 1791 | 1791 | PORT_BIT( 0xff, 0x80, IPT_PADDLE) PORT_SENSITIVITY(40) PORT_KEYDELTA(10) PORT_CENTERDELTA(0) PORT_MINMAX(0,255) PORT_CATEGORY(11) PORT_PLAYER(1) PORT_REVERSE |
| 1792 | | PORT_START /* [1] */ |
| 1792 | PORT_START_TAG("PADDLE3") /* [1] */ |
| 1793 | 1793 | PORT_BIT( 0xff, 0x80, IPT_PADDLE) PORT_SENSITIVITY(40) PORT_KEYDELTA(10) PORT_CENTERDELTA(0) PORT_MINMAX(0,255) PORT_CATEGORY(11) PORT_PLAYER(3) PORT_REVERSE |
| 1794 | | PORT_START /* [2] */ |
| 1794 | PORT_START_TAG("PADDLE2") /* [2] */ |
| 1795 | 1795 | PORT_BIT( 0xff, 0x80, IPT_PADDLE) PORT_SENSITIVITY(40) PORT_KEYDELTA(10) PORT_CENTERDELTA(0) PORT_MINMAX(0,255) PORT_CATEGORY(21) PORT_PLAYER(2) PORT_REVERSE |
| 1796 | | PORT_START /* [3] */ |
| 1796 | PORT_START_TAG("PADDLE4") /* [3] */ |
| 1797 | 1797 | PORT_BIT( 0xff, 0x80, IPT_PADDLE) PORT_SENSITIVITY(40) PORT_KEYDELTA(10) PORT_CENTERDELTA(0) PORT_MINMAX(0,255) PORT_CATEGORY(21) PORT_PLAYER(4) PORT_REVERSE PORT_CODE_DEC(KEYCODE_4_PAD) PORT_CODE_INC(KEYCODE_6_PAD) |
| 1798 | 1798 | |
| 1799 | | PORT_START /* [4] left port button(s) */ |
| 1799 | PORT_START_TAG("BUTTONS_L") /* [4] left port button(s) */ |
| 1800 | 1800 | // PORT_BIT ( 0x02, IP_ACTIVE_LOW, IPT_BUTTON3) PORT_CATEGORY(15) PORT_PLAYER(1) |
| 1801 | 1801 | // PORT_BIT ( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2) PORT_CATEGORY(15) PORT_PLAYER(1) |
| 1802 | 1802 | PORT_BIT ( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1) PORT_CATEGORY(15) PORT_PLAYER(1) |
| r2239 | r2240 | |
| 1805 | 1805 | PORT_BIT ( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2) PORT_CATEGORY(10) PORT_PLAYER(1) |
| 1806 | 1806 | PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1) PORT_CATEGORY(10) PORT_PLAYER(1) |
| 1807 | 1807 | |
| 1808 | | PORT_START /* [5] right port button(s) */ |
| 1808 | PORT_START_TAG("BUTTONS_R") /* [5] right port button(s) */ |
| 1809 | 1809 | // PORT_BIT ( 0x02, IP_ACTIVE_LOW, IPT_BUTTON3) PORT_CATEGORY(25) PORT_PLAYER(2) |
| 1810 | 1810 | // PORT_BIT ( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2) PORT_CATEGORY(25) PORT_PLAYER(2) |
| 1811 | 1811 | PORT_BIT ( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1) PORT_CATEGORY(25) PORT_PLAYER(2) |
| r2239 | r2240 | |
| 1814 | 1814 | PORT_BIT ( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2) PORT_CATEGORY(20) PORT_PLAYER(2) |
| 1815 | 1815 | PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1) PORT_CATEGORY(20) PORT_PLAYER(2) |
| 1816 | 1816 | |
| 1817 | | PORT_START /* [6] SWCHA joystick */ |
| 1817 | PORT_START_TAG("SWA_JOY") /* [6] SWCHA joystick */ |
| 1818 | 1818 | PORT_BIT ( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP) PORT_CATEGORY(20) PORT_PLAYER(2) |
| 1819 | 1819 | PORT_BIT ( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN) PORT_CATEGORY(20) PORT_PLAYER(2) |
| 1820 | 1820 | PORT_BIT ( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT) PORT_CATEGORY(20) PORT_PLAYER(2) |
| r2239 | r2240 | |
| 1824 | 1824 | PORT_BIT ( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT) PORT_CATEGORY(10) PORT_PLAYER(1) |
| 1825 | 1825 | PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT) PORT_CATEGORY(10) PORT_PLAYER(1) |
| 1826 | 1826 | |
| 1827 | | PORT_START /* [7] SWCHA paddles */ |
| 1827 | PORT_START_TAG("SWA_PAD") /* [7] SWCHA paddles */ |
| 1828 | 1828 | PORT_BIT ( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 1829 | 1829 | PORT_BIT ( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 1830 | 1830 | PORT_BIT ( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1) PORT_CATEGORY(21) PORT_PLAYER(4) |
| r2239 | r2240 | |
| 1834 | 1834 | PORT_BIT ( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1) PORT_CATEGORY(11) PORT_PLAYER(3) |
| 1835 | 1835 | PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1) PORT_CATEGORY(11) PORT_PLAYER(1) |
| 1836 | 1836 | |
| 1837 | | PORT_START /* [8] SWCHB */ |
| 1837 | PORT_START_TAG("SWB") /* [8] SWCHB */ |
| 1838 | 1838 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Reset Game") PORT_CODE(KEYCODE_2) |
| 1839 | 1839 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START) PORT_NAME("Select Game") |
| 1840 | 1840 | PORT_BIT ( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) |
| r2239 | r2240 | |
| 1850 | 1850 | PORT_DIPSETTING( 0x80, "A" ) |
| 1851 | 1851 | PORT_DIPSETTING( 0x00, "B" ) |
| 1852 | 1852 | |
| 1853 | | PORT_START /* [9] */ |
| 1853 | PORT_START_TAG("CONTROLLERS") /* [9] */ |
| 1854 | 1854 | PORT_CATEGORY_CLASS( 0xf0, 0x00, STR_LEFT_CONTROLLER ) |
| 1855 | 1855 | PORT_CATEGORY_ITEM( 0x00, DEF_STR( Joystick ), 10 ) |
| 1856 | 1856 | PORT_CATEGORY_ITEM( 0x10, STR_PADDLES, 11 ) |
| r2239 | r2240 | |
| 1876 | 1876 | PORT_CATEGORY_ITEM( 0x0a, STR_KIDVID, 30 ) |
| 1877 | 1877 | //PORT_CATEGORY_ITEM( 0x0b, "Save Key", 31 ) |
| 1878 | 1878 | |
| 1879 | | PORT_START /* [10] left keypad */ |
| 1879 | PORT_START_TAG("KEYPAD_L") /* [10] left keypad */ |
| 1880 | 1880 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CATEGORY(13) PORT_NAME("left 1") PORT_CODE(KEYCODE_7_PAD) |
| 1881 | 1881 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CATEGORY(13) PORT_NAME("left 2") PORT_CODE(KEYCODE_8_PAD) |
| 1882 | 1882 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CATEGORY(13) PORT_NAME("left 3") PORT_CODE(KEYCODE_9_PAD) |
| r2239 | r2240 | |
| 1890 | 1890 | PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CATEGORY(13) PORT_NAME("left 0") PORT_CODE(KEYCODE_DEL_PAD) |
| 1891 | 1891 | PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CATEGORY(13) PORT_NAME("left #") PORT_CODE(KEYCODE_ENTER_PAD) |
| 1892 | 1892 | |
| 1893 | | PORT_START /* [11] right keypad */ |
| 1893 | PORT_START_TAG("KEYPAD_R") /* [11] right keypad */ |
| 1894 | 1894 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CATEGORY(23) PORT_NAME("right 1") PORT_CODE(KEYCODE_5) |
| 1895 | 1895 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CATEGORY(23) PORT_NAME("right 2") PORT_CODE(KEYCODE_6) |
| 1896 | 1896 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CATEGORY(23) PORT_NAME("right 3") PORT_CODE(KEYCODE_7) |
| r2239 | r2240 | |
| 1904 | 1904 | PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CATEGORY(23) PORT_NAME("right 0") PORT_CODE(KEYCODE_B) |
| 1905 | 1905 | PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CATEGORY(23) PORT_NAME("right #") PORT_CODE(KEYCODE_N) |
| 1906 | 1906 | |
| 1907 | | PORT_START /* [12] left driving controller */ |
| 1907 | PORT_START_TAG("WHEEL_L") /* [12] left driving controller */ |
| 1908 | 1908 | PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_CATEGORY(12) PORT_SENSITIVITY(40) PORT_KEYDELTA(5) PORT_PLAYER(1) |
| 1909 | 1909 | |
| 1910 | | PORT_START /* [13] right driving controller */ |
| 1910 | PORT_START_TAG("WHEEL_R") /* [13] right driving controller */ |
| 1911 | 1911 | PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_CATEGORY(22) PORT_SENSITIVITY(40) PORT_KEYDELTA(5) PORT_PLAYER(2) |
| 1912 | 1912 | |
| 1913 | | PORT_START /* [14] left light gun X */ |
| 1913 | PORT_START_TAG("GUNX_L") /* [14] left light gun X */ |
| 1914 | 1914 | // PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_CATEGORY(14) PORT_CROSSHAIR( X, 1.0, 0.0, 0 ) PORT_SENSITIVITY(25) PORT_KEYDELTA(15) PORT_PLAYER(1) |
| 1915 | 1915 | |
| 1916 | | PORT_START /* [15] left light gun Y */ |
| 1916 | PORT_START_TAG("GUNY_L") /* [15] left light gun Y */ |
| 1917 | 1917 | // PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y ) PORT_CATEGORY(14) PORT_CROSSHAIR( Y, 1.0, 0.0, 0 ) PORT_SENSITIVITY(25) PORT_KEYDELTA(15) PORT_PLAYER(1) |
| 1918 | 1918 | |
| 1919 | | PORT_START /* [16] right light gun X */ |
| 1919 | PORT_START_TAG("GUNX_R") /* [16] right light gun X */ |
| 1920 | 1920 | // PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_CATEGORY(24) PORT_CROSSHAIR( X, 1.0, 0.0, 0 ) PORT_SENSITIVITY(25) PORT_KEYDELTA(15) PORT_PLAYER(2) |
| 1921 | 1921 | |
| 1922 | | PORT_START /* [17] right light gun Y */ |
| 1922 | PORT_START_TAG("GUNY_R") /* [17] right light gun Y */ |
| 1923 | 1923 | // PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y ) PORT_CATEGORY(24) PORT_CROSSHAIR( Y, 1.0, 0.0, 0 ) PORT_SENSITIVITY(25) PORT_KEYDELTA(15) PORT_PLAYER(2) |
| 1924 | 1924 | |
| 1925 | | PORT_START /* [18] left trak ball X */ |
| 1925 | PORT_START_TAG("TRAKX_L") /* [18] left trak ball X */ |
| 1926 | 1926 | PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_CATEGORY(15) PORT_SENSITIVITY(40) PORT_KEYDELTA(5) PORT_PLAYER(1) |
| 1927 | 1927 | |
| 1928 | | PORT_START /* [19] left trak ball Y */ |
| 1928 | PORT_START_TAG("TRAKY_L") /* [19] left trak ball Y */ |
| 1929 | 1929 | PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y ) PORT_CATEGORY(15) PORT_SENSITIVITY(40) PORT_KEYDELTA(5) PORT_PLAYER(1) |
| 1930 | 1930 | |
| 1931 | | PORT_START /* [20] right trak ball X */ |
| 1931 | PORT_START_TAG("TRAKX_R") /* [20] right trak ball X */ |
| 1932 | 1932 | PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_CATEGORY(25) PORT_SENSITIVITY(40) PORT_KEYDELTA(5) PORT_PLAYER(2) |
| 1933 | 1933 | |
| 1934 | | PORT_START /* [21] right trak ball Y */ |
| 1934 | PORT_START_TAG("TRAKY_R") /* [21] right trak ball Y */ |
| 1935 | 1935 | PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y ) PORT_CATEGORY(25) PORT_SENSITIVITY(40) PORT_KEYDELTA(5) PORT_PLAYER(2) |
| 1936 | 1936 | |
| 1937 | 1937 | INPUT_PORTS_END |