trunk/src/mess/drivers/a2600.c
| r18679 | r18680 | |
| 51 | 51 | a2600_state(const machine_config &mconfig, device_type type, const char *tag) |
| 52 | 52 | : driver_device(mconfig, type, tag) |
| 53 | 53 | , m_riot_ram(*this, "riot_ram") |
| 54 | | // , m_joy1(*this, CONTROL1_TAG) |
| 55 | | // , m_joy2(*this, CONTROL2_TAG) |
| 54 | , m_joy1(*this, CONTROL1_TAG) |
| 55 | , m_joy2(*this, CONTROL2_TAG) |
| 56 | 56 | { } |
| 57 | 57 | |
| 58 | 58 | dpc_t m_dpc; |
| r18679 | r18680 | |
| 61 | 61 | UINT8* m_ram_base; |
| 62 | 62 | required_shared_ptr<UINT8> m_riot_ram; |
| 63 | 63 | UINT8 m_banking_mode; |
| 64 | | UINT8 m_keypad_left_column; |
| 65 | | UINT8 m_keypad_right_column; |
| 66 | 64 | unsigned m_cart_size; |
| 67 | 65 | unsigned m_number_banks; |
| 68 | 66 | unsigned m_current_bank; |
| r18679 | r18680 | |
| 132 | 130 | DECLARE_READ8_MEMBER(riot_input_port_8_r); |
| 133 | 131 | |
| 134 | 132 | protected: |
| 135 | | // required_device<vcs_control_port_device> m_joy1; |
| 136 | | // required_device<vcs_control_port_device> m_joy2; |
| 133 | required_device<vcs_control_port_device> m_joy1; |
| 134 | required_device<vcs_control_port_device> m_joy2; |
| 137 | 135 | int next_bank(); |
| 138 | 136 | void modeF8_switch(UINT16 offset, UINT8 data); |
| 139 | 137 | void modeFA_switch(UINT16 offset, UINT8 data); |
| r18679 | r18680 | |
| 164 | 162 | #define MASTER_CLOCK_PAL 3546894 |
| 165 | 163 | #define CATEGORY_SELECT 16 |
| 166 | 164 | |
| 167 | | /* Some defines for the naming of the controller ports and the controllers */ |
| 168 | | #define STR_LEFT_CONTROLLER "Left Controller" |
| 169 | | #define STR_RIGHT_CONTROLLER "Right Controller" |
| 170 | | #define STR_PADDLES "Paddles" |
| 171 | | #define STR_DRIVING "Driving" |
| 172 | | #define STR_KEYPAD "Keypad" |
| 173 | | #define STR_LIGHTGUN "Lightgun" |
| 174 | | #define STR_BOOSTERGRIP "Booster Grip" |
| 175 | | #define STR_CX22TRAKBALL "CX-22 Trak-Ball" |
| 176 | | #define STR_CX80TRAKBALL "CX-80 Trak-Ball (TB Mode) / AtariST Mouse" |
| 177 | | #define STR_AMIGAMOUSE "Amiga Mouse" |
| 178 | | #define STR_KIDVID "KidVid Voice Module" |
| 179 | | |
| 180 | 165 | enum |
| 181 | 166 | { |
| 182 | 167 | mode2K, |
| r18679 | r18680 | |
| 1294 | 1279 | WRITE8_MEMBER(a2600_state::switch_A_w) |
| 1295 | 1280 | { |
| 1296 | 1281 | /* Left controller port */ |
| 1297 | | if ( machine().root_device().ioport("CONTROLLERS")->read() / CATEGORY_SELECT == 0x03 ) |
| 1298 | | { |
| 1299 | | m_keypad_left_column = data / 16; |
| 1300 | | } |
| 1282 | m_joy1->joy_w( data >> 4 ); |
| 1301 | 1283 | |
| 1302 | 1284 | /* Right controller port */ |
| 1303 | | switch( machine().root_device().ioport("CONTROLLERS")->read() % CATEGORY_SELECT ) |
| 1304 | | { |
| 1305 | | case 0x03: /* Keypad */ |
| 1306 | | m_keypad_right_column = data & 0x0F; |
| 1307 | | break; |
| 1308 | | case 0x0a: /* KidVid voice module */ |
| 1309 | | machine().device<cassette_image_device>(CASSETTE_TAG)->change_state(( data & 0x02 ) ? (cassette_state)CASSETTE_MOTOR_DISABLED : (cassette_state)(CASSETTE_MOTOR_ENABLED | CASSETTE_PLAY), (cassette_state)CASSETTE_MOTOR_DISABLED ); |
| 1310 | | break; |
| 1311 | | } |
| 1285 | m_joy2->joy_w( data & 0x0f ); |
| 1286 | |
| 1287 | // switch( machine().root_device().ioport("CONTROLLERS")->read() % CATEGORY_SELECT ) |
| 1288 | // { |
| 1289 | // case 0x0a: /* KidVid voice module */ |
| 1290 | // machine().device<cassette_image_device>(CASSETTE_TAG)->change_state(( data & 0x02 ) ? (cassette_state)CASSETTE_MOTOR_DISABLED : (cassette_state)(CASSETTE_MOTOR_ENABLED | CASSETTE_PLAY), (cassette_state)CASSETTE_MOTOR_DISABLED ); |
| 1291 | // break; |
| 1292 | // } |
| 1312 | 1293 | } |
| 1313 | 1294 | |
| 1314 | 1295 | READ8_MEMBER(a2600_state::switch_A_r) |
| 1315 | 1296 | { |
| 1316 | | static const UINT8 driving_lookup[4] = { 0x00, 0x02, 0x03, 0x01 }; |
| 1317 | 1297 | UINT8 val = 0; |
| 1318 | 1298 | |
| 1319 | 1299 | /* Left controller port PINs 1-4 ( 4321 ) */ |
| 1320 | | switch( machine().root_device().ioport("CONTROLLERS")->read() / CATEGORY_SELECT ) |
| 1321 | | { |
| 1322 | | case 0x00: /* Joystick */ |
| 1323 | | case 0x05: /* Joystick w/Boostergrip */ |
| 1324 | | val |= machine().root_device().ioport("SWA_JOY")->read() & 0xF0; |
| 1325 | | // val |= ( m_joy1->joy_r() & 0x0F ) << 4; |
| 1326 | | break; |
| 1327 | | case 0x01: /* Paddle */ |
| 1328 | | val |= machine().root_device().ioport("SWA_PAD")->read() & 0xF0; |
| 1329 | | break; |
| 1330 | | case 0x02: /* Driving */ |
| 1331 | | val |= 0xC0; |
| 1332 | | val |= ( driving_lookup[ ( machine().root_device().ioport("WHEEL_L")->read() & 0x18 ) >> 3 ] << 4 ); |
| 1333 | | break; |
| 1334 | | case 0x06: /* Trakball CX-22 */ |
| 1335 | | case 0x07: /* Trakball CX-80 / ST mouse */ |
| 1336 | | case 0x09: /* Amiga mouse */ |
| 1337 | | default: |
| 1338 | | val |= 0xF0; |
| 1339 | | break; |
| 1340 | | } |
| 1300 | val |= ( m_joy1->joy_r() & 0x0F ) << 4; |
| 1341 | 1301 | |
| 1342 | 1302 | /* Right controller port PINs 1-4 ( 4321 ) */ |
| 1343 | | switch( machine().root_device().ioport("CONTROLLERS")->read() % CATEGORY_SELECT ) |
| 1344 | | { |
| 1345 | | case 0x00: /* Joystick */ |
| 1346 | | case 0x05: /* Joystick w/Boostergrip */ |
| 1347 | | val |= machine().root_device().ioport("SWA_JOY")->read() & 0x0F; |
| 1348 | | break; |
| 1349 | | case 0x01: /* Paddle */ |
| 1350 | | val |= machine().root_device().ioport("SWA_PAD")->read() & 0x0F; |
| 1351 | | break; |
| 1352 | | case 0x02: /* Driving */ |
| 1353 | | val |= 0x0C; |
| 1354 | | val |= ( driving_lookup[ ( machine().root_device().ioport("WHEEL_R")->read() & 0x18 ) >> 3 ] ); |
| 1355 | | break; |
| 1356 | | case 0x06: /* Trakball CX-22 */ |
| 1357 | | case 0x07: /* Trakball CX-80 / ST mouse */ |
| 1358 | | case 0x09: /* Amiga mouse */ |
| 1359 | | default: |
| 1360 | | val |= 0x0F; |
| 1361 | | break; |
| 1362 | | } |
| 1303 | val |= m_joy2->joy_r() & 0x0F; |
| 1363 | 1304 | |
| 1364 | 1305 | return val; |
| 1365 | 1306 | } |
| r18679 | r18680 | |
| 1412 | 1353 | |
| 1413 | 1354 | READ16_MEMBER(a2600_state::a2600_read_input_port) |
| 1414 | 1355 | { |
| 1415 | | int i; |
| 1416 | | |
| 1417 | 1356 | switch( offset ) |
| 1418 | 1357 | { |
| 1419 | 1358 | case 0: /* Left controller port PIN 5 */ |
| 1420 | | switch ( ioport("CONTROLLERS")->read() / CATEGORY_SELECT ) |
| 1421 | | { |
| 1422 | | case 0x00: /* Joystick */ |
| 1423 | | return TIA_INPUT_PORT_ALWAYS_OFF; |
| 1424 | | case 0x01: /* Paddle */ |
| 1425 | | return ioport("PADDLE1")->read(); |
| 1426 | | case 0x03: /* Keypad */ |
| 1427 | | for ( i = 0; i < 4; i++ ) |
| 1428 | | { |
| 1429 | | if ( ! ( ( m_keypad_left_column >> i ) & 0x01 ) ) |
| 1430 | | { |
| 1431 | | if ( ( ioport("KEYPAD_L")->read() >> 3*i ) & 0x01 ) |
| 1432 | | { |
| 1433 | | return TIA_INPUT_PORT_ALWAYS_ON; |
| 1434 | | } |
| 1435 | | else |
| 1436 | | { |
| 1437 | | return TIA_INPUT_PORT_ALWAYS_OFF; |
| 1438 | | } |
| 1439 | | } |
| 1440 | | } |
| 1441 | | return TIA_INPUT_PORT_ALWAYS_ON; |
| 1442 | | case 0x05: /* Boostergrip joystick */ |
| 1443 | | return ( ioport("BUTTONS_L")->read() & 0x40 ) ? TIA_INPUT_PORT_ALWAYS_OFF : TIA_INPUT_PORT_ALWAYS_ON; |
| 1444 | | default: |
| 1445 | | return TIA_INPUT_PORT_ALWAYS_OFF; |
| 1446 | | } |
| 1447 | | break; |
| 1448 | | case 1: /* Right controller port PIN 5 */ |
| 1449 | | switch ( ioport("CONTROLLERS")->read() / CATEGORY_SELECT ) |
| 1450 | | { |
| 1451 | | case 0x00: /* Joystick */ |
| 1452 | | return TIA_INPUT_PORT_ALWAYS_OFF; |
| 1453 | | case 0x01: /* Paddle */ |
| 1454 | | return ioport("PADDLE3")->read(); |
| 1455 | | case 0x03: /* Keypad */ |
| 1456 | | for ( i = 0; i < 4; i++ ) |
| 1457 | | { |
| 1458 | | if ( ! ( ( m_keypad_left_column >> i ) & 0x01 ) ) |
| 1459 | | { |
| 1460 | | if ( ( ioport("KEYPAD_L")->read() >> 3*i ) & 0x02 ) |
| 1461 | | { |
| 1462 | | return TIA_INPUT_PORT_ALWAYS_ON; |
| 1463 | | } |
| 1464 | | else |
| 1465 | | { |
| 1466 | | return TIA_INPUT_PORT_ALWAYS_OFF; |
| 1467 | | } |
| 1468 | | } |
| 1469 | | } |
| 1470 | | return TIA_INPUT_PORT_ALWAYS_ON; |
| 1471 | | case 0x05: /* Joystick w/Boostergrip */ |
| 1472 | | return ( ioport("BUTTONS_L")->read() & 0x20 ) ? TIA_INPUT_PORT_ALWAYS_OFF : TIA_INPUT_PORT_ALWAYS_ON; |
| 1473 | | default: |
| 1474 | | return TIA_INPUT_PORT_ALWAYS_OFF; |
| 1475 | | } |
| 1476 | | break; |
| 1477 | | case 2: /* Left controller port PIN 9 */ |
| 1478 | | switch ( ioport("CONTROLLERS")->read() % CATEGORY_SELECT ) |
| 1479 | | { |
| 1480 | | case 0x00: /* Joystick */ |
| 1481 | | return TIA_INPUT_PORT_ALWAYS_OFF; |
| 1482 | | case 0x01: /* Paddle */ |
| 1483 | | return ioport("PADDLE2")->read(); |
| 1484 | | case 0x03: /* Keypad */ |
| 1485 | | for ( i = 0; i < 4; i++ ) |
| 1486 | | { |
| 1487 | | if ( ! ( ( m_keypad_right_column >> i ) & 0x01 ) ) |
| 1488 | | { |
| 1489 | | if ( ( ioport("KEYPAD_R")->read() >> 3*i ) & 0x01 ) |
| 1490 | | { |
| 1491 | | return TIA_INPUT_PORT_ALWAYS_ON; |
| 1492 | | } |
| 1493 | | else |
| 1494 | | { |
| 1495 | | return TIA_INPUT_PORT_ALWAYS_OFF; |
| 1496 | | } |
| 1497 | | } |
| 1498 | | } |
| 1499 | | return TIA_INPUT_PORT_ALWAYS_ON; |
| 1500 | | case 0x05: /* Joystick w/Boostergrip */ |
| 1501 | | return ( ioport("BUTTONS_R")->read() & 0x40 ) ? TIA_INPUT_PORT_ALWAYS_OFF : TIA_INPUT_PORT_ALWAYS_ON; |
| 1502 | | default: |
| 1503 | | return TIA_INPUT_PORT_ALWAYS_OFF; |
| 1504 | | } |
| 1505 | | break; |
| 1359 | return m_joy1->pot_x_r(); |
| 1360 | |
| 1361 | case 1: /* Left controller port PIN 9 */ |
| 1362 | return m_joy1->pot_y_r(); |
| 1363 | |
| 1364 | case 2: /* Right controller port PIN 5 */ |
| 1365 | return m_joy2->pot_x_r(); |
| 1366 | |
| 1506 | 1367 | case 3: /* Right controller port PIN 9 */ |
| 1507 | | switch ( ioport("CONTROLLERS")->read() % CATEGORY_SELECT ) |
| 1508 | | { |
| 1509 | | case 0x00: /* Joystick */ |
| 1510 | | return TIA_INPUT_PORT_ALWAYS_OFF; |
| 1511 | | case 0x01: /* Paddle */ |
| 1512 | | return ioport("PADDLE4")->read(); |
| 1513 | | case 0x03: /* Keypad */ |
| 1514 | | for ( i = 0; i < 4; i++ ) |
| 1515 | | { |
| 1516 | | if ( ! ( ( m_keypad_right_column >> i ) & 0x01 ) ) |
| 1517 | | { |
| 1518 | | if ( ( ioport("KEYPAD_R")->read() >> 3*i ) & 0x02 ) |
| 1519 | | { |
| 1520 | | return TIA_INPUT_PORT_ALWAYS_ON; |
| 1521 | | } |
| 1522 | | else |
| 1523 | | { |
| 1524 | | return TIA_INPUT_PORT_ALWAYS_OFF; |
| 1525 | | } |
| 1526 | | } |
| 1527 | | } |
| 1528 | | return TIA_INPUT_PORT_ALWAYS_ON; |
| 1529 | | case 0x05: /* Joystick w/Boostergrip */ |
| 1530 | | return ( ioport("BUTTONS_R")->read() & 0x20 ) ? TIA_INPUT_PORT_ALWAYS_OFF : TIA_INPUT_PORT_ALWAYS_ON; |
| 1531 | | default: |
| 1532 | | return TIA_INPUT_PORT_ALWAYS_OFF; |
| 1533 | | } |
| 1534 | | break; |
| 1368 | return m_joy2->pot_y_r(); |
| 1369 | |
| 1535 | 1370 | case 4: /* Left controller port PIN 6 */ |
| 1536 | | switch ( ioport("CONTROLLERS")->read() / CATEGORY_SELECT ) |
| 1537 | | { |
| 1538 | | case 0x00: /* Joystick */ |
| 1539 | | case 0x05: /* Joystick w/Boostergrip */ |
| 1540 | | return ioport("BUTTONS_L")->read(); |
| 1541 | | case 0x01: /* Paddle */ |
| 1542 | | return 0xff; |
| 1543 | | case 0x02: /* Driving */ |
| 1544 | | return ioport("BUTTONS_L")->read() << 3; |
| 1545 | | case 0x03: /* Keypad */ |
| 1546 | | for ( i = 0; i < 4; i++ ) |
| 1547 | | { |
| 1548 | | if ( ! ( ( m_keypad_left_column >> i ) & 0x01 ) ) |
| 1549 | | { |
| 1550 | | if ( ( ioport("KEYPAD_L")->read() >> 3*i ) & 0x04 ) |
| 1551 | | { |
| 1552 | | return 0xff; |
| 1553 | | } |
| 1554 | | else |
| 1555 | | { |
| 1556 | | return 0x00; |
| 1557 | | } |
| 1558 | | } |
| 1559 | | } |
| 1560 | | return 0xff; |
| 1561 | | case 0x06: /* Trakball CX-22 */ |
| 1562 | | return ioport("BUTTONS_L")->read() << 4; |
| 1563 | | default: |
| 1564 | | return 0xff; |
| 1565 | | } |
| 1566 | | break; |
| 1371 | return ( m_joy1->joy_r() & 0x20 ) ? 0xff : 0x7f; |
| 1372 | |
| 1567 | 1373 | case 5: /* Right controller port PIN 6 */ |
| 1568 | | switch ( ioport("CONTROLLERS")->read() % CATEGORY_SELECT ) |
| 1569 | | { |
| 1570 | | case 0x00: /* Joystick */ |
| 1571 | | case 0x05: /* Joystick w/Boostergrip */ |
| 1572 | | return ioport("BUTTONS_R")->read(); |
| 1573 | | case 0x01: /* Paddle */ |
| 1574 | | return 0xff; |
| 1575 | | case 0x02: /* Driving */ |
| 1576 | | return ioport("BUTTONS_R")->read() << 3; |
| 1577 | | case 0x03: /* Keypad */ |
| 1578 | | for ( i = 0; i < 4; i++ ) |
| 1579 | | { |
| 1580 | | if ( ! ( ( m_keypad_right_column >> i ) & 0x01 ) ) |
| 1581 | | { |
| 1582 | | if ( ( ioport("KEYPAD_R")->read() >> 3*i ) & 0x04 ) |
| 1583 | | { |
| 1584 | | return 0xff; |
| 1585 | | } |
| 1586 | | else |
| 1587 | | { |
| 1588 | | return 0x00; |
| 1589 | | } |
| 1590 | | } |
| 1591 | | } |
| 1592 | | return 0xff; |
| 1593 | | case 0x06: /* Trakball CX-22 */ |
| 1594 | | return ioport("BUTTONS_R")->read() << 4; |
| 1595 | | default: |
| 1596 | | return 0xff; |
| 1597 | | } |
| 1374 | return ( m_joy2->joy_r() & 0x20 ) ? 0xff : 0x7f; |
| 1598 | 1375 | } |
| 1599 | | return TIA_INPUT_PORT_ALWAYS_OFF; |
| 1376 | return 0xff; |
| 1600 | 1377 | } |
| 1601 | 1378 | |
| 1602 | 1379 | /* There are a few games that do an LDA ($80-$FF),Y instruction. |
| r18679 | r18680 | |
| 1786 | 1563 | if (foundkeypad) return (KEYP << 16) + KEYP; |
| 1787 | 1564 | return (left << 16) + right; |
| 1788 | 1565 | } |
| 1789 | | |
| 1790 | | static void set_category_value( running_machine &machine, const char* cat, const char *cat_selection ) |
| 1791 | | { |
| 1792 | | /* NPW 22-May-2008 - FIXME */ |
| 1793 | | #if 0 |
| 1794 | | input_port_entry *cat_in = NULL; |
| 1795 | | input_port_entry *in; |
| 1796 | | |
| 1797 | | for( in = machine.input_ports; in->type != IPT_END; in++ ) |
| 1798 | | { |
| 1799 | | if ( in->type == IPT_CATEGORY_NAME && ! mame_stricmp( cat, input_port_name(in) ) ) |
| 1800 | | { |
| 1801 | | cat_in = in; |
| 1802 | | } |
| 1803 | | if ( cat_in && in->type == IPT_CATEGORY_SETTING && ! mame_stricmp( cat_selection, input_port_name(in) ) ) |
| 1804 | | { |
| 1805 | | cat_in->default_value = in->default_value; |
| 1806 | | return; |
| 1807 | | } |
| 1808 | | } |
| 1809 | 1566 | #endif |
| 1810 | | } |
| 1811 | 1567 | |
| 1812 | | static void set_controller( running_machine &machine, const char *controller, unsigned int selection ) |
| 1813 | | { |
| 1814 | | /* Defaulting to only joystick when joysstick and paddle are set for now... */ |
| 1815 | | if ( selection == JOYS + PADD ) |
| 1816 | | selection = JOYS; |
| 1817 | | |
| 1818 | | switch( selection ) |
| 1819 | | { |
| 1820 | | case JOYS: set_category_value( machine, controller, "Joystick" ); break; |
| 1821 | | case PADD: set_category_value( machine, controller, STR_PADDLES ); break; |
| 1822 | | case KEYP: set_category_value( machine, controller, STR_KEYPAD ); break; |
| 1823 | | case LGUN: set_category_value( machine, controller, STR_LIGHTGUN ); break; |
| 1824 | | case INDY: set_category_value( machine, controller, STR_DRIVING ); break; |
| 1825 | | case BOOS: set_category_value( machine, controller, STR_BOOSTERGRIP ); break; |
| 1826 | | case KVID: set_category_value( machine, controller, STR_KIDVID ); break; |
| 1827 | | case CMTE: break; |
| 1828 | | case MLNK: break; |
| 1829 | | case AMSE: set_category_value( machine, controller, STR_AMIGAMOUSE ); break; |
| 1830 | | case CX22: set_category_value( machine, controller, STR_CX22TRAKBALL ); break; |
| 1831 | | case CX80: set_category_value( machine, controller, STR_CX80TRAKBALL ); break; |
| 1832 | | } |
| 1833 | | } |
| 1834 | | #endif |
| 1835 | | |
| 1836 | 1568 | void a2600_state::machine_reset() |
| 1837 | 1569 | { |
| 1838 | 1570 | address_space& space = machine().device("maincpu")->memory().space(AS_PROGRAM); |
| r18679 | r18680 | |
| 1841 | 1573 | |
| 1842 | 1574 | m_current_reset_bank_counter++; |
| 1843 | 1575 | |
| 1844 | | #ifdef UNUSED_FUNCTIONS |
| 1845 | | /* auto-detect special controllers */ |
| 1846 | | unsigned long controltemp; |
| 1847 | | controltemp = detect_2600controllers(machine()); |
| 1848 | | set_controller( machine(), STR_LEFT_CONTROLLER, controltemp >> 16 ); |
| 1849 | | set_controller( machine(), STR_RIGHT_CONTROLLER, controltemp & 0xFFFF ); |
| 1850 | | #endif |
| 1851 | | |
| 1852 | 1576 | /* auto-detect bank mode */ |
| 1853 | 1577 | if (m_banking_mode == 0xff) if (detect_modeDC(machine())) m_banking_mode = modeDC; |
| 1854 | 1578 | if (m_banking_mode == 0xff) if (detect_mode3E(machine())) m_banking_mode = mode3E; |
| r18679 | r18680 | |
| 2182 | 1906 | |
| 2183 | 1907 | |
| 2184 | 1908 | static INPUT_PORTS_START( a2600 ) |
| 2185 | | |
| 2186 | | PORT_START("PADDLE1") |
| 2187 | | PORT_BIT( 0xff, 0x80, IPT_PADDLE) PORT_SENSITIVITY(40) PORT_KEYDELTA(10) PORT_CENTERDELTA(0) PORT_MINMAX(0,255) PORT_PLAYER(1) PORT_REVERSE PORT_CONDITION("CONTROLLERS", 0xf0, EQUALS, 0x10) |
| 2188 | | PORT_START("PADDLE3") |
| 2189 | | PORT_BIT( 0xff, 0x80, IPT_PADDLE) PORT_SENSITIVITY(40) PORT_KEYDELTA(10) PORT_CENTERDELTA(0) PORT_MINMAX(0,255) PORT_PLAYER(3) PORT_REVERSE PORT_CONDITION("CONTROLLERS", 0xf0, EQUALS, 0x10) |
| 2190 | | PORT_START("PADDLE2") |
| 2191 | | PORT_BIT( 0xff, 0x80, IPT_PADDLE) PORT_SENSITIVITY(40) PORT_KEYDELTA(10) PORT_CENTERDELTA(0) PORT_MINMAX(0,255) PORT_PLAYER(2) PORT_REVERSE PORT_CONDITION("CONTROLLERS", 0x0f, EQUALS, 0x01) |
| 2192 | | PORT_START("PADDLE4") |
| 2193 | | PORT_BIT( 0xff, 0x80, IPT_PADDLE) PORT_SENSITIVITY(40) PORT_KEYDELTA(10) PORT_CENTERDELTA(0) PORT_MINMAX(0,255) PORT_PLAYER(4) PORT_REVERSE PORT_CODE_DEC(KEYCODE_4_PAD) PORT_CODE_INC(KEYCODE_6_PAD) PORT_CONDITION("CONTROLLERS", 0x0f, EQUALS, 0x01) |
| 2194 | | |
| 2195 | | PORT_START("BUTTONS_L") /* left port button(s) */ |
| 2196 | | // PORT_BIT ( 0x02, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_CONDITION("CONTROLLERS", 0xf0, EQUALS, 0x50) |
| 2197 | | // PORT_BIT ( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_CONDITION("CONTROLLERS", 0xf0, EQUALS, 0x50) |
| 2198 | | PORT_BIT ( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_CONDITION("CONTROLLERS", 0xf0, EQUALS, 0x50) |
| 2199 | | PORT_BIT ( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_CONDITION("CONTROLLERS", 0xf0, EQUALS, 0x20) |
| 2200 | | PORT_BIT ( 0x20, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_CONDITION("CONTROLLERS", 0xf0, EQUALS, 0x00) |
| 2201 | | PORT_BIT ( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_CONDITION("CONTROLLERS", 0xf0, EQUALS, 0x00) |
| 2202 | | PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_CONDITION("CONTROLLERS", 0xf0, EQUALS, 0x00) |
| 2203 | | |
| 2204 | | PORT_START("BUTTONS_R") /* right port button(s) */ |
| 2205 | | // PORT_BIT ( 0x02, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_CONDITION("CONTROLLERS", 0x0f, EQUALS, 0x05) |
| 2206 | | // PORT_BIT ( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_CONDITION("CONTROLLERS", 0x0f, EQUALS, 0x05) |
| 2207 | | PORT_BIT ( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_CONDITION("CONTROLLERS", 0x0f, EQUALS, 0x05) |
| 2208 | | PORT_BIT ( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_CONDITION("CONTROLLERS", 0x0f, EQUALS, 0x02) |
| 2209 | | PORT_BIT ( 0x20, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_CONDITION("CONTROLLERS", 0x0f, EQUALS, 0x00) |
| 2210 | | PORT_BIT ( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_CONDITION("CONTROLLERS", 0x0f, EQUALS, 0x00) |
| 2211 | | PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_CONDITION("CONTROLLERS", 0x0f, EQUALS, 0x00) |
| 2212 | | |
| 2213 | | PORT_START("SWA_JOY") /* SWCHA joystick */ |
| 2214 | | PORT_BIT ( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP) PORT_PLAYER(2) PORT_CONDITION("CONTROLLERS", 0x0f, EQUALS, 0x00) |
| 2215 | | PORT_BIT ( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN) PORT_PLAYER(2) PORT_CONDITION("CONTROLLERS", 0x0f, EQUALS, 0x00) |
| 2216 | | PORT_BIT ( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT) PORT_PLAYER(2) PORT_CONDITION("CONTROLLERS", 0x0f, EQUALS, 0x00) |
| 2217 | | PORT_BIT ( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT) PORT_PLAYER(2) PORT_CONDITION("CONTROLLERS", 0x0f, EQUALS, 0x00) |
| 2218 | | PORT_BIT ( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP) PORT_PLAYER(1) PORT_CONDITION("CONTROLLERS", 0xf0, EQUALS, 0x00) |
| 2219 | | PORT_BIT ( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN) PORT_PLAYER(1) PORT_CONDITION("CONTROLLERS", 0xf0, EQUALS, 0x00) |
| 2220 | | PORT_BIT ( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT) PORT_PLAYER(1) PORT_CONDITION("CONTROLLERS", 0xf0, EQUALS, 0x00) |
| 2221 | | PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT) PORT_PLAYER(1) PORT_CONDITION("CONTROLLERS", 0xf0, EQUALS, 0x00) |
| 2222 | | |
| 2223 | | PORT_START("SWA_PAD") /* SWCHA paddles */ |
| 2224 | | PORT_BIT ( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 2225 | | PORT_BIT ( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 2226 | | PORT_BIT ( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4) PORT_CONDITION("CONTROLLERS", 0x0f, EQUALS, 0x01) |
| 2227 | | PORT_BIT ( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_CONDITION("CONTROLLERS", 0x0f, EQUALS, 0x01) |
| 2228 | | PORT_BIT ( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 2229 | | PORT_BIT ( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 2230 | | PORT_BIT ( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3) PORT_CONDITION("CONTROLLERS", 0xf0, EQUALS, 0x10) |
| 2231 | | PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_CONDITION("CONTROLLERS", 0xf0, EQUALS, 0x10) |
| 2232 | | |
| 2233 | 1909 | PORT_START("SWB") /* SWCHB */ |
| 2234 | 1910 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Reset Game") PORT_CODE(KEYCODE_2) |
| 2235 | 1911 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START ) PORT_NAME("Select Game") |
| r18679 | r18680 | |
| 2245 | 1921 | PORT_DIPNAME( 0x80, 0x00, "Right Diff. Switch" ) PORT_CODE(KEYCODE_4) PORT_TOGGLE |
| 2246 | 1922 | PORT_DIPSETTING( 0x80, "A" ) |
| 2247 | 1923 | PORT_DIPSETTING( 0x00, "B" ) |
| 2248 | | |
| 2249 | | PORT_START("CONTROLLERS") |
| 2250 | | PORT_CONFNAME( 0xf0, 0x00, STR_LEFT_CONTROLLER ) |
| 2251 | | PORT_CONFSETTING( 0x00, DEF_STR( Joystick ) ) |
| 2252 | | PORT_CONFSETTING( 0x10, STR_PADDLES ) |
| 2253 | | PORT_CONFSETTING( 0x20, STR_DRIVING ) |
| 2254 | | PORT_CONFSETTING( 0x30, STR_KEYPAD ) |
| 2255 | | //PORT_CONFSETTING( 0x40, STR_LIGHTGUN ) |
| 2256 | | PORT_CONFSETTING( 0x50, STR_BOOSTERGRIP ) |
| 2257 | | //PORT_CONFSETTING( 0x60, STR_CX22TRAKBALL ) |
| 2258 | | //PORT_CONFSETTING( 0x70, STR_CX80TRAKBALL ) |
| 2259 | | //PORT_CONFSETTING( 0x80, "CX-80 Trak-Ball (JS Mode)" ) |
| 2260 | | //PORT_CONFSETTING( 0x90, STR_AMIGAMOUSE ) |
| 2261 | | PORT_CONFNAME( 0x0f, 0x00, STR_RIGHT_CONTROLLER ) |
| 2262 | | PORT_CONFSETTING( 0x00, DEF_STR( Joystick ) ) |
| 2263 | | PORT_CONFSETTING( 0x01, STR_PADDLES ) |
| 2264 | | PORT_CONFSETTING( 0x02, STR_DRIVING ) |
| 2265 | | PORT_CONFSETTING( 0x03, STR_KEYPAD ) |
| 2266 | | //PORT_CONFSETTING( 0x04, STR_LIGHTGUN ) |
| 2267 | | PORT_CONFSETTING( 0x05, STR_BOOSTERGRIP ) |
| 2268 | | //PORT_CONFSETTING( 0x06, STR_CX22TRAKBALL ) |
| 2269 | | //PORT_CONFSETTING( 0x07, STR_CX80TRAKBALL ) |
| 2270 | | //PORT_CONFSETTING( 0x08, "CX-80 Trak-Ball (JS Mode)" ) |
| 2271 | | //PORT_CONFSETTING( 0x09, STR_AMIGAMOUSE ) |
| 2272 | | PORT_CONFSETTING( 0x0a, STR_KIDVID ) |
| 2273 | | //PORT_CONFSETTING( 0x0b, "Save Key" ) |
| 2274 | | |
| 2275 | | PORT_START("KEYPAD_L") /* left keypad */ |
| 2276 | | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("left 1") PORT_CODE(KEYCODE_7_PAD) PORT_CONDITION("CONTROLLERS", 0xf0, EQUALS, 0x30) |
| 2277 | | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("left 2") PORT_CODE(KEYCODE_8_PAD) PORT_CONDITION("CONTROLLERS", 0xf0, EQUALS, 0x30) |
| 2278 | | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("left 3") PORT_CODE(KEYCODE_9_PAD) PORT_CONDITION("CONTROLLERS", 0xf0, EQUALS, 0x30) |
| 2279 | | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("left 4") PORT_CODE(KEYCODE_4_PAD) PORT_CONDITION("CONTROLLERS", 0xf0, EQUALS, 0x30) |
| 2280 | | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("left 5") PORT_CODE(KEYCODE_5_PAD) PORT_CONDITION("CONTROLLERS", 0xf0, EQUALS, 0x30) |
| 2281 | | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("left 6") PORT_CODE(KEYCODE_6_PAD) PORT_CONDITION("CONTROLLERS", 0xf0, EQUALS, 0x30) |
| 2282 | | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("left 7") PORT_CODE(KEYCODE_1_PAD) PORT_CONDITION("CONTROLLERS", 0xf0, EQUALS, 0x30) |
| 2283 | | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("left 8") PORT_CODE(KEYCODE_2_PAD) PORT_CONDITION("CONTROLLERS", 0xf0, EQUALS, 0x30) |
| 2284 | | PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("left 9") PORT_CODE(KEYCODE_3_PAD) PORT_CONDITION("CONTROLLERS", 0xf0, EQUALS, 0x30) |
| 2285 | | PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("left *") PORT_CODE(KEYCODE_0_PAD) PORT_CONDITION("CONTROLLERS", 0xf0, EQUALS, 0x30) |
| 2286 | | PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("left 0") PORT_CODE(KEYCODE_DEL_PAD) PORT_CONDITION("CONTROLLERS", 0xf0, EQUALS, 0x30) |
| 2287 | | PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("left #") PORT_CODE(KEYCODE_ENTER_PAD) PORT_CONDITION("CONTROLLERS", 0xf0, EQUALS, 0x30) |
| 2288 | | |
| 2289 | | PORT_START("KEYPAD_R") /* right keypad */ |
| 2290 | | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("right 1") PORT_CODE(KEYCODE_5) PORT_CONDITION("CONTROLLERS", 0x0f, EQUALS, 0x03) |
| 2291 | | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("right 2") PORT_CODE(KEYCODE_6) PORT_CONDITION("CONTROLLERS", 0x0f, EQUALS, 0x03) |
| 2292 | | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("right 3") PORT_CODE(KEYCODE_7) PORT_CONDITION("CONTROLLERS", 0x0f, EQUALS, 0x03) |
| 2293 | | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("right 4") PORT_CODE(KEYCODE_R) PORT_CONDITION("CONTROLLERS", 0x0f, EQUALS, 0x03) |
| 2294 | | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("right 5") PORT_CODE(KEYCODE_T) PORT_CONDITION("CONTROLLERS", 0x0f, EQUALS, 0x03) |
| 2295 | | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("right 6") PORT_CODE(KEYCODE_Y) PORT_CONDITION("CONTROLLERS", 0x0f, EQUALS, 0x03) |
| 2296 | | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("right 7") PORT_CODE(KEYCODE_F) PORT_CONDITION("CONTROLLERS", 0x0f, EQUALS, 0x03) |
| 2297 | | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("right 8") PORT_CODE(KEYCODE_G) PORT_CONDITION("CONTROLLERS", 0x0f, EQUALS, 0x03) |
| 2298 | | PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("right 9") PORT_CODE(KEYCODE_H) PORT_CONDITION("CONTROLLERS", 0x0f, EQUALS, 0x03) |
| 2299 | | PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("right *") PORT_CODE(KEYCODE_V) PORT_CONDITION("CONTROLLERS", 0x0f, EQUALS, 0x03) |
| 2300 | | PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("right 0") PORT_CODE(KEYCODE_B) PORT_CONDITION("CONTROLLERS", 0x0f, EQUALS, 0x03) |
| 2301 | | PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("right #") PORT_CODE(KEYCODE_N) PORT_CONDITION("CONTROLLERS", 0x0f, EQUALS, 0x03) |
| 2302 | | |
| 2303 | | PORT_START("WHEEL_L") /* left driving controller */ |
| 2304 | | PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_SENSITIVITY(40) PORT_KEYDELTA(5) PORT_PLAYER(1) PORT_CONDITION("CONTROLLERS", 0xf0, EQUALS, 0x20) |
| 2305 | | |
| 2306 | | PORT_START("WHEEL_R") /* right driving controller */ |
| 2307 | | PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_SENSITIVITY(40) PORT_KEYDELTA(5) PORT_PLAYER(2) PORT_CONDITION("CONTROLLERS", 0x0f, EQUALS, 0x02) |
| 2308 | | |
| 2309 | | PORT_START("GUNX_L") /* left light gun X */ |
| 2310 | | // PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_CROSSHAIR( X, 1.0, 0.0, 0 ) PORT_SENSITIVITY(25) PORT_KEYDELTA(15) PORT_PLAYER(1) PORT_CONDITION("CONTROLLERS", 0xf0, EQUALS, 0x40) |
| 2311 | | |
| 2312 | | PORT_START("GUNY_L") /* left light gun Y */ |
| 2313 | | // PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR( Y, 1.0, 0.0, 0 ) PORT_SENSITIVITY(25) PORT_KEYDELTA(15) PORT_PLAYER(1) PORT_CONDITION("CONTROLLERS", 0xf0, EQUALS, 0x40) |
| 2314 | | |
| 2315 | | PORT_START("GUNX_R") /* right light gun X */ |
| 2316 | | // PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_CROSSHAIR( X, 1.0, 0.0, 0 ) PORT_SENSITIVITY(25) PORT_KEYDELTA(15) PORT_PLAYER(2) PORT_CONDITION("CONTROLLERS", 0x0f, EQUALS, 0x04) |
| 2317 | | |
| 2318 | | PORT_START("GUNY_R") /* right light gun Y */ |
| 2319 | | // PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR( Y, 1.0, 0.0, 0 ) PORT_SENSITIVITY(25) PORT_KEYDELTA(15) PORT_PLAYER(2) PORT_CONDITION("CONTROLLERS", 0x0f, EQUALS, 0x04) |
| 2320 | | |
| 2321 | | PORT_START("TRAKX_L") /* left trak ball X */ |
| 2322 | | PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_SENSITIVITY(40) PORT_KEYDELTA(5) PORT_PLAYER(1) PORT_CONDITION("CONTROLLERS", 0xf0, EQUALS, 0x50) |
| 2323 | | |
| 2324 | | PORT_START("TRAKY_L") /* left trak ball Y */ |
| 2325 | | PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(40) PORT_KEYDELTA(5) PORT_PLAYER(1) PORT_CONDITION("CONTROLLERS", 0xf0, EQUALS, 0x50) |
| 2326 | | |
| 2327 | | PORT_START("TRAKX_R") /* right trak ball X */ |
| 2328 | | PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_SENSITIVITY(40) PORT_KEYDELTA(5) PORT_PLAYER(2) PORT_CONDITION("CONTROLLERS", 0x0f, EQUALS, 0x05) |
| 2329 | | |
| 2330 | | PORT_START("TRAKY_R") /* right trak ball Y */ |
| 2331 | | PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(40) PORT_KEYDELTA(5) PORT_PLAYER(2) PORT_CONDITION("CONTROLLERS", 0x0f, EQUALS, 0x05) |
| 2332 | | |
| 2333 | 1924 | INPUT_PORTS_END |
| 2334 | 1925 | |
| 2335 | 1926 | |
| r18679 | r18680 | |
| 2382 | 1973 | /* devices */ |
| 2383 | 1974 | MCFG_RIOT6532_ADD("riot", MASTER_CLOCK_NTSC / 3, r6532_interface) |
| 2384 | 1975 | |
| 2385 | | // MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, NULL, NULL) |
| 2386 | | // MCFG_VCS_CONTROL_PORT_ADD(CONTROL2_TAG, vcs_control_port_devices, NULL, NULL) |
| 1976 | MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, "joy", NULL) |
| 1977 | MCFG_VCS_CONTROL_PORT_ADD(CONTROL2_TAG, vcs_control_port_devices, NULL, NULL) |
| 2387 | 1978 | |
| 2388 | 1979 | MCFG_FRAGMENT_ADD(a2600_cartslot) |
| 2389 | 1980 | MCFG_SOFTWARE_LIST_FILTER("cart_list", "NTSC") |
| r18679 | r18680 | |
| 2418 | 2009 | /* devices */ |
| 2419 | 2010 | MCFG_RIOT6532_ADD("riot", MASTER_CLOCK_PAL / 3, r6532_interface) |
| 2420 | 2011 | |
| 2421 | | // MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, NULL, NULL) |
| 2422 | | // MCFG_VCS_CONTROL_PORT_ADD(CONTROL2_TAG, vcs_control_port_devices, NULL, NULL) |
| 2012 | MCFG_VCS_CONTROL_PORT_ADD(CONTROL1_TAG, vcs_control_port_devices, "joy", NULL) |
| 2013 | MCFG_VCS_CONTROL_PORT_ADD(CONTROL2_TAG, vcs_control_port_devices, NULL, NULL) |
| 2423 | 2014 | |
| 2424 | 2015 | MCFG_FRAGMENT_ADD(a2600_cartslot) |
| 2425 | 2016 | MCFG_SOFTWARE_LIST_FILTER("cart_list", "PAL") |