From f81cf3039a6d5607b1a54cc1b7a1cdf3490424e1 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Thu, 17 Oct 2024 03:05:43 +1100 Subject: igs/igs_m027.cpp, igs/igs017.cpp: Mostly input improvements: * igs/igs_m027.cpp: Corrected Chaoji Tuolaji inputs (same as Long Hu Da Zhengba 4). * igs/igs_m027.cpp: Corrected Chaoji Tuolaji M6295 sound chip frequency. * igs/igs017.cpp: Corrected Long Hu Zhengba 2 DIP switch settings and cleaned up inputs. * igs/igs017.cpp: Corrected Manguan Daheng DIP switch settings and started cleaning up inputs. * igs/igs017.cpp, igs/igs_m027.cpp: Reduced repetition in inputs a little, made conventions a bit more consistent across files, and corrected a few comments. --- src/mame/igs/igs017.cpp | 402 +++++++++++++++++++++------------------------- src/mame/igs/igs_m027.cpp | 274 ++++++++++--------------------- src/mame/igs/pgmcrypt.cpp | 10 +- src/mame/igs/pgmcrypt.h | 2 +- src/mame/mame.lst | 2 +- 5 files changed, 275 insertions(+), 415 deletions(-) diff --git a/src/mame/igs/igs017.cpp b/src/mame/igs/igs017.cpp index de415c0d4b9..7070a9c1cb8 100644 --- a/src/mame/igs/igs017.cpp +++ b/src/mame/igs/igs017.cpp @@ -635,52 +635,53 @@ public: , m_lamps(*this, "lamp%u", 1U) { } - // Construct - void base_machine_oki(machine_config &config, const XTAL &xtal_oki); // Z180 - void cpoker2(machine_config &config); - void genius6(machine_config &config); - void happyskl(machine_config &config); - void iqblocka(machine_config &config); - void iqblockf(machine_config &config); - void spkrform(machine_config &config); - void starzan(machine_config &config); - void tarzan(machine_config &config); - void tjsb(machine_config &config); + void cpoker2(machine_config &config) ATTR_COLD; + void genius6(machine_config &config) ATTR_COLD; + void happyskl(machine_config &config) ATTR_COLD; + void iqblocka(machine_config &config) ATTR_COLD; + void iqblockf(machine_config &config) ATTR_COLD; + void spkrform(machine_config &config) ATTR_COLD; + void starzan(machine_config &config) ATTR_COLD; + void tarzan(machine_config &config) ATTR_COLD; + void tjsb(machine_config &config) ATTR_COLD; // 68000 - void jking302us(machine_config &config); - void lhzb2(machine_config &config); - void lhzb2a(machine_config &config); - void mgcs(machine_config &config); - void mgcsa(machine_config &config); - void mgdh(machine_config &config); - void mgdha(machine_config &config); - void sdmg2(machine_config &config); - void sdmg2p(machine_config &config); - void slqz2(machine_config &config); + void jking302us(machine_config &config) ATTR_COLD; + void lhzb2(machine_config &config) ATTR_COLD; + void lhzb2a(machine_config &config) ATTR_COLD; + void mgcs(machine_config &config) ATTR_COLD; + void mgcsa(machine_config &config) ATTR_COLD; + void mgdh(machine_config &config) ATTR_COLD; + void mgdha(machine_config &config) ATTR_COLD; + void sdmg2(machine_config &config) ATTR_COLD; + void sdmg2p(machine_config &config) ATTR_COLD; + void slqz2(machine_config &config) ATTR_COLD; // Init - void init_cpoker2(); - void init_happyskl(); - void init_iqblocka(); - void init_jking103a(); - void init_jking302us(); - void init_lhzb2(); - void init_lhzb2a(); - void init_mgcs(); - void init_mgcsa(); - void init_mgdh(); - void init_mgdha(); - void init_sdmg2(); - void init_sdmg2a(); - void init_sdmg2p(); - void init_slqz2(); - void init_spkrform(); - void init_starzan(); - void init_tarzan(); - void init_tarzana(); - void init_tarzanc(); - void init_tjsb(); + void init_cpoker2() ATTR_COLD; + void init_happyskl() ATTR_COLD; + void init_iqblocka() ATTR_COLD; + void init_jking103a() ATTR_COLD; + void init_jking302us() ATTR_COLD; + void init_lhzb2() ATTR_COLD; + void init_lhzb2a() ATTR_COLD; + void init_mgcs() ATTR_COLD; + void init_mgcsa() ATTR_COLD; + void init_mgdh() ATTR_COLD; + void init_mgdha() ATTR_COLD; + void init_sdmg2() ATTR_COLD; + void init_sdmg2a() ATTR_COLD; + void init_sdmg2p() ATTR_COLD; + void init_slqz2() ATTR_COLD; + void init_spkrform() ATTR_COLD; + void init_starzan() ATTR_COLD; + void init_tarzan() ATTR_COLD; + void init_tarzana() ATTR_COLD; + void init_tarzanc() ATTR_COLD; + void init_tjsb() ATTR_COLD; + + template + T keys_ipt_r(); protected: virtual void machine_start() override ATTR_COLD; @@ -814,15 +815,11 @@ private: u8 mgcs_igs029_data_r(); void mgcs_igs029_data_w(u8 data); - u8 mgdh_keys_r(); void mgdh_keys_hopper_w(u8 data); void mgdh_counter_w(u8 data); - u8 sdmg2_keys_joy_r(); void sdmg2_keys_hopper_w(u8 data); - u8 sdmg2p_keys_r(); - void slqz2_sound_hopper_w(u8 data); u8 slqz2_scramble_data_r(); @@ -842,21 +839,24 @@ private: TIMER_DEVICE_CALLBACK_MEMBER(mgdh_interrupt); // Decrypt - void decrypt_program_rom(int mask, int a7, int a6, int a5, int a4, int a3, int a2, int a1, int a0); + void decrypt_program_rom(int mask, int a7, int a6, int a5, int a4, int a3, int a2, int a1, int a0) ATTR_COLD; - void mgcs_decrypt_program_rom(); - void mgcsa_decrypt_program_rom(); - void mgcs_igs029_run(); - void starzan_decrypt_program_rom(); - void tarzan_decrypt_program_rom(); - void tarzana_decrypt_program_rom(); + void mgcs_decrypt_program_rom() ATTR_COLD; + void mgcsa_decrypt_program_rom() ATTR_COLD; + void mgcs_igs029_run() ATTR_COLD; + void starzan_decrypt_program_rom() ATTR_COLD; + void tarzan_decrypt_program_rom() ATTR_COLD; + void tarzana_decrypt_program_rom() ATTR_COLD; // ROM Patches -// void lhzb2_patch_rom(); -// void mgcs_patch_rom(); -// void slqz2_patch_rom(); - void mgdh_patch_rom(); - void spkrform_patch_rom(); +// void lhzb2_patch_rom() ATTR_COLD; +// void mgcs_patch_rom() ATTR_COLD; +// void slqz2_patch_rom() ATTR_COLD; + void mgdh_patch_rom() ATTR_COLD; + void spkrform_patch_rom() ATTR_COLD; + + // Construct + void base_machine_oki(machine_config &config, const XTAL &xtal_oki) ATTR_COLD; // Memory maps void decrypted_opcodes_map(address_map &map) ATTR_COLD; @@ -2542,17 +2542,16 @@ void igs017_state::sdmg2_map(address_map &map) map(0x300002, 0x300003).rw(m_igs_mux, FUNC(igs_mux_device::data_r), FUNC(igs_mux_device::data_w)).umask16(0x00ff); } -u8 igs017_state::sdmg2_keys_joy_r() +template +T igs017_state::keys_ipt_r() { - if (BIT(m_input_select, 0, 5) == 0x1f) return m_io_joy->read(); // 1f/uninitialized in test screen (joystick mode) - - u8 ret = 0xff; - if (!BIT(m_input_select, 0)) ret &= m_io_key[0]->read(); // 1e (keyboard mode) - if (!BIT(m_input_select, 1)) ret &= m_io_key[1]->read(); // 1d "" - if (!BIT(m_input_select, 2)) ret &= m_io_key[2]->read(); // 1b "" - if (!BIT(m_input_select, 3)) ret &= m_io_key[3]->read(); // 17 "" - if (!BIT(m_input_select, 4)) ret &= m_io_key[4]->read(); // 0f "" - return ret; + ioport_value result = 0xff; + for (unsigned i = 0; std::size(m_io_key) > i; ++i) + { + if (!BIT(m_input_select, B + i)) + result &= m_io_key[i].read_safe(0xff); + } + return T((result >> (8 - R)) | (result << R)); } void igs017_state::sdmg2_keys_hopper_w(u8 data) @@ -2567,7 +2566,7 @@ void igs017_state::sdmg2_mux_map(address_map &map) { map(0x00, 0x00).portr("COINS"); map(0x01, 0x01).w(FUNC(igs017_state::sdmg2_keys_hopper_w)); - map(0x02, 0x02).r(FUNC(igs017_state::sdmg2_keys_joy_r)).w(NAME((&igs017_state::oki_sound_bank_w<7, 0x7f>))); + map(0x02, 0x02).portr("MATRIX").w(NAME((&igs017_state::oki_sound_bank_w<7, 0x7f>))); } // mgdh, mgdha @@ -2585,17 +2584,6 @@ void igs017_state::mgdh_map(address_map &map) map(0xa10001, 0xa10001).rw(m_oki, FUNC(okim6295_device::read), FUNC(okim6295_device::write)); } -u8 igs017_state::mgdh_keys_r() -{ - u8 ret = 0xff; - if (!BIT(m_input_select, 2)) ret &= m_io_key[0]->read(); // f8 (keyboard mode / joystick mode) - if (!BIT(m_input_select, 3)) ret &= m_io_key[1]->read(); // f4 (keyboard mode) - if (!BIT(m_input_select, 4)) ret &= m_io_key[2]->read(); // ec "" - if (!BIT(m_input_select, 5)) ret &= m_io_key[3]->read(); // dc "" - if (!BIT(m_input_select, 6)) ret &= m_io_key[4]->read(); // bc "" - return ret; -} - void igs017_state::mgdh_keys_hopper_w(u8 data) { m_input_select = data; @@ -2616,7 +2604,7 @@ void igs017_state::mgdh_counter_w(u8 data) void igs017_state::mgdha_mux_map(address_map &map) { - map(0x00, 0x00).r(FUNC(igs017_state::mgdh_keys_r)).w(FUNC(igs017_state::mgdh_counter_w)); + map(0x00, 0x00).r(NAME((&igs017_state::keys_ipt_r))).w(FUNC(igs017_state::mgdh_counter_w)); map(0x01, 0x01).portr("BUTTONS").w(FUNC(igs017_state::mgdh_keys_hopper_w)); map(0x02, 0x02).lr8(NAME([this](){ return bitswap<8>(m_io_dsw[1]->read(), 0,1,2,3,4,5,6,7); })); map(0x03, 0x03).portr("COINS").w(NAME((&igs017_state::oki_sound_bank_w<6, 0x3f>))); // bit 7? always on @@ -2631,17 +2619,6 @@ void igs017_state::mgdh_mux_map(address_map &map) // sdmg2p -u8 igs017_state::sdmg2p_keys_r() -{ - u8 ret = 0xff; - if (!BIT(m_input_select, 2)) ret &= m_io_key[0]->read(); - if (!BIT(m_input_select, 3)) ret &= m_io_key[1]->read(); - if (!BIT(m_input_select, 4)) ret &= m_io_key[2]->read(); - if (!BIT(m_input_select, 5)) ret &= m_io_key[3]->read(); - if (!BIT(m_input_select, 6)) ret &= m_io_key[4]->read(); - return bitswap<8>(ret, 5, 4, 3, 2, 1, 0, 7, 6); -} - void igs017_state::sdmg2p_map(address_map &map) { map(0x000000, 0x07ffff).rom(); @@ -2659,7 +2636,7 @@ void igs017_state::sdmg2p_map(address_map &map) void igs017_state::sdmg2p_mux_map(address_map &map) // TODO: hopper motor w { map.unmap_value_high(); - map(0x00, 0x00).r(FUNC(igs017_state::sdmg2p_keys_r)); + map(0x00, 0x00).r(NAME((&igs017_state::keys_ipt_r))); map(0x01, 0x01).portr("JOY"); map(0x02, 0x02).portr("BUTTONS").w(FUNC(igs017_state::mgdh_keys_hopper_w)); map(0x03, 0x03).portr("COINS").w(FUNC(igs017_state::mgdh_counter_w)); @@ -3227,82 +3204,6 @@ static INPUT_PORTS_START( genius6 ) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_POKER_HOLD5 ) // (2P B in test mode) INPUT_PORTS_END -static INPUT_PORTS_START( lhzb2 ) - PORT_INCLUDE(igs_mahjong_matrix) - - PORT_START("DSW1") - PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:1,2") - PORT_DIPSETTING( 0x03, DEF_STR( 1C_1C ) ) - PORT_DIPSETTING( 0x02, DEF_STR( 1C_2C ) ) - PORT_DIPSETTING( 0x01, DEF_STR( 1C_3C ) ) - PORT_DIPSETTING( 0x00, DEF_STR( 1C_5C ) ) - PORT_DIPNAME( 0x0c, 0x0c, "Credits Per Note" ) PORT_DIPLOCATION("SW1:3,4") - PORT_DIPSETTING( 0x0c, "10" ) - PORT_DIPSETTING( 0x08, "20" ) - PORT_DIPSETTING( 0x04, "50" ) - PORT_DIPSETTING( 0x00, "100" ) - PORT_DIPNAME( 0x10, 0x10, "Max Note Credits" ) PORT_DIPLOCATION("SW1:5") - PORT_DIPSETTING( 0x10, "1000" ) - PORT_DIPSETTING( 0x00, "2000" ) - PORT_DIPNAME( 0x20, 0x20, "Money Type" ) PORT_DIPLOCATION("SW1:6") - PORT_DIPSETTING( 0x20, "Coins" ) - PORT_DIPSETTING( 0x00, "Notes" ) - PORT_DIPNAME( 0x40, 0x40, "Pay Out Type" ) PORT_DIPLOCATION("SW1:7") - PORT_DIPSETTING( 0x40, "Coins" ) - PORT_DIPSETTING( 0x00, "Notes" ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:8") - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x80, DEF_STR( On ) ) - - PORT_START("DSW2") - PORT_DIPNAME( 0x03, 0x03, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:1,2") - PORT_DIPSETTING( 0x03, "500" ) - PORT_DIPSETTING( 0x02, "1000" ) - PORT_DIPSETTING( 0x01, "1500" ) - PORT_DIPSETTING( 0x00, "2000" ) - PORT_DIPNAME( 0x0c, 0x0c, "Minimum Bet" ) PORT_DIPLOCATION("SW2:3,4") - PORT_DIPSETTING( 0x0c, "1 (1)" ) - PORT_DIPSETTING( 0x08, "1 (2)" ) - PORT_DIPSETTING( 0x04, "1 (3)" ) - PORT_DIPSETTING( 0x00, "1 (4)" ) - PORT_DIPNAME( 0x10, 0x10, "Bonus Round" ) PORT_DIPLOCATION("SW2:5") - PORT_DIPSETTING( 0x00, DEF_STR( No ) ) - PORT_DIPSETTING( 0x10, DEF_STR( Yes ) ) - PORT_DIPNAME( 0x20, 0x20, "Number Type" ) PORT_DIPLOCATION("SW2:6") - PORT_DIPSETTING( 0x20, "Number" ) - PORT_DIPSETTING( 0x00, "Dice" ) - PORT_DIPNAME( 0x40, 0x40, "Symbols" ) PORT_DIPLOCATION("SW2:7") - PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) // pigs, apples - PORT_DIPNAME( 0x80, 0x80, "Hide Gambling" ) PORT_DIPLOCATION("SW2:8") // press "Hide Gambling" to hide credits and bets - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - - PORT_START("COINS") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // hopper switch - PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_LOW ) // test mode (keep pressed during boot too) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) // press with the above for sound test - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5) // coin error otherwise - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Pay Out") PORT_CODE(KEYCODE_O) - PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_NAME("Hide Gambling") // shown in test mode as "clear" (清除) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) -INPUT_PORTS_END - -static INPUT_PORTS_START( lhzb2a ) - PORT_INCLUDE( lhzb2 ) - - PORT_MODIFY("COINS") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // hopper switch - PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW ) // keep pressed while booting - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) // press with the above for sound test - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Pay Out") PORT_CODE(KEYCODE_O) - PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_NAME("Hide Gambling") // shown in test mode as "clear" (清除) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) -INPUT_PORTS_END - #define CREDIT_SETTINGS_COMMON \ PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:1,2") /* 投幣比率 */ \ PORT_DIPSETTING( 0x03, DEF_STR( 1C_1C ) ) \ @@ -3318,7 +3219,7 @@ INPUT_PORTS_END PORT_DIPSETTING( 0x20, "Coin Acceptor" ) /* 投幣 */ \ PORT_DIPSETTING( 0x00, "Key-In" ) /* 開分 */ \ PORT_DIPNAME( 0x40, 0x40, "Payout Mode" ) PORT_DIPLOCATION("SW1:7") /* 退分方式 */ \ - PORT_DIPSETTING( 0x40, "Return Coins" ) /* 投幣 */ \ + PORT_DIPSETTING( 0x40, "Return Coins" ) /* 退幣 */ \ PORT_DIPSETTING( 0x00, "Key-Out" ) /* 洗分 */ #define MAHJONG_MATRIX_CONDITIONAL(port, mask) \ @@ -3366,6 +3267,75 @@ INPUT_PORTS_END PORT_BIT( 0x30, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION(port, mask, EQUALS, 0x00) \ PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNKNOWN ) +static INPUT_PORTS_START( lhzb2_common ) + PORT_INCLUDE(igs_mahjong_matrix) + + PORT_START("DSW1") + CREDIT_SETTINGS_COMMON + PORT_DIPNAME( 0x10, 0x10, "Credit Limit" ) PORT_DIPLOCATION("SW1:5") // 进分上限 + PORT_DIPSETTING( 0x10, "1000" ) + PORT_DIPSETTING( 0x00, "2000" ) + PORT_DIPNAME( 0x80, 0x80, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:8") // 示范音乐 + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) // 无 + PORT_DIPSETTING( 0x80, DEF_STR( On ) ) // 有 + + PORT_START("DSW2") + PORT_DIPNAME( 0x03, 0x03, "Double Up Jackpot" ) PORT_DIPLOCATION("SW2:1,2") // 比倍爆机 + PORT_DIPSETTING( 0x03, "500" ) + PORT_DIPSETTING( 0x02, "1000" ) + PORT_DIPSETTING( 0x01, "1500" ) + PORT_DIPSETTING( 0x00, "2000" ) + PORT_DIPNAME( 0x0c, 0x0c, "Minimum Bet" ) PORT_DIPLOCATION("SW2:3,4") // 最小押注 + PORT_DIPSETTING( 0x0c, "1 (1)" ) + PORT_DIPSETTING( 0x08, "1 (2)" ) + PORT_DIPSETTING( 0x04, "1 (3)" ) + PORT_DIPSETTING( 0x00, "1 (4)" ) + PORT_DIPNAME( 0x10, 0x10, "Double Up Game" ) PORT_DIPLOCATION("SW2:5") // 比倍游戏 + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) // 无 + PORT_DIPSETTING( 0x10, DEF_STR( On ) ) // 有 + PORT_DIPNAME( 0x20, 0x20, "Double Up Game Name" ) PORT_DIPLOCATION("SW2:6") // 比倍续玩 (changes names for double up game and Double Up/Big/Small buttons) + PORT_DIPSETTING( 0x20, "Continue Play" ) // 续玩 (续玩/左/右) + PORT_DIPSETTING( 0x00, "Double Up" ) // 比倍 (比倍/大/小) + PORT_DIPNAME( 0x40, 0x40, "Number Type" ) PORT_DIPLOCATION("SW2:7") // 数字型态 + PORT_DIPSETTING( 0x40, "Numbers" ) // 数字 + PORT_DIPSETTING( 0x00, "Blocks" ) // 方块 (pigs for credit, apples for bet, mahjong tong tiles for numbers) + PORT_DIPNAME( 0x80, 0x80, "Show Credits" ) PORT_DIPLOCATION("SW2:8") // 数字有无 (hides credits/bets/wins, game plays normally) + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) // 无 + PORT_DIPSETTING( 0x80, DEF_STR( On ) ) // 有 +INPUT_PORTS_END + +static INPUT_PORTS_START( lhzb2 ) + PORT_INCLUDE( lhzb2_common ) + + PORT_START("COINS") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // 哈巴 + PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_LOW ) // 测试 (hold on start for input test) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) // 査帐 + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5) PORT_CONDITION("DSW1", 0x20, EQUALS, 0x20) // 投币 + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) PORT_CONDITION("DSW1", 0x20, EQUALS, 0x00) // 投币 + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) PORT_CONDITION("DSW1", 0x40, EQUALS, 0x40) // 退币 + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) PORT_CONDITION("DSW1", 0x40, EQUALS, 0x00) // 退币 + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Show Credits") // 清除 (hold to show credits/bets/wins when hidden) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) +INPUT_PORTS_END + +static INPUT_PORTS_START( lhzb2a ) + PORT_INCLUDE( lhzb2_common ) + + PORT_START("COINS") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // 哈巴 + PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW ) // 测试 (hold on start for input test) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) // 査帐 + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5) PORT_CONDITION("DSW1", 0x20, EQUALS, 0x20) // 投币 + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) PORT_CONDITION("DSW1", 0x20, EQUALS, 0x00) // 投币 + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) PORT_CONDITION("DSW1", 0x40, EQUALS, 0x40) // 退币 + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) PORT_CONDITION("DSW1", 0x40, EQUALS, 0x00) // 退币 + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Show Credits") // 清除 (hold to show credits/bets/wins when hidden) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) +INPUT_PORTS_END + static INPUT_PORTS_START( mgcs ) // DSWs are read through a protection device (IGS029). See code at $1cf16 @@ -3483,8 +3453,8 @@ static INPUT_PORTS_START( sdmg2 ) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_CONDITION("DSW2", 0x40, EQUALS, 0x00) // 功能 PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_START("JOY") - PORT_BIT( 0x7f, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x40, EQUALS, 0x40) + PORT_START("MATRIX") + PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CONDITION("DSW2", 0x40, EQUALS, 0x40) PORT_CUSTOM_MEMBER(igs017_state, keys_ipt_r<>) PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) PORT_CONDITION("DSW2", 0x40, EQUALS, 0x00) // 開始 PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_CONDITION("DSW2", 0x40, EQUALS, 0x00) // 上 PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_CONDITION("DSW2", 0x40, EQUALS, 0x00) // 下 @@ -3492,7 +3462,7 @@ static INPUT_PORTS_START( sdmg2 ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_CONDITION("DSW2", 0x40, EQUALS, 0x00) // 右 PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_CONDITION("DSW2", 0x40, EQUALS, 0x00) // 摸捨 PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_CONDITION("DSW2", 0x40, EQUALS, 0x00) // 押注 - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) // related to joystick BUTTON3 + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x40, EQUALS, 0x00) // related to joystick BUTTON3 INPUT_PORTS_END static INPUT_PORTS_START( sdmg2p ) @@ -3535,9 +3505,9 @@ static INPUT_PORTS_START( sdmg2p ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("JOY") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x40, EQUALS, 0x40) + PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x40, EQUALS, 0x40) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x40, EQUALS, 0x00) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x40, EQUALS, 0x00) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 ) PORT_CONDITION("DSW2", 0x40, EQUALS, 0x00) // 開始 PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_CONDITION("DSW2", 0x40, EQUALS, 0x00) // 上 PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_CONDITION("DSW2", 0x40, EQUALS, 0x00) // 下 @@ -3547,7 +3517,7 @@ static INPUT_PORTS_START( sdmg2p ) PORT_START("BUTTONS") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x40, EQUALS, 0x40) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_CONDITION("DSW2", 0x40, EQUALS, 0x40) PORT_NAME("Clear") // 清除 + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_CONDITION("DSW2", 0x40, EQUALS, 0x40) PORT_NAME("Show Credits") // 清除 (hold to show credits/bets/wins when hidden) PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_CONDITION("DSW2", 0x40, EQUALS, 0x00) // 押注 PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x40, EQUALS, 0x00) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) @@ -3560,63 +3530,63 @@ INPUT_PORTS_END static INPUT_PORTS_START( mgdh ) PORT_START("DSW1") - PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:1") - PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x06, 0x06, "Credits Per Note" ) PORT_DIPLOCATION("SW1:2,3") + PORT_DIPUNKNOWN_DIPLOC( 0x01, IP_ACTIVE_LOW, "SW1:1" ) + PORT_DIPNAME( 0x06, 0x06, "Key-In Rate" ) PORT_DIPLOCATION("SW1:2,3") // 開分比率 PORT_DIPSETTING( 0x06, "5" ) PORT_DIPSETTING( 0x04, "10" ) PORT_DIPSETTING( 0x02, "50" ) PORT_DIPSETTING( 0x00, "100" ) - PORT_DIPNAME( 0x08, 0x08, "Max Note Credits" ) PORT_DIPLOCATION("SW1:4") + PORT_DIPNAME( 0x08, 0x08, "Credit Limit" ) PORT_DIPLOCATION("SW1:4") // 進分上限 PORT_DIPSETTING( 0x08, "100" ) PORT_DIPSETTING( 0x00, "500" ) - PORT_DIPNAME( 0x10, 0x10, "Money Type" ) PORT_DIPLOCATION("SW1:5") - PORT_DIPSETTING( 0x10, "Coins" ) - PORT_DIPSETTING( 0x00, "Notes" ) - PORT_DIPNAME( 0x20, 0x20, "Pay Out Type" ) PORT_DIPLOCATION("SW1:6") - PORT_DIPSETTING( 0x20, "Coins" ) - PORT_DIPSETTING( 0x00, "Notes" ) - PORT_DIPNAME( 0xc0, 0xc0, "Minimum Bet" ) PORT_DIPLOCATION("SW1:7,8") + PORT_DIPNAME( 0x10, 0x10, "Credit Mode" ) PORT_DIPLOCATION("SW1:5") // 進分方式 + PORT_DIPSETTING( 0x10, "Coin Acceptor" ) // 投幣 + PORT_DIPSETTING( 0x00, "Key-In" ) // 開分 + PORT_DIPNAME( 0x20, 0x20, "Payout Mode" ) PORT_DIPLOCATION("SW1:6") // 退分方式 + PORT_DIPSETTING( 0x20, "Return Coins" ) // 退幣 + PORT_DIPSETTING( 0x00, "Key-Out" ) // 洗分 + PORT_DIPNAME( 0xc0, 0xc0, "Minimum Bet" ) PORT_DIPLOCATION("SW1:7,8") // 最小押注 PORT_DIPSETTING( 0xc0, "1" ) PORT_DIPSETTING( 0x80, "2" ) PORT_DIPSETTING( 0x40, "3" ) PORT_DIPSETTING( 0x00, "5" ) PORT_START("DSW2") // bitswapped - PORT_DIPNAME( 0x01, 0x01, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:1") - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x01, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, DEF_STR( Controls ) ) PORT_DIPLOCATION("SW2:2") - PORT_DIPSETTING( 0x02, "Keyboard" ) - PORT_DIPSETTING( 0x00, DEF_STR( Joystick ) ) - PORT_DIPNAME( 0x04, 0x04, "Continue To Play" ) PORT_DIPLOCATION("SW2:3") - PORT_DIPSETTING( 0x04, DEF_STR( Yes ) ) - PORT_DIPSETTING( 0x00, DEF_STR( No ) ) - PORT_DIPNAME( 0x18, 0x18, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW2:4,5") + PORT_DIPNAME( 0x01, 0x01, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:1") // 示範音樂 + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) // 無 + PORT_DIPSETTING( 0x01, DEF_STR( On ) ) // 有 + PORT_DIPNAME( 0x02, 0x02, DEF_STR( Controls ) ) PORT_DIPLOCATION("SW2:2") // 操作方式 + PORT_DIPSETTING( 0x02, "Mahjong" ) // 按鍵 + PORT_DIPSETTING( 0x00, DEF_STR( Joystick ) ) // 搖桿 + PORT_DIPNAME( 0x04, 0x04, "Double Up Game" ) PORT_DIPLOCATION("SW2:3") // 續玩遊戲 + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) // 無 + PORT_DIPSETTING( 0x04, DEF_STR( On ) ) // 有 + PORT_DIPNAME( 0x18, 0x18, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW2:4,5") // 投幣比率 PORT_DIPSETTING( 0x00, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0x18, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x10, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x08, DEF_STR( 1C_3C ) ) - PORT_DIPNAME( 0xe0, 0xe0, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:6,7,8") - PORT_DIPSETTING( 0xe0, "1" ) - PORT_DIPSETTING( 0xc0, "2" ) - PORT_DIPSETTING( 0xa0, "5" ) - PORT_DIPSETTING( 0x80, "6" ) - PORT_DIPSETTING( 0x60, "7" ) - PORT_DIPSETTING( 0x40, "8" ) - PORT_DIPSETTING( 0x20, "9" ) - PORT_DIPSETTING( 0x00, "10" ) + PORT_DIPNAME( 0xe0, 0xe0, "Coin Out Rate" ) PORT_DIPLOCATION("SW2:6,7,8") // 退幣比率 + PORT_DIPSETTING( 0xe0, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0xc0, DEF_STR( 2C_1C ) ) + PORT_DIPSETTING( 0xa0, DEF_STR( 5C_1C ) ) + PORT_DIPSETTING( 0x80, DEF_STR( 6C_1C ) ) + PORT_DIPSETTING( 0x60, DEF_STR( 7C_1C ) ) + PORT_DIPSETTING( 0x40, DEF_STR( 8C_1C ) ) + PORT_DIPSETTING( 0x20, DEF_STR( 9C_1C ) ) + PORT_DIPSETTING( 0x00, "10 Coins/1 Credit" ) PORT_START("COINS") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // hopper switch - PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_LOW ) // test mode (keep pressed during boot too) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) // press with the above for sound test - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5) // coin error otherwise - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Pay Out") PORT_CODE(KEYCODE_O) - PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_NAME("Hide Gambling") // shown in test mode as "clear" (清除), does not work in game? - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // 哈巴 + PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_LOW ) // 測試 (hold on start for input test) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) // 查帳 + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5) PORT_CONDITION("DSW1", 0x10, EQUALS, 0x10) // 投幣 + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) PORT_CONDITION("DSW1", 0x10, EQUALS, 0x00) // 投幣 + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) PORT_CONDITION("DSW1", 0x20, EQUALS, 0x20) // 退幣 + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) PORT_CONDITION("DSW1", 0x20, EQUALS, 0x00) // 退幣 + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Show Credits") // 清除 (hold to show credits/bets/wins when hidden) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("KEY0") // Keyboard mode: diff --git a/src/mame/igs/igs_m027.cpp b/src/mame/igs/igs_m027.cpp index f40213766b4..ebd252b987a 100644 --- a/src/mame/igs/igs_m027.cpp +++ b/src/mame/igs/igs_m027.cpp @@ -96,6 +96,7 @@ public: 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 lthyp(machine_config &config) ATTR_COLD; void zhongguo(machine_config &config) ATTR_COLD; void mgzz(machine_config &config) ATTR_COLD; @@ -110,7 +111,7 @@ public: void init_cjddz() ATTR_COLD; void init_cjddzp() ATTR_COLD; void init_cjddzlf() ATTR_COLD; - void init_stljp() ATTR_COLD; + void init_cjtljp() ATTR_COLD; void init_zhongguo() ATTR_COLD; void init_klxyj() ATTR_COLD; void init_slqz3() ATTR_COLD; @@ -329,6 +330,51 @@ void igs_m027_state::oki_128k_map(address_map &map) PORT_DIPSETTING( 0x01, "20" ) \ PORT_DIPSETTING( 0x00, "20" ) +#define DDZ_IO_COMMON(port, mask) \ + PORT_INCLUDE(igs_mahjong_matrix) \ + 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(port, mask, EQUALS, mask) /* 投币 */ \ + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION(port, mask, EQUALS, 0x00) \ + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) \ + 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( 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(port, mask, EQUALS, mask) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) /* HPSW./HP */ \ + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION(port, mask, EQUALS, mask) \ + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION(port, mask, EQUALS, 0x00) \ + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CONDITION(port, mask, EQUALS, 0x00) /* 投币 */ \ + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) /* 右 */ \ + PORT_START("PLAYER") \ + 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(port, mask, EQUALS, mask) \ + PORT_BIT( 0x00040, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CONDITION(port, mask, EQUALS, 0x00) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) /* HPSW./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("CLEARMEM") \ + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) PORT_TOGGLE \ + PORT_START("PPIB") \ + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_CONDITION(port, mask, EQUALS, mask) PORT_WRITE_LINE_MEMBER(igs_m027_state, counter_w<1>) /* key-out */ \ + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_CONDITION(port, mask, EQUALS, mask) PORT_WRITE_LINE_MEMBER(igs_m027_state, counter_w<2>) /* hopper */ \ + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_CONDITION(port, mask, EQUALS, mask) PORT_WRITE_LINE_MEMBER(igs_m027_state, counter_w<0>) /* key-in */ \ + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_CONDITION(port, mask, EQUALS, 0x00) PORT_WRITE_LINE_DEVICE_MEMBER("hopper", hopper_device, motor_w) \ + PORT_START("PPIC") \ + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_CONDITION(port, mask, EQUALS, mask) PORT_WRITE_LINE_DEVICE_MEMBER("hopper", hopper_device, motor_w) \ + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_CONDITION(port, mask, EQUALS, 0x00) PORT_WRITE_LINE_MEMBER(igs_m027_state, counter_w<0>) /* coin or key-in */ \ + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_CONDITION(port, mask, EQUALS, 0x00) PORT_WRITE_LINE_MEMBER(igs_m027_state, counter_w<1>) /* hopper or key-out */ + INPUT_PORTS_START( base ) PORT_START("CLEARMEM") @@ -491,9 +537,9 @@ INPUT_PORTS_START( three_reel ) PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) PORT_TOGGLE INPUT_PORTS_END -INPUT_PORTS_START( slqz3_dip_switches ) +INPUT_PORTS_START( mahjong_credit_dip_switches ) PORT_START("DSW1") - PORT_DIPNAME( 0x03, 0x03, DEF_STR(Coin_A) ) PORT_DIPLOCATION("SW1:1,2") // 投币比率 + PORT_DIPNAME( 0x03, 0x03, DEF_STR(Coinage) ) PORT_DIPLOCATION("SW1:1,2") // 投币比率 PORT_DIPSETTING( 0x03, DEF_STR(1C_1C) ) PORT_DIPSETTING( 0x02, DEF_STR(1C_2C) ) PORT_DIPSETTING( 0x01, DEF_STR(1C_3C) ) @@ -507,7 +553,7 @@ INPUT_PORTS_START( slqz3_dip_switches ) PORT_DIPSETTING( 0x10, "1000" ) PORT_DIPSETTING( 0x00, "2000" ) PORT_DIPNAME( 0x20, 0x20, "Credit Mode" ) PORT_DIPLOCATION("SW1:6") // 进分方式 (sets coin input function) - PORT_DIPSETTING( 0x20, "Coin Acceptor" ) // 投币 (uses coin A rate) + PORT_DIPSETTING( 0x20, "Coin Acceptor" ) // 投币 (uses coin rate) PORT_DIPSETTING( 0x00, "Key-In" ) // 开分 (uses key-in rate) PORT_DIPNAME( 0x40, 0x40, "Payout Mode" ) PORT_DIPLOCATION("SW1:7") // 退分方式 PORT_DIPSETTING( 0x40, "Return Coins" ) // 退币 (uses hopper to pay out credits) @@ -515,6 +561,10 @@ INPUT_PORTS_START( slqz3_dip_switches ) PORT_DIPNAME( 0x80, 0x80, DEF_STR(Demo_Sounds) ) PORT_DIPLOCATION("SW1:8") // 示范音乐 PORT_DIPSETTING( 0x00, DEF_STR(Off) ) // 无 PORT_DIPSETTING( 0x80, DEF_STR(On) ) // 有 +INPUT_PORTS_END + +INPUT_PORTS_START( slqz3_dip_switches ) + PORT_INCLUDE(mahjong_credit_dip_switches) PORT_START("DSW2") PORT_DIPNAME( 0x03, 0x03, "Double Up Jackpot" ) PORT_DIPLOCATION("SW2:1,2") // 比倍爆机 @@ -709,7 +759,7 @@ INPUT_PORTS_START( qlgs ) PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "SW1:8" ) PORT_START("DSW2") - PORT_DIPNAME( 0x01, 0x01, "Control Panel" ) PORT_DIPLOCATION("SW2:1") // 操作方式 + PORT_DIPNAME( 0x01, 0x01, DEF_STR(Controls) ) PORT_DIPLOCATION("SW2:1") // 操作方式 PORT_DIPSETTING( 0x01, "Mahjong" ) // 麻將 PORT_DIPSETTING( 0x00, DEF_STR(Joystick) ) // 搖桿 PORT_DIPNAME( 0x02, 0x02, DEF_STR(Demo_Sounds) ) PORT_DIPLOCATION("SW2:2") // 示範音樂 @@ -774,63 +824,16 @@ INPUT_PORTS_START( lhzb3sjb ) PORT_DIPNAME( 0x04, 0x04, "Show Title" ) PORT_DIPLOCATION("SW2:3") // 机种名称 PORT_DIPSETTING( 0x00, DEF_STR(Off) ) // 无 (game title not shown) PORT_DIPSETTING( 0x04, DEF_STR(On) ) // 有 - PORT_DIPNAME( 0x08, 0x08, "Control Panel" ) PORT_DIPLOCATION("SW2:4") // 操作配线 + PORT_DIPNAME( 0x08, 0x08, DEF_STR(Controls) ) PORT_DIPLOCATION("SW2:4") // 操作配线 PORT_DIPSETTING( 0x08, "Mahjong" ) // 麻将 PORT_DIPSETTING( 0x00, DEF_STR(Joystick) ) // 娱乐 INPUT_PORTS_END INPUT_PORTS_START( lhzb4 ) - PORT_INCLUDE( igs_mahjong_matrix ) - - 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_START("JOY") - 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_START("PLAYER") - 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("CLEARMEM") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) PORT_TOGGLE - - 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 - PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x01) PORT_WRITE_LINE_MEMBER(igs_m027_state, counter_w<1>) // key-out - PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x01) PORT_WRITE_LINE_MEMBER(igs_m027_state, counter_w<0>) // key-in - PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x00) PORT_WRITE_LINE_DEVICE_MEMBER("hopper", hopper_device, motor_w) - - PORT_START("PPIC") - PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x01) PORT_WRITE_LINE_DEVICE_MEMBER("hopper", hopper_device, motor_w) - PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x00) PORT_WRITE_LINE_MEMBER(igs_m027_state, counter_w<0>) // coin or key-in - PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x00) PORT_WRITE_LINE_MEMBER(igs_m027_state, counter_w<1>) // hopper or key-out + DDZ_IO_COMMON("DSW1", 0x01) PORT_START("DSW1") - PORT_DIPNAME( 0x01, 0x01, "Control Panel" ) PORT_DIPLOCATION("SW1:1") + PORT_DIPNAME( 0x01, 0x01, DEF_STR(Controls) ) PORT_DIPLOCATION("SW1:1") PORT_DIPSETTING( 0x01, DEF_STR(Joystick) ) // called JAMMA PORT_DIPSETTING( 0x00, "Mahjong" ) // called Keyboard PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x02, "SW1:2" ) // remaining DIP switches not shown in test mode @@ -876,7 +879,7 @@ INPUT_PORTS_START( lthyp ) PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "SW1:8" ) PORT_START("DSW2") - PORT_DIPNAME( 0x01, 0x01, "Control Panel" ) PORT_DIPLOCATION("SW2:1") // 操作模式 + PORT_DIPNAME( 0x01, 0x01, DEF_STR(Controls) ) PORT_DIPLOCATION("SW2:1") // 操作模式 PORT_DIPSETTING( 0x01, "Mahjong" ) // 按键 PORT_DIPSETTING( 0x00, DEF_STR(Joystick) ) // 揺杆 PORT_DIPNAME( 0x02, 0x02, DEF_STR(Demo_Sounds) ) PORT_DIPLOCATION("SW2:2") // 示范音乐 @@ -896,36 +899,13 @@ INPUT_PORTS_END INPUT_PORTS_START( zhongguo ) PORT_INCLUDE(mahjong_kbd_joy) + PORT_INCLUDE(mahjong_credit_dip_switches) PORT_MODIFY("TEST") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // 哈巴 - PORT_START("DSW1") - PORT_DIPNAME( 0x03, 0x03, DEF_STR(Coin_A) ) PORT_DIPLOCATION("SW1:1,2") // 投币比率 - PORT_DIPSETTING( 0x03, DEF_STR(1C_1C) ) - PORT_DIPSETTING( 0x02, DEF_STR(1C_2C) ) - PORT_DIPSETTING( 0x01, DEF_STR(1C_3C) ) - PORT_DIPSETTING( 0x00, DEF_STR(1C_5C) ) - PORT_DIPNAME( 0x0c, 0x0c, "Key-In Rate" ) PORT_DIPLOCATION("SW1:3,4") // 开分比率 - PORT_DIPSETTING( 0x0c, "10" ) - PORT_DIPSETTING( 0x08, "20" ) - PORT_DIPSETTING( 0x04, "50" ) - PORT_DIPSETTING( 0x00, "100" ) - PORT_DIPNAME( 0x10, 0x10, "Credit Limit" ) PORT_DIPLOCATION("SW1:5") // 进分上限 - PORT_DIPSETTING( 0x10, "1000" ) - PORT_DIPSETTING( 0x00, "2000" ) - PORT_DIPNAME( 0x20, 0x20, "Credit Mode" ) PORT_DIPLOCATION("SW1:6") // 进分上方式 (sets coin input function) - PORT_DIPSETTING( 0x20, "Coin Acceptor" ) // 投币 (uses coin A rate) - PORT_DIPSETTING( 0x00, "Key-In" ) // 开分 (uses key-in rate) - PORT_DIPNAME( 0x40, 0x40, "Payout Mode" ) PORT_DIPLOCATION("SW1:7") // 退分上方式 - PORT_DIPSETTING( 0x40, "Return Coins" ) // 退币 (uses hopper to pay out credits) - PORT_DIPSETTING( 0x00, "Key-Out" ) // 洗分 (just clears credits) - PORT_DIPNAME( 0x80, 0x80, DEF_STR(Demo_Sounds) ) PORT_DIPLOCATION("SW1:8") // 示范音乐 - PORT_DIPSETTING( 0x00, DEF_STR(Off) ) // 无 - PORT_DIPSETTING( 0x80, DEF_STR(On) ) // 有 - PORT_START("DSW2") - PORT_DIPNAME( 0x01, 0x01, "Control Panel" ) PORT_DIPLOCATION("SW2:1") // 操作模式 + PORT_DIPNAME( 0x01, 0x01, DEF_STR(Controls) ) PORT_DIPLOCATION("SW2:1") // 操作模式 PORT_DIPSETTING( 0x01, "Mahjong" ) // 按键 PORT_DIPSETTING( 0x00, DEF_STR(Joystick) ) // 搖杆 PORT_DIPNAME( 0x06, 0x06, "Card Display" ) PORT_DIPLOCATION("SW2:2,3") // 扑克画面 @@ -962,16 +942,16 @@ INPUT_PORTS_START( mgzz101cn ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) PORT_START("DSW1") - PORT_DIPNAME( 0x01, 0x01, DEF_STR(Allow_Continue) ) PORT_DIPLOCATION("SW1:1") // 續玩遊戲 - PORT_DIPSETTING( 0x00, DEF_STR(Off) ) // 無 + PORT_DIPNAME( 0x01, 0x01, "Double Up Game" ) PORT_DIPLOCATION("SW1:1") // 續玩遊戲 + PORT_DIPSETTING( 0x00, DEF_STR(Off) ) // 無 (no double up game on win but can still play double up game by pressing A or button 1 at the bet screen) PORT_DIPSETTING( 0x01, DEF_STR(On) ) // 有 - PORT_DIPNAME( 0x02, 0x02, "Control Panel" ) PORT_DIPLOCATION("SW1:2") // 操作方式 + PORT_DIPNAME( 0x02, 0x02, DEF_STR(Controls) ) PORT_DIPLOCATION("SW1:2") // 操作方式 PORT_DIPSETTING( 0x02, "Mahjong" ) // 按鍵 (called "MAHJONG" in input test) PORT_DIPSETTING( 0x00, DEF_STR(Joystick) ) // 搖桿 (called "JAMMA" in input test) PORT_DIPNAME( 0x04, 0x04, DEF_STR(Demo_Sounds) ) PORT_DIPLOCATION("SW1:3") // 示範音樂 PORT_DIPSETTING( 0x00, DEF_STR(Off) ) // 無 PORT_DIPSETTING( 0x04, DEF_STR(On) ) // 有 - PORT_DIPNAME( 0x18, 0x18, DEF_STR(Coin_A) ) PORT_DIPLOCATION("SW1:4,5") // 投币比率 + PORT_DIPNAME( 0x18, 0x18, DEF_STR(Coinage) ) PORT_DIPLOCATION("SW1:4,5") // 投币比率 PORT_DIPSETTING( 0x00, DEF_STR(1C_2C) ) PORT_DIPSETTING( 0x08, DEF_STR(1C_2C) ) PORT_DIPSETTING( 0x10, DEF_STR(1C_5C) ) @@ -1072,7 +1052,7 @@ INPUT_PORTS_START( mgcs3 ) PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "SW1:8" ) PORT_START("DSW2") - PORT_DIPNAME( 0x01, 0x01, "Control Panel" ) PORT_DIPLOCATION("SW2:1") // 配线方式 + PORT_DIPNAME( 0x01, 0x01, DEF_STR(Controls) ) PORT_DIPLOCATION("SW2:1") // 配线方式 PORT_DIPSETTING( 0x01, DEF_STR(Joystick) ) // 娱乐 PORT_DIPSETTING( 0x00, "Mahjong" ) // 麻将 PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x02, "SW2:2" ) @@ -1095,61 +1075,13 @@ INPUT_PORTS_START( mgcs3 ) INPUT_PORTS_END INPUT_PORTS_START( cjddz ) - PORT_INCLUDE(igs_mahjong_matrix) - - 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", 0x02, EQUALS, 0x02) // 投币 - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW1", 0x02, EQUALS, 0x00) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) - 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( 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", 0x02, EQUALS, 0x02) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // HPSW. - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW1", 0x02, EQUALS, 0x02) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW1", 0x02, EQUALS, 0x00) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CONDITION("DSW1", 0x02, EQUALS, 0x00) // 投币 - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) // 右 - - PORT_START("PLAYER") - 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("CLEARMEM") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) PORT_TOGGLE - - 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 - PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_CONDITION("DSW1", 0x02, EQUALS, 0x02) PORT_WRITE_LINE_MEMBER(igs_m027_state, counter_w<2>) // hopper - PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_CONDITION("DSW1", 0x02, EQUALS, 0x02) PORT_WRITE_LINE_MEMBER(igs_m027_state, counter_w<0>) // key-in - PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_CONDITION("DSW1", 0x02, EQUALS, 0x00) PORT_WRITE_LINE_DEVICE_MEMBER("hopper", hopper_device, motor_w) - - PORT_START("PPIC") - PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_CONDITION("DSW1", 0x02, EQUALS, 0x02) PORT_WRITE_LINE_DEVICE_MEMBER("hopper", hopper_device, motor_w) - PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_CONDITION("DSW1", 0x02, EQUALS, 0x00) PORT_WRITE_LINE_MEMBER(igs_m027_state, counter_w<0>) // coin or key-in - PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_CONDITION("DSW1", 0x02, EQUALS, 0x00) PORT_WRITE_LINE_MEMBER(igs_m027_state, counter_w<1>) // hopper or key-out + DDZ_IO_COMMON("DSW1", 0x02) PORT_START("DSW1") PORT_DIPNAME( 0x01, 0x01, DEF_STR(Demo_Sounds) ) PORT_DIPLOCATION("SW1:1") // 示范音乐 PORT_DIPSETTING( 0x00, DEF_STR(Off) ) // 无 PORT_DIPSETTING( 0x01, DEF_STR(On) ) // 有 - PORT_DIPNAME( 0x02, 0x02, "Control Panel" ) PORT_DIPLOCATION("SW1:2") // 配线方式 + PORT_DIPNAME( 0x02, 0x02, DEF_STR(Controls) ) PORT_DIPLOCATION("SW1:2") // 配线方式 PORT_DIPSETTING( 0x02, DEF_STR(Joystick) ) // 娱乐 PORT_DIPSETTING( 0x00, "Mahjong" ) // 麻将 PORT_DIPNAME( 0x04, 0x04, "Double Up Game" ) PORT_DIPLOCATION("SW1:3") // 续玩游戏 @@ -1187,55 +1119,7 @@ INPUT_PORTS_START( cjddz ) INPUT_PORTS_END INPUT_PORTS_START( cjddzp ) - PORT_INCLUDE(igs_mahjong_matrix) - - 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("DSW2", 0x02, EQUALS, 0x02) // 投币 - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x02, EQUALS, 0x00) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) - 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( 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("DSW2", 0x02, EQUALS, 0x02) PORT_READ_LINE_DEVICE_MEMBER("hopper", hopper_device, line_r) // HPSW. - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x02, EQUALS, 0x02) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x02, EQUALS, 0x00) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CONDITION("DSW2", 0x02, EQUALS, 0x00) // 投币 - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) // 右 - - PORT_START("PLAYER") - 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", 0x02, EQUALS, 0x02) - PORT_BIT( 0x00040, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CONDITION("DSW2", 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("CLEARMEM") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) PORT_TOGGLE - - PORT_START("PPIB") - PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_CONDITION("DSW2", 0x02, EQUALS, 0x02) PORT_WRITE_LINE_MEMBER(igs_m027_state, counter_w<1>) // key-out - PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_CONDITION("DSW2", 0x02, EQUALS, 0x02) PORT_WRITE_LINE_MEMBER(igs_m027_state, counter_w<2>) // hopper - PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_CONDITION("DSW2", 0x02, EQUALS, 0x02) PORT_WRITE_LINE_MEMBER(igs_m027_state, counter_w<0>) // key-in - PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_CONDITION("DSW2", 0x02, EQUALS, 0x00) PORT_WRITE_LINE_DEVICE_MEMBER("hopper", hopper_device, motor_w) - - PORT_START("PPIC") - PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_CONDITION("DSW2", 0x02, EQUALS, 0x02) PORT_WRITE_LINE_DEVICE_MEMBER("hopper", hopper_device, motor_w) - PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_CONDITION("DSW2", 0x02, EQUALS, 0x00) PORT_WRITE_LINE_MEMBER(igs_m027_state, counter_w<0>) // coin or key-in - PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_CONDITION("DSW2", 0x02, EQUALS, 0x00) PORT_WRITE_LINE_MEMBER(igs_m027_state, counter_w<1>) // hopper or key-out + DDZ_IO_COMMON("DSW2", 0x02) PORT_START("DSW1") PORT_DIPNAME( 0x1f, 0x1f, "Satellite Machine No." ) PORT_DIPLOCATION("SW1:1,2,3,4,5") // 副机台號 @@ -1250,7 +1134,7 @@ INPUT_PORTS_START( cjddzp ) PORT_DIPNAME( 0x01, 0x01, DEF_STR(Demo_Sounds) ) PORT_DIPLOCATION("SW2:1") // 示范音乐 PORT_DIPSETTING( 0x00, DEF_STR(Off) ) // 无 PORT_DIPSETTING( 0x01, DEF_STR(On) ) // 有 - PORT_DIPNAME( 0x02, 0x02, "Control Panel" ) PORT_DIPLOCATION("SW2:2") // 配线方式 + PORT_DIPNAME( 0x02, 0x02, DEF_STR(Controls) ) PORT_DIPLOCATION("SW2:2") // 配线方式 PORT_DIPSETTING( 0x02, DEF_STR(Joystick) ) // 娱乐 PORT_DIPSETTING( 0x00, "Mahjong" ) // 麻将 PORT_DIPNAME( 0x04, 0x04, "Double Up Game" ) PORT_DIPLOCATION("SW2:3") // 续玩游戏 @@ -1929,6 +1813,13 @@ void igs_m027_state::lhzb4(machine_config &config) m_oki->set_clock(2'000'000); } +void igs_m027_state::cjtljp(machine_config &config) +{ + cjddz(config); + + m_oki->set_clock(1'500'000); +} + void igs_m027_state::lthyp(machine_config &config) { m027_1ppi(config); @@ -2995,9 +2886,8 @@ ROM_START( cjddzlf ) ROM_LOAD( "igs_l2404.u5", 0x00000, 0x200000, CRC(55f6dfac) SHA1(876bec8db5aa3dfd10869ecdcd98bccb2ef860ef) ) ROM_END -// Super Tuo La Ji Plus - -ROM_START( stljp ) +// 超级拖拉机 加强版 (Chāojí Tuōlājī Jiāqiáng Bǎn) +ROM_START( cjtljp ) ROM_REGION( 0x04000, "maincpu", 0 ) // Internal ROM of IGS027A ARM based MCU ROM_LOAD( "t5_igs027a", 0x00000, 0x4000, CRC(351d8658) SHA1(10d3aac884c43a2f9c58550887cd055576a354cd) ) @@ -3187,9 +3077,9 @@ void igs_m027_state::init_cjddzlf() m_igs017_igs031->tarzan_decrypt_sprites(0x400000, 0x400000); } -void igs_m027_state::init_stljp() +void igs_m027_state::init_cjtljp() { - stljp_decrypt(machine()); + cjtljp_decrypt(machine()); m_igs017_igs031->sdwx_gfx_decrypt(); m_igs017_igs031->tarzan_decrypt_sprites(0, 0); } @@ -3350,7 +3240,7 @@ GAME( 200?, cjddz217cn, cjddz, cjddz, cjddz, igs_m027_stat GAME( 200?, cjddz215cn, cjddz, cjddz, cjddz, igs_m027_state, init_cjddz, ROT0, "IGS", "Chaoji Dou Dizhu (V215CN)", 0 ) GAME( 200?, cjddzp, 0, cjddz, cjddzp, igs_m027_state, init_cjddzp, ROT0, "IGS", "Chaoji Dou Dizhu Jiaqiang Ban (S300CN)", MACHINE_NODEVICE_LAN ) GAME( 200?, cjddzlf, 0, cjddz, cjddz, igs_m027_state, init_cjddzlf, ROT0, "IGS", "Chaoji Dou Dizhu Liang Fu Pai (V109CN)", 0 ) -GAME( 2005, stljp, 0, cjddz, cjddz, igs_m027_state, init_stljp, ROT0, "IGS", "Super Tuo La Ji Plus (V206CN)", MACHINE_NOT_WORKING ) // 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 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 ) diff --git a/src/mame/igs/pgmcrypt.cpp b/src/mame/igs/pgmcrypt.cpp index 97cf1cb01de..148cdedec62 100644 --- a/src/mame/igs/pgmcrypt.cpp +++ b/src/mame/igs/pgmcrypt.cpp @@ -1897,7 +1897,7 @@ void cjddzlf_decrypt(running_machine &machine) } } -void mxsqy_decrypt(running_machine &machine) +void cjtljp_decrypt(running_machine &machine) { memory_region *const region = machine.root_device().memregion("user1"); auto const src = util::little_endian_cast(reinterpret_cast(region->base())); @@ -1907,8 +1907,7 @@ void mxsqy_decrypt(running_machine &machine) { uint16_t x = 0; - // this part is the same as luckycrs - IGS27_CRYPT1_ALT + IGS27_CRYPT1 IGS27_CRYPT2 IGS27_CRYPT3 IGS27_CRYPT4_ALT @@ -1921,7 +1920,7 @@ void mxsqy_decrypt(running_machine &machine) } } -void stljp_decrypt(running_machine &machine) +void mxsqy_decrypt(running_machine &machine) { memory_region *const region = machine.root_device().memregion("user1"); auto const src = util::little_endian_cast(reinterpret_cast(region->base())); @@ -1931,7 +1930,8 @@ void stljp_decrypt(running_machine &machine) { uint16_t x = 0; - IGS27_CRYPT1 + // this part is the same as luckycrs + IGS27_CRYPT1_ALT IGS27_CRYPT2 IGS27_CRYPT3 IGS27_CRYPT4_ALT diff --git a/src/mame/igs/pgmcrypt.h b/src/mame/igs/pgmcrypt.h index 617ed718c3a..a15f3b5ce18 100644 --- a/src/mame/igs/pgmcrypt.h +++ b/src/mame/igs/pgmcrypt.h @@ -60,7 +60,7 @@ void lthyp_decrypt(running_machine &machine); void tripslot_decrypt(running_machine &machine); void extradrw_decrypt(running_machine &machine); void cjddzlf_decrypt(running_machine &machine); +void cjtljp_decrypt(running_machine& machine); void mxsqy_decrypt(running_machine& machine); -void stljp_decrypt(running_machine& machine); #endif // MAME_IGS_PGMCRYPT_H diff --git a/src/mame/mame.lst b/src/mame/mame.lst index a898bf3ec86..27dd94a944c 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -20332,6 +20332,7 @@ cjddz215cn // (c) 200? cjddz217cn // (c) 200? cjddzlf // (c) 200? cjddzp // (c) 200? +cjtljp // (c) 2005 extradrw // (c) 200? fruitpar // (c) 1999 fruitpar206us // (c) 1999 @@ -20358,7 +20359,6 @@ tripslot // (c) 2007 qlgs // (c) 1999 sdwx // (c) 2002 slqz3 // (c) 1999 -stljp // (c) 2005 zhongguo // (c) 2000 @source:igs/igs_m027_023vid.cpp -- cgit v1.2.3