From 573695d0a0dc106982dba0dbbe0320e615d9eec8 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Sat, 14 Sep 2024 04:21:00 +1000 Subject: -igs: More improvements for IGS 027A-based gambling systems. * igs/igs027a.cpp: Added output port, and flagged as having imperfect timing as confidence in timers is still low. * igs/igs_m027xa.cpp: Added outputs, second coin slot and clickable layout for crzybugs. * igs/igs_m027.cpp: Added enough inputs to chessc2 to make the game playable. -igs/igs_m027.cpp: Added notes about Oki sample ROM contents, fixed extadrw graphics loading and decoding, and corrected years for mgzza and extradrw. [David Haywood] --- src/mame/igs/igs027a.cpp | 22 +++- src/mame/igs/igs027a.h | 5 + src/mame/igs/igs_m027.cpp | 301 ++++++++++++++++++++++++------------------- src/mame/igs/igs_m027xa.cpp | 97 ++++++++++---- src/mame/layout/crzybugs.lay | 209 ++++++++++++++++++++++++++++++ src/mame/layout/jking02.lay | 24 ++-- src/mame/layout/oceanpar.lay | 24 ++-- 7 files changed, 504 insertions(+), 178 deletions(-) create mode 100644 src/mame/layout/crzybugs.lay diff --git a/src/mame/igs/igs027a.cpp b/src/mame/igs/igs027a.cpp index a1d7d8bcf27..9ac70f20648 100644 --- a/src/mame/igs/igs027a.cpp +++ b/src/mame/igs/igs027a.cpp @@ -7,6 +7,14 @@ #include "cpu/arm7/arm7core.h" +namespace { + +constexpr u32 IN_PORT_MASK = 0x000f'ffff; // 20-bit input port +constexpr u8 OUT_PORT_MASK = 0x1f; // 5-bit output port + +} // anonymous namespace + + DEFINE_DEVICE_TYPE(IGS027A, igs027a_cpu_device, "igs027a", "IGS 027A ARM CPU (little)") @@ -21,6 +29,7 @@ igs027a_cpu_device::igs027a_cpu_device(machine_config const &mconfig, char const ARCHFLAG_T, ENDIANNESS_LITTLE, address_map_constructor(FUNC(igs027a_cpu_device::onboard_peripherals), this)), + m_in_port_cb(*this, IN_PORT_MASK), m_out_port_cb(*this), m_irq_timers{ nullptr, nullptr }, m_irq_enable(0xff), @@ -67,6 +76,7 @@ void igs027a_cpu_device::onboard_peripherals(address_map &map) { map(0x0000'0000, 0x0000'3fff).rom().region(DEVICE_SELF, 0); + map(0x4000'000c, 0x4000'000f).r(FUNC(igs027a_cpu_device::in_port_r)); map(0x4000'0018, 0x4000'001b).umask32(0x0000'00ff).w(FUNC(igs027a_cpu_device::out_port_w)); map(0x7000'0100, 0x7000'0103).umask32(0x0000'00ff).w(FUNC(igs027a_cpu_device::timer_rate_w<0>)); @@ -77,10 +87,18 @@ void igs027a_cpu_device::onboard_peripherals(address_map &map) } +u32 igs027a_cpu_device::in_port_r() +{ + return + 0xff80'0000 | // unused bits? + ((m_in_port_cb(0, IN_PORT_MASK) & IN_PORT_MASK) << 3) | // 20-bit input port + 0x0000'0007; // TODO: FIRQ, IRQ and UART Rx pins +} + void igs027a_cpu_device::out_port_w(u8 data) { // 5-bit output port - m_out_port_cb(0, data & 0x1f, 0x1f); + m_out_port_cb(0, data & OUT_PORT_MASK, OUT_PORT_MASK); } template @@ -90,7 +108,7 @@ void igs027a_cpu_device::timer_rate_w(u8 data) if (data) { constexpr u32 TIMER_DIVISOR = 4263; - auto period = attotime::from_ticks(TIMER_DIVISOR * (data + 1), clock()); + auto const period = attotime::from_ticks(TIMER_DIVISOR * (data + 1), clock()); m_irq_timers[N]->adjust(period, 0, period); } else diff --git a/src/mame/igs/igs027a.h b/src/mame/igs/igs027a.h index a2a6ddb24ab..95aafe7dd9e 100644 --- a/src/mame/igs/igs027a.h +++ b/src/mame/igs/igs027a.h @@ -14,6 +14,9 @@ public: igs027a_cpu_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock); virtual ~igs027a_cpu_device(); + static constexpr feature_type imperfect_features() { return feature::TIMING; } + + auto in_port() { return m_in_port_cb.bind(); } auto out_port() { return m_out_port_cb.bind(); } void trigger_irq(unsigned num); @@ -25,6 +28,7 @@ protected: private: void onboard_peripherals(address_map &map) ATTR_COLD; + u32 in_port_r(); void out_port_w(u8 data); template void timer_rate_w(u8 data); u8 irq_pending_r(); @@ -34,6 +38,7 @@ private: template TIMER_CALLBACK_MEMBER(timer_irq); + devcb_read32 m_in_port_cb; devcb_write8 m_out_port_cb; emu_timer *m_irq_timers[2]; diff --git a/src/mame/igs/igs_m027.cpp b/src/mame/igs/igs_m027.cpp index e69e10884e4..34059427c2a 100644 --- a/src/mame/igs/igs_m027.cpp +++ b/src/mame/igs/igs_m027.cpp @@ -87,6 +87,7 @@ public: void mgzz_xor(machine_config &config) ATTR_COLD; void oceanpar_xor(machine_config &config) ATTR_COLD; void extradraw(machine_config &config) ATTR_COLD; + void chessc2_xor(machine_config &config) ATTR_COLD; void init_sdwx() ATTR_COLD; void init_chessc2() ATTR_COLD; @@ -149,8 +150,8 @@ private: void jking02_output_w(u8 data); void oceanpar_output_w(u8 data); - u32 unk2_r(); - u32 lhdmg_unk2_r(); + u32 slqz3_gpio_r(); + u32 lhdmg_gpio_r(); void unk2_w(u32 data); TIMER_DEVICE_CALLBACK_MEMBER(interrupt); @@ -159,8 +160,6 @@ private: void igs_mahjong_map(address_map &map) ATTR_COLD; void igs_mahjong_xor_map(address_map &map) ATTR_COLD; - void lhdmg_xor_map(address_map &map) ATTR_COLD; - void jking02_xor_map(address_map &map) ATTR_COLD; void extradraw_map(address_map &map) ATTR_COLD; }; @@ -212,20 +211,6 @@ void igs_m027_state::igs_mahjong_xor_map(address_map &map) map(0x08000000, 0x0807ffff).r(FUNC(igs_m027_state::external_rom_r)); // Game ROM } -void igs_m027_state::lhdmg_xor_map(address_map &map) -{ - igs_mahjong_xor_map(map); - - map(0x4000000c, 0x4000000f).r(FUNC(igs_m027_state::lhdmg_unk2_r)); -} - -void igs_m027_state::jking02_xor_map(address_map &map) -{ - igs_mahjong_xor_map(map); - - map(0x4000000c, 0x4000000f).portr("PLAYER"); -} - void igs_m027_state::extradraw_map(address_map &map) { igs_mahjong_map(map); @@ -376,20 +361,19 @@ INPUT_PORTS_START( three_reel ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("PLAYER") - PORT_BIT( 0x00000007, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_COIN1 ) // COINA - PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_START1 ) - PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_SLOT_STOP_ALL ) PORT_NAME("Stop All Reels / Big") - PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_SLOT_STOP1 ) PORT_NAME("Stop Reel 1 / Double Up") - PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_SLOT_STOP2 ) PORT_NAME("Stop Reel 2 / Small") - PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_SLOT_STOP3 ) PORT_NAME("Stop Reel 3 / Take Score") - PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_GAMBLE_BET ) PORT_NAME("Play") - PORT_BIT( 0x00003800, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x00004000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Ticket") // TICKET - PORT_BIT( 0x00008000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("ticket", ticket_dispenser_device, line_r) // TKSW - PORT_BIT( 0x00010000, IP_ACTIVE_LOW, IPT_COIN2 ) // COINC - PORT_BIT( 0xfffe0000, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x00001, IP_ACTIVE_LOW, IPT_COIN1 ) // COINA + PORT_BIT( 0x00002, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x00004, IP_ACTIVE_LOW, IPT_START1 ) + PORT_BIT( 0x00008, IP_ACTIVE_LOW, IPT_SLOT_STOP_ALL ) PORT_NAME("Stop All Reels / Big") + PORT_BIT( 0x00010, IP_ACTIVE_LOW, IPT_SLOT_STOP1 ) PORT_NAME("Stop Reel 1 / Double Up") + PORT_BIT( 0x00020, IP_ACTIVE_LOW, IPT_SLOT_STOP2 ) PORT_NAME("Stop Reel 2 / Small") + PORT_BIT( 0x00040, IP_ACTIVE_LOW, IPT_SLOT_STOP3 ) PORT_NAME("Stop Reel 3 / Take Score") + PORT_BIT( 0x00080, IP_ACTIVE_LOW, IPT_GAMBLE_BET ) PORT_NAME("Play") + PORT_BIT( 0x00700, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x00800, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Ticket") // TICKET + PORT_BIT( 0x01000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("ticket", ticket_dispenser_device, line_r) // TKSW + PORT_BIT( 0x02000, IP_ACTIVE_LOW, IPT_COIN2 ) // COINC + PORT_BIT( 0xf0000, IP_ACTIVE_LOW, IPT_UNKNOWN ) INPUT_PORTS_END INPUT_PORTS_START( slqz3_dip_switches ) @@ -555,20 +539,19 @@ INPUT_PORTS_START( jking02 ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SLOT_STOP1 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) PORT_NAME("Stop Reel 1 / Take Score") PORT_START("PLAYER") - PORT_BIT( 0x00000007, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) - PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) - PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_SLOT_STOP4 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) PORT_NAME("Stop Reel 4 / Start") - PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_SLOT_STOP_ALL ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) PORT_NAME("Stop All Reels / Big") - PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_SLOT_STOP2 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) PORT_NAME("Stop Reel 2 / Double Up") - PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_SLOT_STOP3 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) PORT_NAME("Stop Reel 3 / Small") - PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_SLOT_STOP1 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) PORT_NAME("Stop Reel 1 / Take Score") - PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_GAMBLE_BET ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) PORT_NAME("Play") - PORT_BIT( 0x000007f8, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) - PORT_BIT( 0x0007f800, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x00080000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) - PORT_BIT( 0x00080000, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) - PORT_BIT( 0xfff00000, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x00001, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0x00002, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0x00004, IP_ACTIVE_LOW, IPT_SLOT_STOP4 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) PORT_NAME("Stop Reel 4 / Start") + PORT_BIT( 0x00008, IP_ACTIVE_LOW, IPT_SLOT_STOP_ALL ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) PORT_NAME("Stop All Reels / Big") + PORT_BIT( 0x00010, IP_ACTIVE_LOW, IPT_SLOT_STOP2 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) PORT_NAME("Stop Reel 2 / Double Up") + PORT_BIT( 0x00020, IP_ACTIVE_LOW, IPT_SLOT_STOP3 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) PORT_NAME("Stop Reel 3 / Small") + PORT_BIT( 0x00040, IP_ACTIVE_LOW, IPT_SLOT_STOP1 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) PORT_NAME("Stop Reel 1 / Take Score") + PORT_BIT( 0x00080, IP_ACTIVE_LOW, IPT_GAMBLE_BET ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) PORT_NAME("Play") + PORT_BIT( 0x000ff, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) + PORT_BIT( 0x0ff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x10000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0x10000, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) + PORT_BIT( 0xe0000, IP_ACTIVE_LOW, IPT_UNKNOWN ) INPUT_PORTS_END INPUT_PORTS_START( slqz3 ) @@ -619,15 +602,14 @@ INPUT_PORTS_START( qlgs ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) // 右 PORT_START("PLAYER") - PORT_BIT( 0x00000007, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x000001f8, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(igs_m027_state, kbd_ioport_r) - PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_TILT ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) PORT_NAME("Hopper Switch") // 哈巴 - PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) - PORT_BIT( 0x0007fc00, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x00080000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) - PORT_BIT( 0x00080000, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) PORT_NAME("Clear") // 清除 - PORT_BIT( 0x00100000, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) // 退幣 - PORT_BIT( 0xffe00000, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0003f, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(igs_m027_state, kbd_ioport_r) + PORT_BIT( 0x00040, IP_ACTIVE_LOW, IPT_TILT ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) PORT_NAME("Hopper Switch") // 哈巴 + PORT_BIT( 0x00040, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) + PORT_BIT( 0x0ff80, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x10000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0x10000, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) PORT_NAME("Clear") // 清除 + PORT_BIT( 0x20000, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) // 退幣 + PORT_BIT( 0xc0000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("DSW1") PORT_DIPNAME( 0x1f, 0x1f, "Satellite Machine No." ) PORT_DIPLOCATION("SW1:1,2,3,4,5") // 副機编號 @@ -709,37 +691,36 @@ INPUT_PORTS_START( lhzb4 ) PORT_START("TEST") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) // 下 - PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW ) // 测试 - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) // 查帐 - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x01 ) // 投币 - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x00 ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) // 上 - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) // 左 + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) // 下 + PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW ) // 测试 + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) // 查帐 + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x01) // 投币 + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x00) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) // 上 + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) // 左 PORT_START("JOY") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 ) // S3 + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 ) // S3 PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) // S2 - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) // S1 - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 ) // 开始 - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x01 ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // HP - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x01 ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x00 ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x00 ) // 投币 - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) // 右 + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) // S2 + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) // S1 + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 ) // 开始 + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x01) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // HP + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x01) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x00) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x00) // 投币 + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) // 右 PORT_START("PLAYER") - PORT_BIT( 0x00000007, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x000001f8, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(igs_m027_state, kbd_ioport_r) - PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x01 ) - PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x00 ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // HP - PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x00000800, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) // 开分 - PORT_BIT( 0x0007f000, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x00080000, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) // 退币 - PORT_BIT( 0x00100000, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) // 洗分 - PORT_BIT( 0xffe00000, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0003f, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(igs_m027_state, kbd_ioport_r) + PORT_BIT( 0x00040, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x01) + PORT_BIT( 0x00040, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x00) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // HP + PORT_BIT( 0x00080, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x00100, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) // 开分 + PORT_BIT( 0x0fe00, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x10000, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) // 退币 + PORT_BIT( 0x20000, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) // 洗分 + PORT_BIT( 0xc0000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("PPIB") PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x01) PORT_WRITE_LINE_MEMBER(igs_m027_state, counter_w<2>) // hopper @@ -991,16 +972,15 @@ INPUT_PORTS_START( mgcs3 ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) // 右 PORT_START("PLAYER") - PORT_BIT( 0x00000007, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x000001f8, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(igs_m027_state, kbd_ioport_r) - PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) - PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // HP - PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x00000800, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) // 开分 - PORT_BIT( 0x0007f000, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x00080000, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) // 退币 - PORT_BIT( 0x00100000, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) // 洗分 - PORT_BIT( 0xffe00000, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0003f, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(igs_m027_state, kbd_ioport_r) + PORT_BIT( 0x00040, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0x00040, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // HP + PORT_BIT( 0x00080, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x00100, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) // 开分 + PORT_BIT( 0x0fe00, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x10000, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) // 退币 + PORT_BIT( 0x20000, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) // 洗分 + PORT_BIT( 0xc0000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("PPIB") PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) PORT_WRITE_LINE_MEMBER(igs_m027_state, counter_w<1>) // key-out @@ -1075,16 +1055,15 @@ INPUT_PORTS_START( cjddz ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) // 右 PORT_START("PLAYER") - PORT_BIT( 0x00000007, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x000001f8, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(igs_m027_state, kbd_ioport_r) - PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW1", 0x02, EQUALS, 0x02) - PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CONDITION("DSW1", 0x02, EQUALS, 0x00) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // HPSW. - PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x00000800, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) // 开分 - PORT_BIT( 0x0007f000, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x00080000, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) // 退币 - PORT_BIT( 0x00100000, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) // 洗分 - PORT_BIT( 0xffe00000, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0003f, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(igs_m027_state, kbd_ioport_r) + PORT_BIT( 0x00040, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW1", 0x02, EQUALS, 0x02) + PORT_BIT( 0x00040, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CONDITION("DSW1", 0x02, EQUALS, 0x00) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // HPSW. + PORT_BIT( 0x00080, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x00100, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) // 开分 + PORT_BIT( 0x0fe00, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x10000, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) // 退币 + PORT_BIT( 0x20000, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) // 洗分 + PORT_BIT( 0xc0000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("PPIB") PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_CONDITION("DSW1", 0x02, EQUALS, 0x02) PORT_WRITE_LINE_MEMBER(igs_m027_state, counter_w<1>) // key-out @@ -1216,6 +1195,62 @@ INPUT_PORTS_START( fruitpara ) PORT_DIPSETTING( 0x00, DEF_STR(Yes) ) INPUT_PORTS_END +INPUT_PORTS_START( chessc2 ) + // preliminary - game seems to lack an input test and settings are locked out with password + + PORT_START("PORTB") + PORT_BIT( 0x07, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) + PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + PORT_START("PORTC") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) + PORT_BIT( 0x3e, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + PORT_START("PLAYER") + PORT_BIT( 0x00001, IP_ACTIVE_LOW, IPT_COIN1 ) + PORT_BIT( 0x00002, IP_ACTIVE_LOW, IPT_COIN2 ) + PORT_BIT( 0x00004, IP_ACTIVE_LOW, IPT_START1 ) + PORT_BIT( 0x00008, IP_ACTIVE_LOW, IPT_SLOT_STOP4 ) + PORT_BIT( 0x00010, IP_ACTIVE_LOW, IPT_SLOT_STOP2 ) + PORT_BIT( 0x00020, IP_ACTIVE_LOW, IPT_SLOT_STOP3 ) + PORT_BIT( 0x00040, IP_ACTIVE_LOW, IPT_SLOT_STOP1 ) + PORT_BIT( 0x00080, IP_ACTIVE_LOW, IPT_GAMBLE_BET ) PORT_NAME("Play") + PORT_BIT( 0xfff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + PORT_START("DSW1") + PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x01, "SW1:1" ) + PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x02, "SW1:2" ) + PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x04, "SW1:3" ) + PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x08, "SW1:4" ) + PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "SW1:5" ) + PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "SW1:6" ) + PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "SW1:7" ) + PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "SW1:8" ) + + PORT_START("DSW2") + PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x01, "SW2:1" ) + PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x02, "SW2:2" ) + PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x04, "SW2:3" ) + PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x08, "SW2:4" ) + PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "SW2:5" ) + PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "SW2:6" ) + PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "SW2:7" ) + PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "SW2:8" ) + + PORT_START("DSW3") + PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x01, "SW3:1" ) + PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x02, "SW3:2" ) + PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x04, "SW3:3" ) + PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x08, "SW3:4" ) + PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "SW3:5" ) + PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "SW3:6" ) + PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "SW3:7" ) + PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "SW3:8" ) +INPUT_PORTS_END + INPUT_PORTS_START( amazonia ) PORT_INCLUDE(base) @@ -1404,25 +1439,25 @@ void igs_m027_state::oceanpar_output_w(u8 data) m_hopper->motor_w(BIT(data, 7)); } -u32 igs_m027_state::unk2_r() +u32 igs_m027_state::slqz3_gpio_r() { - logerror("%s: unk2_r\n", machine().describe_context()); + logerror("%s: slqz3_gpio_r\n", machine().describe_context()); // slqz3 boot check if (m_unk2_write_count & 1) - return 0xffffffff; + return 0xfffff; else - return 0xffffffef; + return 0xffffd; } -u32 igs_m027_state::lhdmg_unk2_r() +u32 igs_m027_state::lhdmg_gpio_r() { - logerror("%s: lhdmg_unk2_r\n", machine().describe_context()); + logerror("%s: lhdmg_gpio_r\n", machine().describe_context()); if (m_io_select[1] & 1) - return 0xffffffff; + return 0xfffff; else - return 0xffffffff ^ 0x400000; + return 0xfffff ^ 0x80000; } void igs_m027_state::unk2_w(u32 data) @@ -1489,6 +1524,8 @@ void igs_m027_state::slqz3_xor(machine_config &config) { m027_xor(config); + m_maincpu->in_port().set(FUNC(igs_m027_state::slqz3_gpio_r)); // what lives here? + m_ppi->in_pa_callback().set_ioport("TEST"); m_ppi->in_pb_callback().set_ioport("JOY"); m_ppi->out_pc_callback().set(FUNC(igs_m027_state::mahjong_output_w)); @@ -1504,7 +1541,7 @@ void igs_m027_state::qlgs_xor(machine_config &config) { m027_xor(config); - m_maincpu->set_addrmap(AS_PROGRAM, &igs_m027_state::jking02_xor_map); + m_maincpu->in_port().set_ioport("PLAYER"); m_maincpu->out_port().append(m_oki, FUNC(okim6295_device::set_rom_bank)).rshift(3); m_ppi->out_pc_callback().set(FUNC(igs_m027_state::io_select_w<0>)); @@ -1517,7 +1554,7 @@ void igs_m027_state::lhdmg_xor(machine_config &config) { m027_xor(config); - m_maincpu->set_addrmap(AS_PROGRAM, &igs_m027_state::lhdmg_xor_map); + m_maincpu->in_port().set(FUNC(igs_m027_state::lhdmg_gpio_r)); m_ppi->in_pa_callback().set_ioport("TEST"); m_ppi->out_pb_callback().set(FUNC(igs_m027_state::io_select_w<0>)); @@ -1535,7 +1572,7 @@ void igs_m027_state::lhzb4_xor(machine_config &config) { m027_xor(config); - m_maincpu->set_addrmap(AS_PROGRAM, &igs_m027_state::jking02_xor_map); + m_maincpu->in_port().set_ioport("PLAYER"); //m_ppi->out_pa_callback().set(...); m_ppi->out_pb_callback().set_ioport("PPIB"); @@ -1572,7 +1609,7 @@ void igs_m027_state::jking02_xor(machine_config &config) { m027_xor(config); - m_maincpu->set_addrmap(AS_PROGRAM, &igs_m027_state::jking02_xor_map); + m_maincpu->in_port().set_ioport("PLAYER"); m_ppi->out_pa_callback().set(FUNC(igs_m027_state::lamps_w<8>)); m_ppi->out_pb_callback().set(FUNC(igs_m027_state::jking02_output_w)); @@ -1598,7 +1635,7 @@ void igs_m027_state::oceanpar_xor(machine_config &config) { m027_xor(config); - m_maincpu->set_addrmap(AS_PROGRAM, &igs_m027_state::jking02_xor_map); + m_maincpu->in_port().set_ioport("PLAYER"); m_maincpu->out_port().append(m_oki, FUNC(okim6295_device::set_rom_bank)).rshift(3); m_ppi->out_pa_callback().set(m_ticket, FUNC(ticket_dispenser_device::motor_w)).bit(7); @@ -1616,6 +1653,14 @@ void igs_m027_state::extradraw(machine_config &config) m_maincpu->set_addrmap(AS_PROGRAM, &igs_m027_state::extradraw_map); } +void igs_m027_state::chessc2_xor(machine_config &config) +{ + m027_xor(config); + + m_maincpu->in_port().set_ioport("PLAYER"); +} + + /*************************************************************************** ROMs Loading @@ -2430,7 +2475,9 @@ ROM_START( cjddz ) ROM_REGION( 0x400000, "igs017_igs031:sprites", 0 ) ROM_LOAD( "ddz_ani.u28", 0x000000, 0x400000, CRC(72487508) SHA1(9f4bbc858960ddaae403e4a3330b2345f6fd6cb3)) - ROM_REGION( 0x200000, "samples", 0 ) // samples, but not OKI? possibly ICS? + // OKI, sample tables are every 0x20000 starting at 0x40000 + // 00000-1ffff and 20000-3ffff are likely music, always mapped at 20000 for any of the above banks + ROM_REGION( 0x200000, "oki", 0 ) ROM_LOAD( "ddz_sp.u4", 0x00000, 0x200000, CRC(7ef65d95) SHA1(345c587cd449d6d06908e9687480be76b2cb2d28) ) ROM_END @@ -2448,7 +2495,8 @@ ROM_START( lhzb4 ) ROM_REGION( 0x400000, "igs017_igs031:sprites", 0 ) ROM_LOAD( "a05501.u28", 0x000000, 0x400000, CRC(f78b3714) SHA1(c73d8e50b04126bc4f91783384713624ed133ee2) ) - ROM_REGION( 0x200000, "samples", 0 ) // samples, but not OKI? possibly ICS? + // OKI, sample tables are every 0x20000 starting at 0x140000 + ROM_REGION( 0x200000, "oki", 0 ) ROM_LOAD( "w05502.u5", 0x00000, 0x200000, CRC(467f677e) SHA1(63927c0d606176c0e22db89ea3a9777ed702abbd) ) ROM_END @@ -2501,9 +2549,10 @@ ROM_START( extradrw ) // IGS PCB 0326-05-DV-1 ROM_REGION( 0x080000, "igs017_igs031:tilemaps", 0 ) ROM_LOAD( "igs m3001.u4", 0x000000, 0x080000, CRC(d161f8f7) SHA1(4b495197895fd805979c5d5c5a4b7f07a68f4171) ) // label barely readable - ROM_REGION( 0x280000, "igs017_igs031:sprites", 0 ) - ROM_LOAD( "u12", 0x000000, 0x200000, CRC(642247fb) SHA1(69c01c3551551120a3786522b28a80621a0d5082) ) // 1xxxxxxxxxxxxxxxxxxxx = 0xFF, label not readable - ROM_LOAD( "u3", 0x200000, 0x080000, CRC(97227767) SHA1(c6a1916c0df1aceafbd488ecace5794390058c49) ) // FIXED BITS (xxxxxxx0xxxxxxxx), label not readable + ROM_REGION( 0x180000, "igs017_igs031:sprites", 0 ) + ROM_LOAD( "u12", 0x000000, 0x100000, CRC(642247fb) SHA1(69c01c3551551120a3786522b28a80621a0d5082) ) // 1xxxxxxxxxxxxxxxxxxxx = 0xFF, label not readable + ROM_IGNORE(0x100000) + ROM_LOAD( "u3", 0x100000, 0x080000, CRC(97227767) SHA1(c6a1916c0df1aceafbd488ecace5794390058c49) ) // FIXED BITS (xxxxxxx0xxxxxxxx), label not readable ROM_REGION( 0x200000, "oki", 0 ) ROM_LOAD( "igs s3002.u18", 0x00000, 0x200000, CRC(48601c32) SHA1(8ef3bad80931f4b1badf0598463e15508602f104) ) // BADADDR --xxxxxxxxxxxxxxxxxxx @@ -2558,9 +2607,6 @@ void igs_m027_state::init_chessc2() // bypass external ROM checksum u32 *ROM2 = &memregion("maincpu")->as_u32(); ROM2[(0x168/4)] ^= 0x10000000; - - // what lives here? coin error otherwise - m_maincpu->space(AS_PROGRAM).install_read_handler(0x4000000c, 0x4000000f, read32smo_delegate(*this, FUNC(igs_m027_state::lhdmg_unk2_r))); } void igs_m027_state::init_lhzb4() @@ -2594,9 +2640,6 @@ void igs_m027_state::init_slqz3() { slqz3_decrypt(machine()); m_igs017_igs031->set_text_reverse_bits(false); - - // what lives here? - m_maincpu->space(AS_PROGRAM).install_read_handler(0x4000000c, 0x4000000f, read32smo_delegate(*this, FUNC(igs_m027_state::unk2_r))); } void igs_m027_state::init_fruitpar() @@ -2638,7 +2681,7 @@ void igs_m027_state::init_qlgs() void igs_m027_state::init_extradrw() { extradrw_decrypt(machine()); - m_igs017_igs031->sdwx_gfx_decrypt(); + m_igs017_igs031->set_text_reverse_bits(false); } @@ -2709,16 +2752,16 @@ GAME( 1999, lthy, 0, lthy_xor, lthy, igs_m027_state, init_l GAME( 2000, zhongguo, 0, zhongguo_xor, zhongguo, igs_m027_state, init_zhongguo, ROT0, "IGS", "Zhongguo Chu Da D", MACHINE_NOT_WORKING ) // 中国锄大D GAMEL( 200?, jking02, 0, jking02_xor, jking02, igs_m027_state, init_jking02, ROT0, "IGS", "Jungle King 2002 (V209US)", MACHINE_NOT_WORKING, layout_jking02 ) GAME( 2003, mgzz, 0, mgzz_xor, mgzz, igs_m027_state, init_mgzz, ROT0, "IGS", "Manguan Zhizun (V101CN)", MACHINE_NOT_WORKING ) // 满贯至尊 -GAME( 2000, mgzza, mgzz, mgzz_xor, mgzza, igs_m027_state, init_mgzz, ROT0, "IGS", "Manguan Zhizun (V100CN)", MACHINE_NOT_WORKING ) // 满贯至尊 +GAME( 2003, mgzza, mgzz, mgzz_xor, mgzza, igs_m027_state, init_mgzz, ROT0, "IGS", "Manguan Zhizun (V100CN)", MACHINE_NOT_WORKING ) // 满贯至尊 GAME( 2007, mgcs3, 0, lhzb4_xor, mgcs3, igs_m027_state, init_mgcs3, ROT0, "IGS", "Manguan Caishen 3 (V101CN)", MACHINE_NOT_WORKING ) // 满贯财神3 GAMEL( 1999, oceanpar, 0, oceanpar_xor, oceanpar, igs_m027_state, init_oceanpar, ROT0, "IGS", "Ocean Paradise (V105US)", MACHINE_NOT_WORKING, layout_oceanpar ) // 1999 copyright in ROM GAMEL( 1999, oceanpara, oceanpar, oceanpar_xor, oceanpara,igs_m027_state, init_oceanpar, ROT0, "IGS", "Ocean Paradise (V101US)", MACHINE_NOT_WORKING, layout_oceanpar ) // 1999 copyright in ROM GAMEL( 1999, fruitpar, 0, oceanpar_xor, oceanpar, igs_m027_state, init_fruitpar, ROT0, "IGS", "Fruit Paradise (V214)", MACHINE_NOT_WORKING, layout_oceanpar ) GAMEL( 1999, fruitpara, fruitpar, oceanpar_xor, fruitpara,igs_m027_state, init_fruitpar, ROT0, "IGS", "Fruit Paradise (V206US)", MACHINE_NOT_WORKING, layout_oceanpar ) GAME( 200?, cjddz, 0, lhzb4_xor, cjddz, igs_m027_state, init_cjddz, ROT0, "IGS", "Chaoji Dou Dizhu", MACHINE_NOT_WORKING ) // 超级斗地主 -GAME( 200?, extradrw, 0, extradraw, base, igs_m027_state, init_extradrw, ROT0, "IGS", "Extra Draw", MACHINE_NOT_WORKING ) +GAME( 2001, extradrw, 0, extradraw, base, igs_m027_state, init_extradrw, ROT0, "IGS", "Extra Draw", MACHINE_NOT_WORKING ) // these have an IGS025 protection device instead of the 8255 -GAME( 2002, chessc2, 0, m027_xor, base, igs_m027_state, init_chessc2, ROT0, "IGS", "Chess Challenge II", MACHINE_NOT_WORKING ) +GAME( 2002, chessc2, 0, chessc2_xor, chessc2, igs_m027_state, init_chessc2, ROT0, "IGS", "Chess Challenge II", MACHINE_NOT_WORKING ) // Incomplete dumps GAME( 1999, amazonia, 0, m027, amazonia, igs_m027_state, init_amazonia, ROT0, "IGS", "Amazonia King (V104BR)", MACHINE_NOT_WORKING ) diff --git a/src/mame/igs/igs_m027xa.cpp b/src/mame/igs/igs_m027xa.cpp index 2055f826cb9..65fb32732cf 100644 --- a/src/mame/igs/igs_m027xa.cpp +++ b/src/mame/igs/igs_m027xa.cpp @@ -19,6 +19,7 @@ These games use the IGS027A processor. #include "machine/i8255.h" #include "machine/nvram.h" +#include "machine/ticket.h" #include "machine/timer.h" #include "sound/okim6295.h" @@ -26,6 +27,8 @@ These games use the IGS027A processor. #include "screen.h" #include "speaker.h" +#include "crzybugs.lh" + #define LOG_DEBUG (1U << 1) //#define VERBOSE (LOG_DEBUG) #include "logmacro.h" @@ -44,9 +47,11 @@ public: m_igs017_igs031(*this, "igs017_igs031"), m_oki(*this, "oki"), m_screen(*this, "screen"), + m_ticket(*this, "ticket"), m_external_rom(*this, "user1"), m_io_test(*this, "TEST%u", 0U), - m_io_dsw(*this, "DSW%u", 1U) + m_io_dsw(*this, "DSW%u", 1U), + m_out_lamps(*this, "lamp%u", 1U) { } void igs_mahjong_xa(machine_config &config); @@ -72,11 +77,14 @@ private: required_device m_igs017_igs031; required_device m_oki; required_device m_screen; + optional_device m_ticket; required_region_ptr m_external_rom; optional_ioport_array<3> m_io_test; optional_ioport_array<3> m_io_dsw; + output_finder<8> m_out_lamps; + u32 m_xor_table[0x100]; u8 m_io_select[2]; @@ -107,6 +115,9 @@ private: u16 xa_r(offs_t offset, u16 mem_mask); void xa_w(offs_t offset, u16 data, u16 mem_mask); + void output_w(u8 data); + void lamps_w(u8 data); + void igs_40000014_w(offs_t offset, u32 data, u32 mem_mask); u8 mcu_p0_r(); @@ -144,6 +155,8 @@ void igs_m027xa_state::machine_reset() void igs_m027xa_state::machine_start() { + m_out_lamps.resolve(); + std::fill(std::begin(m_xor_table), std::end(m_xor_table), 0); save_item(NAME(m_xor_table)); @@ -185,7 +198,6 @@ void igs_m027xa_state::main_map(address_map &map) map(0x38008000, 0x38008003).umask32(0x000000ff).rw(m_oki, FUNC(okim6295_device::read), FUNC(okim6295_device::write)); map(0x38009000, 0x38009003).rw(m_ppi, FUNC(i8255_device::read), FUNC(i8255_device::write)); map(0x3800c000, 0x3800c003).w(FUNC(igs_m027xa_state::oki_bank_w)); - map(0x4000000c, 0x4000000f).r(FUNC(igs_m027xa_state::gpio_r)); map(0x40000014, 0x40000017).w(FUNC(igs_m027xa_state::igs_40000014_w)); map(0x50000000, 0x500003ff).umask32(0x000000ff).w(FUNC(igs_m027xa_state::xor_table_w)); @@ -206,7 +218,7 @@ static INPUT_PORTS_START( base ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_GAMBLE_BET ) PORT_NAME("Play") PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 ) // COINA PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_GAMBLE_HIGH ) PORT_NAME("Big") @@ -214,19 +226,19 @@ static INPUT_PORTS_START( base ) PORT_START("TEST1") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SLOT_STOP_ALL ) PORT_NAME("Stop All Reels / Start") + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("Start / Stop All Reels") PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Ticket") - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) // ticket sw + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("ticket", ticket_dispenser_device, line_r) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) // ?? + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 ) // COINC PORT_START("TEST2") - PORT_BIT( 0x0000003f, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_SLOT_STOP2 ) PORT_NAME("Stop Reel 2 / Small") - PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_SLOT_STOP3 ) PORT_NAME("Stop Reel 3 / Take Score") - PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_SLOT_STOP1 ) PORT_NAME("Stop Reel 1 / Double Up") - PORT_BIT( 0xfffffe00, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x00007, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x00008, IP_ACTIVE_LOW, IPT_SLOT_STOP2 ) PORT_NAME("Stop Reel 2 / Small") + PORT_BIT( 0x00010, IP_ACTIVE_LOW, IPT_SLOT_STOP3 ) PORT_NAME("Stop Reel 3 / Take Score") + PORT_BIT( 0x00020, IP_ACTIVE_LOW, IPT_SLOT_STOP1 ) PORT_NAME("Stop Reel 1 / Double Up") + PORT_BIT( 0xfffc0, IP_ACTIVE_LOW, IPT_UNUSED ) // peripheral interrupts in bits 8 and 9 - see gpio_r PORT_START("DSW1") PORT_DIPNAME( 0x01, 0x01, DEF_STR(Demo_Sounds) ) PORT_DIPLOCATION("SW1:1") @@ -298,6 +310,37 @@ u16 igs_m027xa_state::xa_r(offs_t offset, u16 mem_mask) return data; } + +void igs_m027xa_state::output_w(u8 data) +{ + machine().bookkeeping().coin_counter_w(0, BIT(data, 0)); // one pulse per COINA accepted + machine().bookkeeping().coin_counter_w(2, BIT(data, 1)); // one pulse per key-in accepted + machine().bookkeeping().coin_counter_w(1, BIT(data, 2)); // one pulse per COINC accepted + // bits 3 and 4 have something to do with counting credits paid out by ticket and key-out + if (m_ticket) + m_ticket->motor_w(BIT(data, 6)); +} + +void igs_m027xa_state::lamps_w(u8 data) +{ + // active high outputs + // +------+----------------+ + // | lamp | crzybugs | + // +------+----------------+ + // | 1 | stop all/start | + // | 2 | stop 2/small | + // | 3 | bet | + // | 4 | stop 3/take | + // | 5 | stop 1/double | + // | 6 | big | + // | 7 | | + // | 8 | | + // +------+----------------+ + for (unsigned i = 0; 8 > i; ++i) + m_out_lamps[i] = BIT(data, i); +} + + void igs_m027xa_state::igs_40000014_w(offs_t offset, u32 data, u32 mem_mask) { // sets bit 1 before waiting on FIRQ, maybe it's an enable here? @@ -306,11 +349,11 @@ void igs_m027xa_state::igs_40000014_w(offs_t offset, u32 data, u32 mem_mask) u32 igs_m027xa_state::gpio_r() { - u32 ret = m_io_test[2].read_safe(0xffffffff); + u32 ret = m_io_test[2].read_safe(0xfffff); if (m_irq_from_igs031) - ret ^= 1 << 11; + ret &= ~(u32(1) << 8); if (m_irq_from_xa) - ret ^= 1 << 12; + ret &= ~(u32(1) << 9); return ret; } @@ -480,6 +523,7 @@ void igs_m027xa_state::igs_mahjong_xa(machine_config &config) { IGS027A(config, m_maincpu, 22'000'000); // Crazy Bugs has a 22MHz crystal, what about the others? m_maincpu->set_addrmap(AS_PROGRAM, &igs_m027xa_state::main_map); + m_maincpu->in_port().set(FUNC(igs_m027xa_state::gpio_r)); m_maincpu->out_port().set(FUNC(igs_m027xa_state::io_select_w<1>)); // NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); @@ -504,8 +548,13 @@ void igs_m027xa_state::igs_mahjong_xa(machine_config &config) TIMER(config, "scantimer").configure_scanline(FUNC(igs_m027xa_state::interrupt), "screen", 0, 1); - I8255A(config, m_ppi); // crzybugs: PPI port A = input, port B = output, port C = output + I8255A(config, m_ppi); + m_ppi->tri_pa_callback().set_constant(0x00); + m_ppi->tri_pb_callback().set_constant(0x00); + m_ppi->tri_pc_callback().set_constant(0x00); + m_ppi->out_pb_callback().set(FUNC(igs_m027xa_state::output_w)); + m_ppi->out_pc_callback().set(FUNC(igs_m027xa_state::lamps_w)); IGS017_IGS031(config, m_igs017_igs031, 0); m_igs017_igs031->set_text_reverse_bits(true); @@ -513,6 +562,8 @@ void igs_m027xa_state::igs_mahjong_xa(machine_config &config) m_igs017_igs031->in_pb_callback().set_ioport("TEST0"); m_igs017_igs031->in_pc_callback().set_ioport("TEST1"); + TICKET_DISPENSER(config, m_ticket, attotime::from_msec(200)); + // sound hardware SPEAKER(config, "mono").front_center(); OKIM6295(config, m_oki, 1000000, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 0.5); @@ -798,16 +849,16 @@ void igs_m027xa_state::init_wldfruit() // These use the MX10EXAQC (80c51XA from Philips) // the PCBs are closer to igs_fear.cpp in terms of layout -GAME( 2008, haunthig, 0, igs_mahjong_xa, base, igs_m027xa_state, init_hauntedh, ROT0, "IGS", "Haunted House (IGS, V109US)", MACHINE_IS_SKELETON ) // IGS FOR V109US 2008 10 14 -GAME( 2006, haunthiga, haunthig, igs_mahjong_xa, base, igs_m027xa_state, init_hauntedh, ROT0, "IGS", "Haunted House (IGS, V101US)", MACHINE_IS_SKELETON ) // IGS FOR V101US 2006 08 23 +GAME( 2008, haunthig, 0, igs_mahjong_xa, base, igs_m027xa_state, init_hauntedh, ROT0, "IGS", "Haunted House (IGS, V109US)", MACHINE_IS_SKELETON ) // IGS FOR V109US 2008 10 14 +GAME( 2006, haunthiga, haunthig, igs_mahjong_xa, base, igs_m027xa_state, init_hauntedh, ROT0, "IGS", "Haunted House (IGS, V101US)", MACHINE_IS_SKELETON ) // IGS FOR V101US 2006 08 23 -GAME( 2009, crzybugs, 0, igs_mahjong_xa_xor, base, igs_m027xa_state, init_crzybugs, ROT0, "IGS", "Crazy Bugs (V204US)", MACHINE_IS_SKELETON ) // IGS FOR V204US 2009 5 19 -GAME( 2006, crzybugsa, crzybugs, igs_mahjong_xa_xor, base, igs_m027xa_state, init_crzybugs, ROT0, "IGS", "Crazy Bugs (V202US)", MACHINE_IS_SKELETON ) // IGS FOR V100US 2006 3 29 but also V202US string -GAME( 2005, crzybugsb, crzybugs, igs_mahjong_xa_xor, base, igs_m027xa_state, init_crzybugs, ROT0, "IGS", "Crazy Bugs (V200US)", MACHINE_IS_SKELETON ) // FOR V100US 2005 7 20 but also V200US string +GAMEL( 2009, crzybugs, 0, igs_mahjong_xa_xor, base, igs_m027xa_state, init_crzybugs, ROT0, "IGS", "Crazy Bugs (V204US)", MACHINE_IS_SKELETON, layout_crzybugs ) // IGS FOR V204US 2009 5 19 +GAMEL( 2006, crzybugsa, crzybugs, igs_mahjong_xa_xor, base, igs_m027xa_state, init_crzybugs, ROT0, "IGS", "Crazy Bugs (V202US)", MACHINE_IS_SKELETON, layout_crzybugs ) // IGS FOR V100US 2006 3 29 but also V202US string +GAMEL( 2005, crzybugsb, crzybugs, igs_mahjong_xa_xor, base, igs_m027xa_state, init_crzybugs, ROT0, "IGS", "Crazy Bugs (V200US)", MACHINE_IS_SKELETON, layout_crzybugs ) // FOR V100US 2005 7 20 but also V200US string -GAME( 2007, crzybugsj, crzybugs, igs_mahjong_xa, base, igs_m027xa_state, init_crzybugsj, ROT0, "IGS", "Crazy Bugs (V103JP)", MACHINE_IS_SKELETON ) // IGS FOR V101JP 2007 06 08 +GAME( 2007, crzybugsj, crzybugs, igs_mahjong_xa, base, igs_m027xa_state, init_crzybugsj, ROT0, "IGS", "Crazy Bugs (V103JP)", MACHINE_IS_SKELETON ) // IGS FOR V101JP 2007 06 08 // XA dump is missing, so XA CPU will crash, disable for now -GAME( 2006, tripfev, 0, igs_mahjong_xa_xor_disable, base, igs_m027xa_state, init_tripfev, ROT0, "IGS", "Triple Fever (V107US)", MACHINE_IS_SKELETON ) // IGS FOR V107US 2006 09 07 +GAME( 2006, tripfev, 0, igs_mahjong_xa_xor_disable, base, igs_m027xa_state, init_tripfev, ROT0, "IGS", "Triple Fever (V107US)", MACHINE_IS_SKELETON ) // IGS FOR V107US 2006 09 07 -GAME( 200?, wldfruit, 0, igs_mahjong_xa, base, igs_m027xa_state, init_wldfruit, ROT0, "IGS", "Wild Fruit (V208US)", MACHINE_IS_SKELETON ) // IGS-----97----V208US +GAME( 200?, wldfruit, 0, igs_mahjong_xa, base, igs_m027xa_state, init_wldfruit, ROT0, "IGS", "Wild Fruit (V208US)", MACHINE_IS_SKELETON ) // IGS-----97----V208US diff --git a/src/mame/layout/crzybugs.lay b/src/mame/layout/crzybugs.lay new file mode 100644 index 00000000000..0b689db8c54 --- /dev/null +++ b/src/mame/layout/crzybugs.lay @@ -0,0 +1,209 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mame/layout/jking02.lay b/src/mame/layout/jking02.lay index 3190c7b762a..276fa22abd5 100644 --- a/src/mame/layout/jking02.lay +++ b/src/mame/layout/jking02.lay @@ -227,45 +227,45 @@ May or may not match arrangement/colour of real control panel - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/src/mame/layout/oceanpar.lay b/src/mame/layout/oceanpar.lay index d6b302518b8..579dad9a9ee 100644 --- a/src/mame/layout/oceanpar.lay +++ b/src/mame/layout/oceanpar.lay @@ -163,45 +163,45 @@ May or may not match arrangement/colour of real control panel - + - + - + - + - + - + - + - + - + - + - + - + -- cgit v1.2.3