From 215fc74bcfd5abd002175fd38202e57cf66483bd Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Thu, 6 Mar 2025 00:06:54 +1100 Subject: [PATCH] igs/igs_m027.cpp: Promoted xypdk and tct2p to working: * Fixed inputs and sound for xypdk. * Fixed inputs, and hooked up hopper, counter and lamp for tct2p. Systems promoted to working --------------------------- Tarzan Chuang Tianguan 2 Jiaqiang Ban (V306CN) Xingyun Pao De Kuai (V106CN) --- src/mame/igs/igs_m027.cpp | 123 +++++++++++++++++++++++++++++++++++--- 1 file changed, 116 insertions(+), 7 deletions(-) diff --git a/src/mame/igs/igs_m027.cpp b/src/mame/igs/igs_m027.cpp index 57e93d7f0cd..243def19386 100644 --- a/src/mame/igs/igs_m027.cpp +++ b/src/mame/igs/igs_m027.cpp @@ -142,13 +142,14 @@ public: template void m027_2ppis(machine_config &config) ATTR_COLD; void slqz3(machine_config &config) ATTR_COLD; void jking02(machine_config &config) ATTR_COLD; + void tct2p(machine_config &config) ATTR_COLD; void qlgs(machine_config &config) ATTR_COLD; void lhdmg(machine_config &config) ATTR_COLD; void lhzb3106c5m(machine_config &config) ATTR_COLD; void lhzb3sjb(machine_config &config) ATTR_COLD; void cjddz(machine_config &config) ATTR_COLD; void lhzb4(machine_config &config) ATTR_COLD; - void cjtljp(machine_config &config) ATTR_COLD; + void xypdk(machine_config &config) ATTR_COLD; void lthyp(machine_config &config) ATTR_COLD; void zhongguo(machine_config &config) ATTR_COLD; void mgzz(machine_config &config) ATTR_COLD; @@ -747,6 +748,99 @@ INPUT_PORTS_START( jking02 ) PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "SW3:8" ) INPUT_PORTS_END +INPUT_PORTS_START( tct2p ) + IGS_MAHJONG_MATRIX_CONDITIONAL("DSW2", 0x01, 0x00) + + PORT_START("PORTB") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SLOT_STOP2 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0x03, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) + 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("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SLOT_STOP1 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SLOT_STOP3 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) + + PORT_START("PORTC") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SLOT_STOP_ALL ) PORT_NAME("Show Odds") PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_BET ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) PORT_READ_LINE_DEVICE_MEMBER("hopper", FUNC(hopper_device::line_r)) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SLOT_STOP4 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0x3f, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) + + PORT_START("PLAYER") + PORT_BIT( 0x000ff, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0x00100, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0x1fe00, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0x20000, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0xc0000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0x0003f, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) PORT_CUSTOM_MEMBER(FUNC(igs_m027_state::kbd_ioport_r)) + PORT_BIT( 0x00040, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) PORT_READ_LINE_DEVICE_MEMBER("hopper", FUNC(hopper_device::line_r)) + PORT_BIT( 0x00f80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) + PORT_BIT( 0x01000, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) + PORT_BIT( 0x02000, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) + PORT_BIT( 0x1c000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) + PORT_BIT( 0x20000, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) + PORT_BIT( 0xc0000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) + + PORT_START("PPIB") + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) PORT_WRITE_LINE_DEVICE_MEMBER("hopper", FUNC(hopper_device::motor_w)) + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) PORT_WRITE_LINE_MEMBER(FUNC(igs_m027_state::counter_w<0>)) // payout/keyout + + PORT_START("PPIC") + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) PORT_WRITE_LINE_DEVICE_MEMBER("hopper", FUNC(hopper_device::motor_w)) + + PORT_START("CLEARMEM") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) PORT_TOGGLE + + PORT_START("DSW1") + PORT_DIPNAME( 0x1f, 0x1f, "Satellite Machine No.") PORT_DIPLOCATION("SW1:1,2,3,4,5") // 副机編号 + SATELLITE_NO_SETTINGS + PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "SW1:6" ) + PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "SW1:7" ) + PORT_DIPNAME( 0x80, 0x80, "Link Mode" ) PORT_DIPLOCATION("SW1:8") // 连线模式 + PORT_DIPSETTING( 0x80, DEF_STR(Off) ) // 无 + PORT_DIPSETTING( 0x00, DEF_STR(On) ) // 有 + + PORT_START("DSW2") + PORT_DIPNAME( 0x01, 0x01, DEF_STR(Controls) ) PORT_DIPLOCATION("SW2:1") // 操作界面 + PORT_DIPSETTING( 0x01, DEF_STR(Joystick) ) // 揺杆 + PORT_DIPSETTING( 0x00, "Mahjong" ) // 麻雀键盘 + PORT_DIPNAME( 0x02, 0x02, "Number Type" ) PORT_DIPLOCATION("SW2:2") // 数字型态 + PORT_DIPSETTING( 0x02, "Numbers" ) // 数字 + PORT_DIPSETTING( 0x00, "Circle Tiles" ) // 筒子 + PORT_DIPNAME( 0x04, 0x00, DEF_STR(Demo_Sounds) ) PORT_DIPLOCATION("SW2:3") // 示范音乐 + PORT_DIPSETTING( 0x04, DEF_STR(Off) ) // 无 + PORT_DIPSETTING( 0x00, DEF_STR(On) ) // 有 + PORT_DIPNAME( 0x08, 0x08, "Background Color Mode" ) PORT_DIPLOCATION("SW2:4") // 底色模式 + PORT_DIPSETTING( 0x08, "Monochrome" ) // 黑白 + PORT_DIPSETTING( 0x00, "Color" ) // 彩色 + PORT_DIPNAME( 0x10, 0x10, "Bet Limit" ) PORT_DIPLOCATION("SW2:5") // 限制押分 + PORT_DIPSETTING( 0x10, DEF_STR(Off) ) // 无 + PORT_DIPSETTING( 0x00, DEF_STR(On) ) // 有 + 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( slqz3 ) PORT_INCLUDE(mahjong_test) PORT_INCLUDE(slqz3_dip_switches) @@ -1825,12 +1919,13 @@ void igs_m027_state::lhzb4(machine_config &config) m_oki->set_clock(2'000'000); } -void igs_m027_state::cjtljp(machine_config &config) +void igs_m027_state::xypdk(machine_config &config) { cjddz(config); - // Found on a board with 2 MHz clock frequency (22 MHz/11, divided using a - // PAL) and pin 7 high. This makes the voices too high-pitched. + // xypdk was found on a board with this configuration. + // cjtljp was found on a board with 2 MHz clock frequency (22 MHz/11, divided + // using a PAL) and pin 7 high. This makes the voices too high-pitched. // Possibly supposed to be 2 MHz with pin 7 low, or 1.375 MHz (22 MHz/16) // with pin 7 high. m_oki->set_clock(2'000'000); @@ -1868,6 +1963,20 @@ void igs_m027_state::jking02(machine_config &config) m_ppi[0]->out_pc_callback().set(FUNC(igs_m027_state::lamps_w<0>)); } +void igs_m027_state::tct2p(machine_config &config) +{ + m027_1ppi(config); + + m_maincpu->in_port().set_ioport("PLAYER"); + m_maincpu->out_port().append([this] (int state) { m_out_lamps[0] = state; }).bit(3); // seems to be an "insert coin" lamp - high when no credits + + m_ppi[0]->out_pb_callback().set_ioport("PPIB"); + m_ppi[0]->out_pc_callback().set_ioport("PPIC"); + m_ppi[0]->out_pc_callback().append(FUNC(igs_m027_state::io_select_w<0>)); + + HOPPER(config, m_hopper, attotime::from_msec(50)); +} + void igs_m027_state::mgzz(machine_config &config) { m027_1ppi(config); @@ -3380,7 +3489,7 @@ GAME( 2004, lhzb4dhb, 0, lhzb4, lhzb4, igs_m027_stat GAME( 1999, lthyp, 0, lthyp, lthyp, igs_m027_state, init_lthyp, ROT0, "IGS", "Long Teng Hu Yao Duizhan Jiaqiang Ban (S104CN)", MACHINE_NODEVICE_LAN ) GAME( 2000, zhongguo, 0, zhongguo, zhongguo, igs_m027_state, init_zhongguo, ROT0, "IGS", "Zhongguo Chu Da D (V102C)", 0 ) GAMEL( 2001, jking02, 0, jking02, jking02, igs_m027_state, init_jking02, ROT0, "IGS", "Jungle King 2002 (V209US)", MACHINE_NODEVICE_LAN, layout_jking02 ) // shows V212US in bookkeeping menu -GAMEL( 2003, tct2p, 0, jking02, jking02, igs_m027_state, init_tct2p, ROT0, "IGS", "Tarzan Chuang Tianguan 2 Jiaqiang Ban (V306CN)", MACHINE_NOT_WORKING, layout_jking02 ) // needs inputs +GAME( 2003, tct2p, 0, tct2p, tct2p, igs_m027_state, init_tct2p, ROT0, "IGS", "Tarzan Chuang Tianguan 2 Jiaqiang Ban (V306CN)", 0 ) GAME( 2003, mgzz, 0, mgzz, mgzz101cn, igs_m027_state, init_mgzz, ROT0, "IGS", "Manguan Zhizun (V101CN)", 0 ) GAME( 2003, mgzz100cn, mgzz, mgzz, mgzz100cn, igs_m027_state, init_mgzz, ROT0, "IGS", "Manguan Zhizun (V100CN)", 0 ) GAME( 2007, mgcs3, 0, lhzb4, mgcs3, igs_m027_state, init_mgcs3, ROT0, "IGS", "Manguan Caishen 3 (V101CN)", 0 ) @@ -3394,8 +3503,8 @@ GAME( 2004, cjddz215cn, cjddz, cjddz, cjddz, igs_m027_stat GAME( 2004, cjddz213cn, cjddz, cjddz, cjddz, igs_m027_state, init_cjddz, ROT0, "IGS", "Chaoji Dou Dizhu (V213CN)", MACHINE_NOT_WORKING ) // missing external program ROM. 2004 date in internal ROM GAME( 2004, cjddzp, 0, cjddz, cjddzp, igs_m027_state, init_cjddzp, ROT0, "IGS", "Chaoji Dou Dizhu Jiaqiang Ban (S300CN)", MACHINE_NODEVICE_LAN ) // 2004 date in internal ROM GAME( 2005, cjddzlf, 0, cjddz, cjddz, igs_m027_state, init_cjddzlf, ROT0, "IGS", "Chaoji Dou Dizhu Liang Fu Pai (V109CN)", 0 ) // 2005 date in internal ROM -GAME( 2005, cjtljp, 0, cjtljp, lhzb4, igs_m027_state, init_cjtljp, ROT0, "IGS", "Chaoji Tuolaji Jiaqiang Ban (V206CN)", 0 ) // 2005 date in internal ROM -GAME( 2005, xypdk, 0, cjddz, cjddz, igs_m027_state, init_xypdk, ROT0, "IGS", "Xingyun Pao De Kuai (V106CN)", MACHINE_NOT_WORKING ) // needs inputs +GAME( 2005, cjtljp, 0, xypdk, lhzb4, igs_m027_state, init_cjtljp, ROT0, "IGS", "Chaoji Tuolaji Jiaqiang Ban (V206CN)", 0 ) // 2005 date in internal ROM +GAME( 2005, xypdk, 0, xypdk, lhzb4, igs_m027_state, init_xypdk, ROT0, "IGS", "Xingyun Pao De Kuai (V106CN)", 0 ) GAMEL( 2007, tripslot, 0, tripslot, tripslot, igs_m027_state, init_tripslot, ROT0, "IGS", "Triple Slot (V200VE)", 0, layout_tripslot ) // 2007 date in internal ROM at least, could be later, default settings password is all 'start 1' // this has a 2nd 8255 GAME( 2001, extradrw, 0, extradrw, base, igs_m027_state, init_extradrw, ROT0, "IGS", "Extra Draw (V100VE)", MACHINE_NOT_WORKING )