trunk/src/mame/drivers/igs017.c
| r31725 | r31726 | |
| 30 | 30 | - Protection emulation, instead of patching the roms. |
| 31 | 31 | - NVRAM. |
| 32 | 32 | - iqblockf: protection. |
| 33 | | - mgcs: implement joystick inputs. Sound banking and DSW go through protection. |
| 33 | - mgcs: implement joystick inputs. Finish IGS029 protection simulation. |
| 34 | 34 | |
| 35 | 35 | Notes: |
| 36 | 36 | |
| r31725 | r31726 | |
| 50 | 50 | #include "sound/okim6295.h" |
| 51 | 51 | #include "machine/igs025.h" |
| 52 | 52 | #include "machine/igs022.h" |
| 53 | #include "machine/ticket.h" |
| 53 | 54 | |
| 54 | 55 | class igs017_state : public driver_device |
| 55 | 56 | { |
| r31725 | r31726 | |
| 62 | 63 | m_fg_videoram(*this, "fg_videoram", 0), |
| 63 | 64 | m_bg_videoram(*this, "bg_videoram", 0), |
| 64 | 65 | m_oki(*this, "oki"), |
| 66 | m_hopperdev(*this, "hopper"), |
| 65 | 67 | m_igs025(*this,"igs025"), |
| 66 | 68 | m_igs022(*this,"igs022"), |
| 67 | 69 | m_gfxdecode(*this, "gfxdecode"), |
| r31725 | r31726 | |
| 77 | 79 | optional_shared_ptr<UINT8> m_fg_videoram; |
| 78 | 80 | optional_shared_ptr<UINT8> m_bg_videoram; |
| 79 | 81 | required_device<okim6295_device> m_oki; |
| 82 | optional_device<ticket_dispenser_device> m_hopperdev; |
| 80 | 83 | optional_device<igs025_device> m_igs025; // Mj Shuang Long Qiang Zhu 2 |
| 81 | 84 | optional_device<igs022_device> m_igs022; // Mj Shuang Long Qiang Zhu 2 |
| 82 | 85 | required_device<gfxdecode_device> m_gfxdecode; |
| r31725 | r31726 | |
| 102 | 105 | UINT16 m_igs_magic[2]; |
| 103 | 106 | UINT8 m_scramble_data; |
| 104 | 107 | int m_irq1_enable; |
| 108 | UINT8 m_dsw_select; |
| 105 | 109 | |
| 106 | 110 | // lhzb2a protection: |
| 107 | 111 | UINT16 m_prot_regs[2], m_prot_val, m_prot_word, m_prot_m3, m_prot_mf; |
| 108 | 112 | UINT8 m_prot2; |
| 109 | 113 | |
| 114 | // IGS029 protection (communication) |
| 115 | UINT8 m_igs029_send_data, m_igs029_recv_data; |
| 116 | UINT8 m_igs029_send_buf[256], m_igs029_recv_buf[256]; |
| 117 | int m_igs029_send_len, m_igs029_recv_len; |
| 118 | // IGS029 protection (mgcs) |
| 119 | UINT32 m_igs029_mgcs_long; |
| 120 | |
| 110 | 121 | int m_irq2_enable; |
| 111 | 122 | DECLARE_WRITE8_MEMBER(video_disable_w); |
| 112 | 123 | DECLARE_WRITE16_MEMBER(video_disable_lsb_w); |
| r31725 | r31726 | |
| 174 | 185 | TILE_GET_INFO_MEMBER(get_fg_tile_info); |
| 175 | 186 | TILE_GET_INFO_MEMBER(get_bg_tile_info); |
| 176 | 187 | virtual void video_start(); |
| 177 | | virtual void video_reset(); |
| 188 | virtual void machine_reset(); |
| 178 | 189 | DECLARE_MACHINE_RESET(iqblocka); |
| 179 | 190 | DECLARE_MACHINE_RESET(mgcs); |
| 180 | 191 | DECLARE_MACHINE_RESET(lhzb2a); |
| r31725 | r31726 | |
| 193 | 204 | void mgcs_decrypt_tiles(); |
| 194 | 205 | void mgcs_flip_sprites(); |
| 195 | 206 | void mgcs_patch_rom(); |
| 207 | void mgcs_igs029_run(); |
| 196 | 208 | void starzan_decrypt(UINT8 *ROM, int size, bool isOpcode); |
| 197 | 209 | void lhzb2_patch_rom(); |
| 198 | 210 | void lhzb2_decrypt_tiles(); |
| r31725 | r31726 | |
| 202 | 214 | void spkrform_decrypt_sprites(); |
| 203 | 215 | }; |
| 204 | 216 | |
| 217 | void igs017_state::machine_reset() |
| 218 | { |
| 219 | m_video_disable = 0; |
| 220 | m_igs029_send_len = m_igs029_recv_len = 0; |
| 221 | } |
| 205 | 222 | |
| 206 | | |
| 207 | 223 | /*************************************************************************** |
| 208 | 224 | Video Hardware |
| 209 | 225 | ***************************************************************************/ |
| r31725 | r31726 | |
| 221 | 237 | video_disable_w(space,offset,data); |
| 222 | 238 | } |
| 223 | 239 | |
| 224 | | void igs017_state::video_reset() |
| 225 | | { |
| 226 | | m_video_disable = 0; |
| 227 | | } |
| 228 | 240 | |
| 229 | | |
| 230 | 241 | #define COLOR(_X) (((_X)>>2)&7) |
| 231 | 242 | |
| 232 | 243 | TILE_GET_INFO_MEMBER(igs017_state::get_fg_tile_info) |
| r31725 | r31726 | |
| 709 | 720 | |
| 710 | 721 | void igs017_state::mgcs_patch_rom() |
| 711 | 722 | { |
| 712 | | UINT16 *rom = (UINT16 *)memregion("maincpu")->base(); |
| 723 | // UINT16 *rom = (UINT16 *)memregion("maincpu")->base(); |
| 713 | 724 | |
| 714 | | rom[0x4e036/2] = 0x6006; |
| 725 | // rom[0x20666/2] = 0x601e; // 020666: 671E beq $20686 (rom check) |
| 715 | 726 | |
| 716 | | // IGS029 reads the dips? |
| 717 | | rom[0x4e00e/2] = 0x4e75; |
| 718 | | |
| 719 | | rom[0x4dfce/2] = 0x6010; // 04DFCE: 6610 bne $4dfe0 |
| 720 | | rom[0x20666/2] = 0x601e; // 020666: 671E beq $20686 (rom check) |
| 727 | // IGS029 send command |
| 728 | // rom[0x4dfce/2] = 0x6010; // 04DFCE: 6610 bne $4dfe0 |
| 729 | // rom[0x4e00e/2] = 0x4e75; |
| 730 | // rom[0x4e036/2] = 0x6006; // 04E036: 6306 bls $4e03e |
| 721 | 731 | } |
| 722 | 732 | |
| 723 | 733 | DRIVER_INIT_MEMBER(igs017_state,mgcs) |
| r31725 | r31726 | |
| 1425 | 1435 | |
| 1426 | 1436 | // mgcs |
| 1427 | 1437 | |
| 1438 | // IGS029 appears to be an MCU that receives commands (write port with value, read port, etc.) |
| 1439 | // Sound banking and DSW are accessed through it. It also performs some game specific calculations. |
| 1440 | void igs017_state::mgcs_igs029_run() |
| 1441 | { |
| 1442 | logerror("%s: running igs029 command ", machine().describe_context()); |
| 1443 | for (int i = 0; i < m_igs029_send_len; i++) |
| 1444 | logerror("%02x ", m_igs029_send_buf[i]); |
| 1428 | 1445 | |
| 1446 | if (m_igs029_send_buf[0] == 0x05 && m_igs029_send_buf[1] == 0x5a) |
| 1447 | { |
| 1448 | UINT8 data = m_igs029_send_buf[2]; |
| 1449 | UINT8 port = m_igs029_send_buf[3]; |
| 1450 | |
| 1451 | logerror("PORT %02x = %02x\n", port, data); |
| 1452 | |
| 1453 | switch (port) |
| 1454 | { |
| 1455 | case 0x01: |
| 1456 | m_oki->set_bank_base((data & 0x10) ? 0x40000 : 0); |
| 1457 | coin_counter_w(machine(), 0, (~data) & 0x20); // coin in |
| 1458 | coin_counter_w(machine(), 1, (~data) & 0x40); // coin out |
| 1459 | |
| 1460 | // popmessage("PORT1 %02X", data); |
| 1461 | |
| 1462 | if ( data & ~0x70 ) |
| 1463 | logerror("%s: warning, unknown bits written in port %02x = %02x\n", machine().describe_context(), port, data); |
| 1464 | |
| 1465 | break; |
| 1466 | |
| 1467 | case 0x03: |
| 1468 | m_dsw_select = data; |
| 1469 | |
| 1470 | // popmessage("PORT3 %02X", data); |
| 1471 | |
| 1472 | if ( data & ~0x03 ) |
| 1473 | logerror("%s: warning, unknown bits written in port %02x = %02x\n", machine().describe_context(), port, data); |
| 1474 | |
| 1475 | break; |
| 1476 | |
| 1477 | default: |
| 1478 | logerror("%s: warning, unknown port %02x written with %02x\n", machine().describe_context(), port, data); |
| 1479 | } |
| 1480 | |
| 1481 | m_igs029_recv_len = 0; |
| 1482 | m_igs029_recv_buf[m_igs029_recv_len++] = 0x01; |
| 1483 | } |
| 1484 | else if (m_igs029_send_buf[0] == 0x03 && m_igs029_send_buf[1] == 0x55) |
| 1485 | { |
| 1486 | logerror("MIN BET?\n"); |
| 1487 | |
| 1488 | // No inputs. Returns 1 long |
| 1489 | |
| 1490 | UINT8 min_bets[4] = {1, 2, 3, 5}; |
| 1491 | |
| 1492 | m_igs029_recv_len = 0; |
| 1493 | m_igs029_recv_buf[m_igs029_recv_len++] = 0x00; |
| 1494 | m_igs029_recv_buf[m_igs029_recv_len++] = 0x00; |
| 1495 | m_igs029_recv_buf[m_igs029_recv_len++] = 0x00; |
| 1496 | m_igs029_recv_buf[m_igs029_recv_len++] = min_bets[ (~ioport("DSW2")->read()) & 3 ]; |
| 1497 | m_igs029_recv_buf[m_igs029_recv_len++] = 0x05; |
| 1498 | } |
| 1499 | else if (m_igs029_send_buf[0] == 0x03 && m_igs029_send_buf[1] == 0x39) |
| 1500 | { |
| 1501 | logerror("READ DSW\n"); |
| 1502 | |
| 1503 | UINT8 ret; |
| 1504 | if (~m_dsw_select & 0x01) ret = ioport("DSW1")->read(); |
| 1505 | else if (~m_dsw_select & 0x02) ret = ioport("DSW2")->read(); |
| 1506 | else |
| 1507 | { |
| 1508 | logerror("%s: warning, reading dsw with dsw_select = %02x\n", machine().describe_context(), m_dsw_select); |
| 1509 | ret = 0xff; |
| 1510 | } |
| 1511 | |
| 1512 | m_igs029_recv_len = 0; |
| 1513 | m_igs029_recv_buf[m_igs029_recv_len++] = ret; |
| 1514 | m_igs029_recv_buf[m_igs029_recv_len++] = 0x02; |
| 1515 | } |
| 1516 | else if (m_igs029_send_buf[0] == 0x07 && m_igs029_send_buf[1] == 0x2c) |
| 1517 | { |
| 1518 | logerror("?? (2C)\n"); // ?? |
| 1519 | |
| 1520 | // 4 inputs. Returns 1 long |
| 1521 | |
| 1522 | // called when pressing start without betting. |
| 1523 | // Returning high values produces an overflow causing a division by 0, and then the game hangs. |
| 1524 | m_igs029_recv_len = 0; |
| 1525 | m_igs029_recv_buf[m_igs029_recv_len++] = 0x00; |
| 1526 | m_igs029_recv_buf[m_igs029_recv_len++] = 0x00; |
| 1527 | m_igs029_recv_buf[m_igs029_recv_len++] = 0x00; |
| 1528 | m_igs029_recv_buf[m_igs029_recv_len++] = 0x01; // ?? |
| 1529 | m_igs029_recv_buf[m_igs029_recv_len++] = 0x05; |
| 1530 | } |
| 1531 | else if (m_igs029_send_buf[0] == 0x07 && m_igs029_send_buf[1] == 0x15) |
| 1532 | { |
| 1533 | logerror("SET LONG\n"); |
| 1534 | |
| 1535 | m_igs029_mgcs_long = (m_igs029_send_buf[2] << 24) | (m_igs029_send_buf[3] << 16) | (m_igs029_send_buf[4] << 8) | m_igs029_send_buf[5]; |
| 1536 | |
| 1537 | m_igs029_recv_len = 0; |
| 1538 | m_igs029_recv_buf[m_igs029_recv_len++] = 0x01; |
| 1539 | } |
| 1540 | else if (m_igs029_send_buf[0] == 0x03 && m_igs029_send_buf[1] == 0x04) |
| 1541 | { |
| 1542 | logerror("GET LONG\n"); |
| 1543 | |
| 1544 | m_igs029_recv_len = 0; |
| 1545 | m_igs029_recv_buf[m_igs029_recv_len++] = (m_igs029_mgcs_long >> 0) & 0xff; |
| 1546 | m_igs029_recv_buf[m_igs029_recv_len++] = (m_igs029_mgcs_long >> 8) & 0xff; |
| 1547 | m_igs029_recv_buf[m_igs029_recv_len++] = (m_igs029_mgcs_long >> 16) & 0xff; |
| 1548 | m_igs029_recv_buf[m_igs029_recv_len++] = (m_igs029_mgcs_long >> 24) & 0xff; |
| 1549 | m_igs029_recv_buf[m_igs029_recv_len++] = 0x05; |
| 1550 | } |
| 1551 | else |
| 1552 | { |
| 1553 | logerror("UNKNOWN\n"); |
| 1554 | |
| 1555 | m_igs029_recv_len = 0; |
| 1556 | m_igs029_recv_buf[m_igs029_recv_len++] = 0x01; |
| 1557 | } |
| 1558 | |
| 1559 | m_igs029_send_len = 0; |
| 1560 | } |
| 1561 | |
| 1429 | 1562 | WRITE16_MEMBER(igs017_state::mgcs_magic_w) |
| 1430 | 1563 | { |
| 1431 | 1564 | COMBINE_DATA(&m_igs_magic[offset]); |
| r31725 | r31726 | |
| 1438 | 1571 | case 0x00: |
| 1439 | 1572 | if (ACCESSING_BITS_0_7) |
| 1440 | 1573 | { |
| 1574 | bool igs029_irq = !(m_input_select & 0x04) && (data & 0x04); // 0->1 |
| 1575 | |
| 1576 | // 7654 3--- Keys |
| 1577 | // ---- -2-- IRQ on IGS029 |
| 1578 | // ---- --1- |
| 1579 | // ---- ---0 Hopper Motor |
| 1441 | 1580 | m_input_select = data & 0xff; |
| 1581 | |
| 1582 | m_hopperdev->write(space, 0, (data & 0x0001) ? 0x80 : 0x00); |
| 1583 | |
| 1584 | if (igs029_irq) |
| 1585 | { |
| 1586 | if (!m_igs029_recv_len) |
| 1587 | { |
| 1588 | // SEND |
| 1589 | if (m_igs029_send_len < sizeof(m_igs029_send_buf)) |
| 1590 | m_igs029_send_buf[m_igs029_send_len++] = m_igs029_send_data; |
| 1591 | |
| 1592 | logerror("%s: igs029 send ", machine().describe_context()); |
| 1593 | for (int i = 0; i < m_igs029_send_len; i++) |
| 1594 | logerror("%02x ", m_igs029_send_buf[i]); |
| 1595 | logerror("\n"); |
| 1596 | |
| 1597 | if (m_igs029_send_buf[0] == m_igs029_send_len) |
| 1598 | mgcs_igs029_run(); |
| 1599 | } |
| 1600 | |
| 1601 | if (m_igs029_recv_len) |
| 1602 | { |
| 1603 | // RECV |
| 1604 | logerror("%s: igs029 recv ", machine().describe_context()); |
| 1605 | for (int i = 0; i < m_igs029_recv_len; i++) |
| 1606 | logerror("%02x ", m_igs029_recv_buf[i]); |
| 1607 | logerror("\n"); |
| 1608 | |
| 1609 | if (m_igs029_recv_len) |
| 1610 | --m_igs029_recv_len; |
| 1611 | |
| 1612 | m_igs029_recv_data = m_igs029_recv_buf[m_igs029_recv_len]; |
| 1613 | } |
| 1614 | } |
| 1442 | 1615 | } |
| 1443 | 1616 | |
| 1444 | | if ( m_input_select & ~0xf8 ) |
| 1617 | if ( m_input_select & ~0xfd ) |
| 1445 | 1618 | logerror("%s: warning, unknown bits written in input_select = %02x\n", machine().describe_context(), m_input_select); |
| 1619 | |
| 1446 | 1620 | break; |
| 1447 | 1621 | |
| 1448 | 1622 | case 0x01: |
| 1449 | 1623 | if (ACCESSING_BITS_0_7) |
| 1450 | 1624 | { |
| 1451 | 1625 | m_scramble_data = data & 0xff; |
| 1626 | // logerror("%s: writing %02x to igs_magic = %02x\n", machine().describe_context(), data & 0xff, m_igs_magic[0]); |
| 1452 | 1627 | } |
| 1453 | 1628 | break; |
| 1454 | 1629 | |
| 1455 | 1630 | // case 0x02: ? |
| 1456 | | // case 0x03: ? |
| 1457 | 1631 | |
| 1632 | case 0x03: |
| 1633 | if (ACCESSING_BITS_0_7) |
| 1634 | { |
| 1635 | m_igs029_send_data = data & 0xff; |
| 1636 | // logerror("%s: writing %02x to igs_magic = %02x\n", machine().describe_context(), data & 0xff, m_igs_magic[0]); |
| 1637 | } |
| 1638 | break; |
| 1639 | |
| 1458 | 1640 | default: |
| 1459 | 1641 | logerror("%s: warning, writing to igs_magic %02x = %02x\n", machine().describe_context(), m_igs_magic[0], data); |
| 1460 | 1642 | } |
| r31725 | r31726 | |
| 1462 | 1644 | |
| 1463 | 1645 | READ16_MEMBER(igs017_state::mgcs_magic_r) |
| 1464 | 1646 | { |
| 1647 | if (offset == 0) |
| 1648 | return m_igs_magic[0]; |
| 1649 | |
| 1465 | 1650 | switch(m_igs_magic[0]) |
| 1466 | 1651 | { |
| 1652 | case 0x00: |
| 1653 | return m_input_select | 0x02; |
| 1654 | |
| 1467 | 1655 | case 0x01: |
| 1468 | | return BITSWAP8(m_scramble_data, 4,5,6,7, 0,1,2,3); |
| 1656 | { |
| 1657 | UINT16 ret = BITSWAP8( (BITSWAP8(m_scramble_data, 0,1,2,3,4,5,6,7) + 1) & 3, 4,5,6,7, 0,1,2,3); |
| 1658 | logerror("%s: reading %02x from igs_magic = %02x\n", machine().describe_context(), ret, m_igs_magic[0]); |
| 1659 | return ret; |
| 1660 | } |
| 1469 | 1661 | |
| 1662 | case 0x02: |
| 1663 | { |
| 1664 | UINT8 ret = m_igs029_recv_data; |
| 1665 | logerror("%s: reading %02x from igs_magic = %02x\n", machine().describe_context(), ret, m_igs_magic[0]); |
| 1666 | return ret; |
| 1667 | } |
| 1668 | |
| 1669 | // case 0x05: ??? |
| 1670 | |
| 1470 | 1671 | default: |
| 1471 | 1672 | logerror("%s: warning, reading with igs_magic = %02x\n", machine().describe_context(), m_igs_magic[0]); |
| 1472 | 1673 | break; |
| r31725 | r31726 | |
| 1520 | 1721 | static ADDRESS_MAP_START( mgcs, AS_PROGRAM, 16, igs017_state ) |
| 1521 | 1722 | AM_RANGE( 0x000000, 0x07ffff ) AM_ROM |
| 1522 | 1723 | AM_RANGE( 0x300000, 0x303fff ) AM_RAM |
| 1523 | | AM_RANGE( 0x49c000, 0x49c003 ) AM_WRITE(mgcs_magic_w ) |
| 1524 | | AM_RANGE( 0x49c002, 0x49c003 ) AM_READ(mgcs_magic_r ) |
| 1724 | AM_RANGE( 0x49c000, 0x49c003 ) AM_WRITE(mgcs_magic_w ) AM_READ(mgcs_magic_r ) |
| 1525 | 1725 | AM_RANGE( 0xa02000, 0xa02fff ) AM_READWRITE(spriteram_lsb_r, spriteram_lsb_w ) AM_SHARE("spriteram") |
| 1526 | 1726 | AM_RANGE( 0xa03000, 0xa037ff ) AM_RAM_WRITE(mgcs_paletteram_w ) AM_SHARE("paletteram") |
| 1527 | 1727 | AM_RANGE( 0xa04020, 0xa04027 ) AM_DEVREAD8("ppi8255", i8255_device, read, 0x00ff) |
| 1528 | 1728 | AM_RANGE( 0xa04024, 0xa04025 ) AM_WRITE(video_disable_lsb_w ) |
| 1529 | | AM_RANGE( 0xa04028, 0xa04029 ) AM_WRITE(irq2_enable_w ) |
| 1530 | | AM_RANGE( 0xa0402a, 0xa0402b ) AM_WRITE(irq1_enable_w ) |
| 1729 | AM_RANGE( 0xa04028, 0xa04029 ) AM_RAM_WRITE(irq2_enable_w ) |
| 1730 | AM_RANGE( 0xa0402a, 0xa0402b ) AM_RAM_WRITE(irq1_enable_w ) |
| 1531 | 1731 | AM_RANGE( 0xa08000, 0xa0bfff ) AM_READWRITE(fg_lsb_r, fg_lsb_w ) AM_SHARE("fg_videoram") |
| 1532 | 1732 | AM_RANGE( 0xa0c000, 0xa0ffff ) AM_READWRITE(bg_lsb_r, bg_lsb_w ) AM_SHARE("bg_videoram") |
| 1533 | 1733 | AM_RANGE( 0xa12000, 0xa12001 ) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff ) |
| r31725 | r31726 | |
| 2747 | 2947 | |
| 2748 | 2948 | static INPUT_PORTS_START( mgcs ) |
| 2749 | 2949 | |
| 2750 | | // DSWs don't work: they are read through a protection device (IGS029? see code at 1CF16) |
| 2950 | // DSWs are read through a protection device (IGS029). See code at 1CF16 |
| 2751 | 2951 | |
| 2752 | | PORT_START("DSW1") |
| 2952 | PORT_START("DSW1") // $3009e2 |
| 2753 | 2953 | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ) ) |
| 2754 | 2954 | PORT_DIPSETTING( 0x03, DEF_STR( 1C_1C ) ) |
| 2755 | 2955 | PORT_DIPSETTING( 0x02, DEF_STR( 1C_2C ) ) |
| 2756 | 2956 | PORT_DIPSETTING( 0x01, DEF_STR( 1C_3C ) ) |
| 2757 | | PORT_DIPSETTING( 0x00, DEF_STR( 1C_4C ) ) |
| 2957 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_5C ) ) |
| 2758 | 2958 | PORT_DIPNAME( 0x0c, 0x0c, "Credits Per Note" ) |
| 2759 | 2959 | PORT_DIPSETTING( 0x0c, "10" ) |
| 2760 | 2960 | PORT_DIPSETTING( 0x08, "20" ) |
| r31725 | r31726 | |
| 2773 | 2973 | PORT_DIPSETTING( 0x80, "1000" ) |
| 2774 | 2974 | PORT_DIPSETTING( 0x00, "2000" ) |
| 2775 | 2975 | |
| 2776 | | PORT_START("DSW2") |
| 2976 | PORT_START("DSW2") // $3009e3 |
| 2777 | 2977 | PORT_DIPNAME( 0x03, 0x03, "Min Bet" ) |
| 2778 | 2978 | PORT_DIPSETTING( 0x03, "1" ) |
| 2779 | 2979 | PORT_DIPSETTING( 0x02, "2" ) |
| r31725 | r31726 | |
| 2782 | 2982 | PORT_DIPNAME( 0x04, 0x04, "Double Up" ) |
| 2783 | 2983 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 2784 | 2984 | PORT_DIPSETTING( 0x04, DEF_STR( On ) ) |
| 2785 | | PORT_DIPNAME( 0x10, 0x10, "Double Up Type" ) |
| 2786 | | PORT_DIPSETTING( 0x10, "Double" ) |
| 2787 | | PORT_DIPSETTING( 0x00, DEF_STR( Single ) ) |
| 2788 | | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Controls ) ) |
| 2789 | | PORT_DIPSETTING( 0x20, "Keyboard" ) |
| 2985 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Controls ) ) |
| 2986 | PORT_DIPSETTING( 0x10, "Keyboard" ) |
| 2790 | 2987 | PORT_DIPSETTING( 0x00, DEF_STR( Joystick ) ) |
| 2791 | | PORT_DIPNAME( 0x40, 0x40, "Number Type" ) |
| 2792 | | PORT_DIPSETTING( 0x40, "Number" ) |
| 2988 | PORT_DIPNAME( 0x20, 0x20, "Number Type" ) |
| 2989 | PORT_DIPSETTING( 0x20, "Number" ) |
| 2793 | 2990 | PORT_DIPSETTING( 0x00, "Tile" ) |
| 2991 | PORT_DIPNAME( 0x40, 0x40, "Double Up Type" ) |
| 2992 | PORT_DIPSETTING( 0x40, "Double" ) |
| 2993 | PORT_DIPSETTING( 0x00, DEF_STR( Single ) ) |
| 2794 | 2994 | PORT_DIPNAME( 0x80, 0x80, "Bet Number" ) |
| 2795 | 2995 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 2796 | 2996 | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) |
| r31725 | r31726 | |
| 2798 | 2998 | // the top 2 bits of COINS (port A) and KEYx (port B) are read and combined with the bottom 4 bits read from port C (see code at 1C83A) |
| 2799 | 2999 | |
| 2800 | 3000 | PORT_START("COINS") |
| 2801 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE2 ) // hopper switch (unimplemented) |
| 3001 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) // hopper switch |
| 2802 | 3002 | PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_LOW ) // service mode (keep pressed during boot too) |
| 2803 | 3003 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Statistics") // press with the above for sound test |
| 2804 | 3004 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5) |
| r31725 | r31726 | |
| 3006 | 3206 | PORT_DIPNAME( 0x20, 0x20, "Pay Out Type" ) |
| 3007 | 3207 | PORT_DIPSETTING( 0x20, "Coins" ) |
| 3008 | 3208 | PORT_DIPSETTING( 0x00, "Notes" ) |
| 3009 | | PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Unknown ) ) |
| 3209 | PORT_DIPNAME( 0xc0, 0xc0, "Min Bet" ) |
| 3010 | 3210 | PORT_DIPSETTING( 0xc0, "1" ) |
| 3011 | 3211 | PORT_DIPSETTING( 0x80, "2" ) |
| 3012 | 3212 | PORT_DIPSETTING( 0x40, "3" ) |
| r31725 | r31726 | |
| 3541 | 3741 | MCFG_I8255_IN_PORTA_CB(IOPORT("COINS")) |
| 3542 | 3742 | MCFG_I8255_IN_PORTB_CB(READ8(igs017_state, mgcs_keys_r)) |
| 3543 | 3743 | |
| 3744 | MCFG_TICKET_DISPENSER_ADD("hopper", attotime::from_msec(50), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW ) |
| 3745 | |
| 3544 | 3746 | /* video hardware */ |
| 3545 | 3747 | MCFG_SCREEN_ADD("screen", RASTER) |
| 3546 | 3748 | MCFG_SCREEN_REFRESH_RATE(60) |