From 964b3f9b8474e43b6dd5d00816fc8c27118dc239 Mon Sep 17 00:00:00 2001 From: cracyc Date: Thu, 17 Oct 2024 22:37:00 -0500 Subject: [PATCH 1/5] pc98.xml: convert fix format images to d88 except ones that don't work --- hash/pc98.xml | 98 +++++++++++++++++++++------------------------------ 1 file changed, 40 insertions(+), 58 deletions(-) diff --git a/hash/pc98.xml b/hash/pc98.xml index e94c5fb2f97..f79a0d6adfd 100644 --- a/hash/pc98.xml +++ b/hash/pc98.xml @@ -50309,6 +50309,7 @@ Fails booting with normal display dip setting "Illegal function call 1830" in BA サムシンググッド (Something Good) @@ -50570,22 +50571,18 @@ Hangs at Cross Media Soft logo, triggers [FDC] XTMASK irq Beast Lord II 1992 ホビージャパン (Hobby Japan) - - - + + - - + + @@ -51893,27 +51890,24 @@ Has non working optional RS-MIDI thru SQS -S CLI switch (will hang game if used) The Golem Master 1993 シュールド・ウェーブ (Sur De Wave) - - - + + - - + + - - + + @@ -52197,21 +52191,18 @@ Black screen, wants [FDC] XTMASK irq Hyper Mahjong Mangan Zenseki 1993 河合楽器制作所 (Kawai Gakki Seisakushou) - - - + + - - + + @@ -52322,21 +52313,18 @@ unsupported .fix format J. League Hyper Soccer - Wave no Arashi 1993 C^2 World - - - + + - - + + @@ -54100,22 +54088,18 @@ Black screen, wants 2DD dip ON? Nihon Juudan Cessna Flight 1988 コムパック (Compac) - - - + + - - + + @@ -54155,13 +54139,10 @@ May require 3.5" floppy drive Okuman Chouja 1988 コスモス・コンピュータ (Cosmos Computer) - - - + + @@ -55336,18 +55317,21 @@ unsupported .fix format Slip Stream '92 1992 ビットタウン (Bit Town) + - - + + - - + + @@ -55434,13 +55418,13 @@ unsupported .fix format 1988 ゲームアーツ (Game Arts) - - + + @@ -55530,21 +55514,18 @@ unsupported .fix format Star Command 1989 ヒューリンクス (Hulinks) - - - + + - - + + @@ -56111,6 +56092,7 @@ unsupported .fix format グレイト (Great) From b34b632087025b729de29aef590e22e3546e6df7 Mon Sep 17 00:00:00 2001 From: cracyc Date: Fri, 18 Oct 2024 09:19:07 -0500 Subject: [PATCH 2/5] pc98.xml: replace aigo3 with d88 image --- hash/pc98.xml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/hash/pc98.xml b/hash/pc98.xml index f79a0d6adfd..1f64237c957 100644 --- a/hash/pc98.xml +++ b/hash/pc98.xml @@ -50308,14 +50308,13 @@ Fails booting with normal display dip setting "Illegal function call 1830" in BA 1990 サムシンググッド (Something Good) - - + + From 8b46595df803b0935c5f11b2e426f0accdb57e81 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Sat, 19 Oct 2024 06:33:54 +1100 Subject: [PATCH 3/5] -igs/igs_m027_023vid.cpp: Hooked up I/O for Mingxing San Que Yi. -igs/igs017.cpp, igs/igs_m027.cpp: Added notes about game controls. --- src/mame/igs/igs017.cpp | 44 ++--- src/mame/igs/igs_m027.cpp | 39 ++++- src/mame/igs/igs_m027_023vid.cpp | 266 ++++++++++++++++++++----------- 3 files changed, 236 insertions(+), 113 deletions(-) diff --git a/src/mame/igs/igs017.cpp b/src/mame/igs/igs017.cpp index c2102d910c7..0aaaf9577ce 100644 --- a/src/mame/igs/igs017.cpp +++ b/src/mame/igs/igs017.cpp @@ -46,29 +46,35 @@ To Do: - Test mode is usually accessed by keeping test (F2) pressed during boot. - The sound test is often accessed by holding test (F2) and bookkeeping (0) at the I/O test screen. +- The default bookkeeping password is often Start eight times. +- Some games (e.g. Tarzan Chuan Tian Guan) refer to the double-up game as 续玩 (literally "Continue Play"), + so settings like 续玩有无 refer to the double-up game, not a conventional "continue" feature. - iqblocka: keep start (1) pressed during boot for DSWs & input test. Keep test (F2) pressed for bookkeeping / setup [pass: press deal (2)]. - iqblockf/genius6: press service1 (9) then press deal (2) eight times to switch to gambling. Then test (F2) enters book-keeping / setup. - lhzb2, mgcs, slqz2, tjsb: press test (F2) + book (0) during inputs test for sound test. - mgdh, sdmg2: press keys A + B during test mode for sound test (B1 + B2 + B3 when using a joystick in mgdh). - spkrform: to switch from poker to Formosa press service1 (9). To switch back, press in sequence: service3 (right of 0) then Bet (M) then press "Hold 1".."Hold 5" (Z, X, C, V, B) -- Tarzan Chuang Tian Guan controls: - Start Start Stop All Take Score - Mahjong Bet Bet - Mahjong A Show Odds Stop 1 Double Up (twice winnings) - Mahjong B Stop 2 - Mahjong C Stop 3 Double Up (winnings) - Mahjong D Stop 4 - Mahjong E Double Up (half winnings) - Mahjong K Big - Mahjong M Small - Up Stop 1 - Down Stop 2 - Left Stop 3 - Right Stop 4 - Button 1 Show Odds Big Double Up (twice winnings) - Button 2 Bet Double Up (winnings) - Button 3 Small Double Up (half winnings) +- Tarzan Chuang Tian Guan mahjong controls: + Mahjong keyboard: + Start Start Stop All Take Score + Mahjong Bet Bet + Mahjong A Show Odds Stop 1 Double Up (twice winnings) + Mahjong B Stop 2 + Mahjong C Stop 3 Double Up (winnings) + Mahjong D Stop 4 + Mahjong E Double Up (half winnings) + Mahjong K Big + Mahjong M Small + Joystick: + Up Stop 1 + Down Stop 2 + Left Stop 3 + Right Stop 4 + Start Start Stop All Take Score + Button 1 Show Odds Big Double Up (twice winnings) + Button 2 Bet Double Up (winnings) + Button 3 Small Double Up (half winnings) ************************************************************************************************************/ @@ -3958,7 +3964,7 @@ static INPUT_PORTS_START( tarzan ) PORT_START("MATRIX") PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CONDITION("DSW3", 0x01, EQUALS, 0x01) PORT_CUSTOM_MEMBER(NAME((&igs017_state::keys_ipt_r))) - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) PORT_CONDITION("DSW3", 0x01, EQUALS, 0x00) PORT_NAME("Start / Stop All") // 开始 + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) PORT_CONDITION("DSW3", 0x01, EQUALS, 0x00) PORT_NAME("Start / Stop All / Take Score") // 开始 PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SLOT_STOP1 ) PORT_CONDITION("DSW3", 0x01, EQUALS, 0x00) PORT_NAME("Up / Stop 1") // 上 PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SLOT_STOP2 ) PORT_CONDITION("DSW3", 0x01, EQUALS, 0x00) PORT_NAME("Down / Stop 2") // 下 PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SLOT_STOP3 ) PORT_CONDITION("DSW3", 0x01, EQUALS, 0x00) PORT_NAME("Left / Stop 3") // 左 @@ -4314,7 +4320,7 @@ void igs017_state::tarzan(machine_config &config) m_maincpu->set_addrmap(AS_OPCODES, &igs017_state::decrypted_opcodes_map); TIMER(config, "scantimer").configure_scanline(FUNC(igs017_state::iqblocka_interrupt), "screen", 0, 1); - // i/o + // I/O m_igs_mux->set_addrmap(0, &igs017_state::tarzan_mux_map); m_igs017_igs031->in_pa_callback().set_ioport("COINS"); diff --git a/src/mame/igs/igs_m027.cpp b/src/mame/igs/igs_m027.cpp index 18637022893..ee084de24cd 100644 --- a/src/mame/igs/igs_m027.cpp +++ b/src/mame/igs/igs_m027.cpp @@ -38,9 +38,46 @@ Ron, Take Score, Big and Small, respectively (as shown on-screen), but there doesn't seem to be an alternate button to cancel all. + Most of the games with joystick controls show instructions after + coining up. The controls are fairly consistent between games. + + Mahjong joystick controls: + Left select tile to draw/discard 选择要摸舍的牌 + Right select tile to draw/discard 选择要摸舍的牌 + Up select chi/pon/kan/reach/ron 选择吃碰杠听胡 + Down select chi/pon/kan/reach/ron 选择吃碰杠听胡 + Start start 开始 + take score 得分键 + Button 1 draw/discard 摸/舍键 + double up (×2) 双续玩 + big 猜大 + Button 2 bet 押注键 + double up (×1) 续玩 + Button 3 confirm (chi/pon/kan/reach/ron) 确认键(吃碰杠听胡) + double up (×½) 半续玩 + small 猜小 + + Dou Dizhu joystick controls: + Left choose card + Right choose card + Start start 开始 + play cards + take score 得分 + Button 1 select/deselect card + double up (×2) 双续玩 + confirm 确定 + big 猜大 + Button 2 bet + bid 1 一倍 + deselect all + double up (×1) 续玩 + Button 3 pass + double up (×½) 半续玩 + small 猜小 + cancel 放弃 + TODO: * I/O for remaining games - * Coin lockout (zhongguo displays a coin error on unexpected coins) */ #include "emu.h" diff --git a/src/mame/igs/igs_m027_023vid.cpp b/src/mame/igs/igs_m027_023vid.cpp index 3e2fee57a02..7aa1eeebdcf 100644 --- a/src/mame/igs/igs_m027_023vid.cpp +++ b/src/mame/igs/igs_m027_023vid.cpp @@ -52,15 +52,26 @@ class igs_m027_023vid_state : public driver_device m_screen(*this, "screen"), m_palette(*this, "palette"), m_video(*this, "igs023"), - m_ics(*this, "ics") + m_ics(*this, "ics"), + m_hopper(*this, "hopper"), + m_io_clearmem(*this, "CLEARMEM"), + m_io_in(*this, "IN%u", 0U), + m_io_out(*this, "OUT%u", 0U), + m_io_dsw(*this, "DSW%u", 1U), + m_io_kbd(*this, "KEY%u", 0U) { } void m027_023vid(machine_config &config) ATTR_COLD; void init_mxsqy() ATTR_COLD; + ioport_value kbd_r(); + + template void counter_w(int state) { machine().bookkeeping().coin_counter_w(N, state); } + protected: virtual void machine_start() override ATTR_COLD; + virtual void machine_reset() override ATTR_COLD; private: required_region_ptr m_external_rom; @@ -71,14 +82,32 @@ class igs_m027_023vid_state : public driver_device required_device m_palette; required_device m_video; required_device m_ics; + required_device m_hopper; + + required_ioport m_io_clearmem; + required_ioport_array<3> m_io_in; + required_ioport_array<2> m_io_out; + required_ioport_array<3> m_io_dsw; + required_ioport_array<5> m_io_kbd; u32 m_xor_table[0x100]; bool m_irq_source; - u32 external_rom_r(offs_t offset); + u8 m_gpio_out; + u8 m_kbd_sel; + + bool m_first_start; + u32 external_rom_r(offs_t offset); void xor_table_w(offs_t offset, u8 data); + template u16 in_r() { return m_io_in[N]->read(); } + template void out_w(u16 data) { return m_io_out[N]->write(data); } + u16 dsw_r(); + void kbd_w(u16 data); + + void gpio_out_w(u8 data); + TIMER_DEVICE_CALLBACK_MEMBER(interrupt); u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); @@ -90,18 +119,32 @@ class igs_m027_023vid_state : public driver_device template void irq_w(int state); u32 gpio_r(); - - u32 unk0_r() { return 0xffffffff; } - u32 unk1_r() { return 0xffffffff; } }; + void igs_m027_023vid_state::machine_start() { std::fill(std::begin(m_xor_table), std::end(m_xor_table), 0); m_irq_source = 0; + m_gpio_out = 0x1f; + m_kbd_sel = 0x1f; + m_first_start = true; save_item(NAME(m_xor_table)); save_item(NAME(m_irq_source)); + save_item(NAME(m_gpio_out)); + save_item(NAME(m_kbd_sel)); + save_item(NAME(m_first_start)); +} + +void igs_m027_023vid_state::machine_reset() +{ + if (m_first_start) + { + if (!BIT(m_io_clearmem->read(), 0)) + std::fill(std::begin(m_nvram), std::end(m_nvram), 0); + m_first_start = false; + } } @@ -136,20 +179,20 @@ void igs_m027_023vid_state::m027_map(address_map &map) map(0x2800'0000, 0x2800'0fff).ram(); map(0x3890'0000, 0x3890'7fff).rw(m_video, FUNC(igs023_video_device::videoram_r), FUNC(igs023_video_device::videoram_w)).umask32(0xffffffff); - map(0x38a0'0000, 0x38a0'11ff).ram().w(m_palette, FUNC(palette_device::write32)).share("palette"); map(0x38b0'0000, 0x38b0'ffff).rw(m_video, FUNC(igs023_video_device::videoregs_r), FUNC(igs023_video_device::videoregs_w)).umask32(0xffffffff); - map(0x4000'0008, 0x4000'000b).nopw(); - - map(0x4800'0000, 0x4800'0003).r(FUNC(igs_m027_023vid_state::unk0_r)); - map(0x4800'0004, 0x4800'0007).r(FUNC(igs_m027_023vid_state::unk1_r)); + map(0x4800'0000, 0x4800'0001).r(FUNC(igs_m027_023vid_state::in_r<0>)); + map(0x4800'0002, 0x4800'0003).r(FUNC(igs_m027_023vid_state::in_r<1>)); + map(0x4800'0004, 0x4800'0005).r(FUNC(igs_m027_023vid_state::in_r<2>)); + map(0x4800'0006, 0x4800'0007).rw(FUNC(igs_m027_023vid_state::dsw_r), FUNC(igs_m027_023vid_state::out_w<0>)); map(0x5000'0000, 0x5000'03ff).umask32(0x0000'00ff).w(FUNC(igs_m027_023vid_state::xor_table_w)); // uploads XOR table to external ROM here - map(0x5800'0000, 0x5800'0007).rw("ics", FUNC(ics2115_device::read), FUNC(ics2115_device::write)).umask32(0x00ff00ff); + map(0x5800'0000, 0x5800'0007).rw(m_ics, FUNC(ics2115_device::read), FUNC(ics2115_device::write)).umask32(0x00ff00ff); - map(0x7000'0108, 0x7000'010b).nopw(); + map(0x6800'0000, 0x6800'0001).w(FUNC(igs_m027_023vid_state::kbd_w)); + map(0x6800'0002, 0x6800'0003).w(FUNC(igs_m027_023vid_state::out_w<1>)); } @@ -159,91 +202,89 @@ void igs_m027_023vid_state::m027_map(address_map &map) ***************************************************************************/ -INPUT_PORTS_START( base ) +INPUT_PORTS_START( mxsqy ) + PORT_INCLUDE(igs_mahjong_matrix) + + PORT_START("IN0") + PORT_BIT(0x07ff, IP_ACTIVE_LOW, IPT_UNKNOWN) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x01) + PORT_BIT(0x003f, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x00) PORT_CUSTOM_MEMBER(FUNC(igs_m027_023vid_state::kbd_r)) + PORT_BIT(0x0040, IP_ACTIVE_LOW, IPT_CUSTOM) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x00) PORT_READ_LINE_DEVICE_MEMBER("hopper", FUNC(hopper_device::line_r)) // 哈巴 + PORT_SERVICE_NO_TOGGLE(0x0080, IP_ACTIVE_LOW) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x00) // 测试 + PORT_BIT(0x0100, IP_ACTIVE_LOW, IPT_COIN1) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x00) // 投币 + PORT_BIT(0x0200, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x00) // 洗分 + PORT_BIT(0x0400, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x00) // 査帐 + PORT_BIT(0xf800, IP_ACTIVE_LOW, IPT_UNKNOWN) + + PORT_START("IN1") + PORT_BIT(0x0007, IP_ACTIVE_LOW, IPT_UNKNOWN) + PORT_BIT(0x0008, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x01) // 査帐 + PORT_SERVICE_NO_TOGGLE(0x0010, IP_ACTIVE_LOW) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x01) // 测试 + PORT_BIT(0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x01) + PORT_BIT(0x0040, IP_ACTIVE_LOW, IPT_COIN1) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x01) // 投币 + PORT_BIT(0x0078, IP_ACTIVE_LOW, IPT_UNKNOWN) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x00) + PORT_BIT(0x0080, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN) // 开分 + PORT_BIT(0x0100, IP_ACTIVE_LOW, IPT_START1) // 开始 + PORT_BIT(0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_UP) // 上 + PORT_BIT(0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN) // 下 + PORT_BIT(0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT) // 左 + PORT_BIT(0x1000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT) // 右 + PORT_BIT(0x2000, IP_ACTIVE_LOW, IPT_BUTTON1) // S1 + PORT_BIT(0x4000, IP_ACTIVE_LOW, IPT_BUTTON2) // S2 + PORT_BIT(0x8000, IP_ACTIVE_LOW, IPT_BUTTON3) // S3 + + PORT_START("IN2") + PORT_BIT(0x0001, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT) // 退币 + PORT_BIT(0x0002, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x01) // 洗分 + PORT_BIT(0x0004, IP_ACTIVE_LOW, IPT_CUSTOM) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x01) PORT_READ_LINE_DEVICE_MEMBER("hopper", FUNC(hopper_device::line_r)) // HPSW. + PORT_BIT(0x0006, IP_ACTIVE_LOW, IPT_UNKNOWN) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x00) + PORT_BIT(0xfff8, IP_ACTIVE_LOW, IPT_UNKNOWN) + + PORT_START("OUT0") + PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x00) PORT_WRITE_LINE_DEVICE_MEMBER("hopper", FUNC(hopper_device::motor_w)) + PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_OUTPUT) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x00) PORT_WRITE_LINE_MEMBER(FUNC(igs_m027_023vid_state::counter_w<0>)) // coin or key-in + PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_OUTPUT) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x00) PORT_WRITE_LINE_MEMBER(FUNC(igs_m027_023vid_state::counter_w<2>)) // payout or key-out + + PORT_START("OUT1") + PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_OUTPUT) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x01) PORT_WRITE_LINE_MEMBER(FUNC(igs_m027_023vid_state::counter_w<0>)) // coin + PORT_BIT(0x0008, IP_ACTIVE_HIGH, IPT_OUTPUT) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x01) PORT_WRITE_LINE_MEMBER(FUNC(igs_m027_023vid_state::counter_w<2>)) // payout + PORT_BIT(0x0010, IP_ACTIVE_HIGH, IPT_OUTPUT) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x01) PORT_WRITE_LINE_MEMBER(FUNC(igs_m027_023vid_state::counter_w<1>)) // key-in + PORT_BIT(0x0020, IP_ACTIVE_HIGH, IPT_OUTPUT) PORT_CONDITION("DSW1", 0x01, EQUALS, 0x01) PORT_WRITE_LINE_MEMBER(FUNC(igs_m027_023vid_state::counter_w<3>)) // key-out + PORT_BIT(0x4000, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_CONDITION("DSW1", 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_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_DIPNAME(0x01, 0x01, DEF_STR(Controls)) PORT_DIPLOCATION("SW1:1") // PLAY MODE + PORT_DIPSETTING( 0x01, DEF_STR(Joystick)) // JAMMA + PORT_DIPSETTING( 0x00, "Mahjong") // MJ + 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_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" ) - - PORT_START("PORTB") // buttons? - PORT_DIPNAME( 0x01, 0x01, "PORTB") - PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - - PORT_START("PORTC") // buttons? - PORT_DIPNAME( 0x01, 0x01, "PORTC") - PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + 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 @@ -259,13 +300,48 @@ u32 igs_m027_023vid_state::external_rom_r(offs_t offset) return m_external_rom[offset] ^ m_xor_table[offset & 0x00ff]; } - void igs_m027_023vid_state::xor_table_w(offs_t offset, u8 data) { m_xor_table[offset] = (u32(data) << 24) | (u32(data) << 8); } +ioport_value igs_m027_023vid_state::kbd_r() +{ + ioport_value result = 0x3f; + for (unsigned i = 0; m_io_kbd.size() > i; ++i) + { + if (!BIT(m_kbd_sel, i)) + result &= m_io_kbd[i]->read(); + } + return result; +} + +u16 igs_m027_023vid_state::dsw_r() +{ + u16 result = 0x00ff; + for (unsigned i = 0; m_io_dsw.size() > i; ++i) + { + if (!BIT(m_gpio_out, i)) + result &= m_io_dsw[i]->read(); + } + return 0xff00 | result; +} + +void igs_m027_023vid_state::kbd_w(u16 data) +{ + m_kbd_sel = data & 0x001f; +} + + +void igs_m027_023vid_state::gpio_out_w(u8 data) +{ + // bits 0-2 select DIP switch banks 1-3, respectively + // the game constantly toggles bit 3 + m_gpio_out = data; +} + + TIMER_DEVICE_CALLBACK_MEMBER(igs_m027_023vid_state::interrupt) { int scanline = param; @@ -288,7 +364,7 @@ u16 igs_m027_023vid_state::sprites_r(offs_t offset) // there does seem to be a spritelist at the start of mainram like PGM // it is also copied to a secondary RAM area, which seems to be our datasource in this case - address_space& mem = m_maincpu->space(AS_PROGRAM); + address_space &mem = m_maincpu->space(AS_PROGRAM); u16 sprdata = mem.read_word(0x28000000 + offset * 2); return sprdata; } @@ -319,6 +395,7 @@ void igs_m027_023vid_state::m027_023vid(machine_config &config) IGS027A(config, m_maincpu, 33_MHz_XTAL); m_maincpu->set_addrmap(AS_PROGRAM, &igs_m027_023vid_state::m027_map); m_maincpu->in_port().set(FUNC(igs_m027_023vid_state::gpio_r)); + m_maincpu->out_port().set(FUNC(igs_m027_023vid_state::gpio_out_w)); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); @@ -328,7 +405,7 @@ void igs_m027_023vid_state::m027_023vid(machine_config &config) m_screen->set_size(512, 256); m_screen->set_visarea(0, 448-1, 0, 224-1); m_screen->set_screen_update(FUNC(igs_m027_023vid_state::screen_update)); - m_screen->set_palette("palette"); + m_screen->set_palette(m_palette); m_screen->screen_vblank().set(FUNC(igs_m027_023vid_state::screen_vblank)); PALETTE(config, m_palette).set_format(palette_device::xRGB_555, 0x1200/2); @@ -346,6 +423,8 @@ void igs_m027_023vid_state::m027_023vid(machine_config &config) ICS2115(config, m_ics, 33.8688_MHz_XTAL); m_ics->irq().set(FUNC(igs_m027_023vid_state::irq_w<1>)); m_ics->add_route(ALL_OUTPUTS, "mono", 5.0); + + HOPPER(config, m_hopper, attotime::from_msec(50)); } @@ -356,6 +435,7 @@ void igs_m027_023vid_state::m027_023vid(machine_config &config) ***************************************************************************/ +// 明星三缺一 (Míngxīng sān quē yī) ROM_START( mxsqy ) ROM_REGION( 0x04000, "maincpu", 0 ) // Internal ROM of IGS027A type G ARM based MCU @@ -393,4 +473,4 @@ void igs_m027_023vid_state::init_mxsqy() ***************************************************************************/ // internal ROM is 2003 -GAME( 2003, mxsqy, 0, m027_023vid, base, igs_m027_023vid_state, init_mxsqy, ROT0, "IGS", "Ming Xing San Que Yi (China)", MACHINE_IS_SKELETON ) +GAME( 2003, mxsqy, 0, m027_023vid, mxsqy, igs_m027_023vid_state, init_mxsqy, ROT0, "IGS", "Mingxing San Que Yi (China, V201CN)", MACHINE_IS_SKELETON ) From 16a5e4eb9e17417494d8d633340b5f241a11e293 Mon Sep 17 00:00:00 2001 From: angelosa Date: Fri, 18 Oct 2024 21:54:08 +0200 Subject: [PATCH 4/5] video/upd7220.cpp: ignore parameters beyond first one for pitch command * fix pc9801:burai intro MAME crash --- src/devices/video/upd7220.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/devices/video/upd7220.cpp b/src/devices/video/upd7220.cpp index 8bb8a9e8238..e20c6ce920c 100644 --- a/src/devices/video/upd7220.cpp +++ b/src/devices/video/upd7220.cpp @@ -1376,10 +1376,20 @@ void upd7220_device::process_fifo() break; case COMMAND_PITCH: /* pitch specification */ - if (flag == FIFO_PARAMETER) + // pc9801:burai writes a spurious extra value during intro, effectively ignored + // (only first value matters) + if (flag == FIFO_PARAMETER && m_param_ptr == 2) { m_pitch = (m_pitch & 0x100) | data; + if (m_pitch < 2) + { + // TODO: a pitch of zero will lead to a MAME crash in draw_graphics_line + // Coerce a fail-safe minimum, what should really happen is to be verified ... + popmessage("%s pitch == 0!", this->tag()); + m_pitch = 2; + } + LOG("uPD7220 PITCH: %u\n", m_pitch); } break; From 4c8c9e57802bb58d20935d4dbe99443bce1a7ca8 Mon Sep 17 00:00:00 2001 From: Ivan Vangelista Date: Fri, 18 Oct 2024 22:43:53 +0200 Subject: [PATCH 5/5] igs/igs_m027_023vid.cpp, igs/pgm.cpp: removed unneeded trampoline --- src/mame/igs/igs_m027_023vid.cpp | 15 ++++----------- src/mame/igs/pgm.cpp | 7 +------ src/mame/igs/pgm.h | 17 +++++++---------- 3 files changed, 12 insertions(+), 27 deletions(-) diff --git a/src/mame/igs/igs_m027_023vid.cpp b/src/mame/igs/igs_m027_023vid.cpp index 7aa1eeebdcf..75896682462 100644 --- a/src/mame/igs/igs_m027_023vid.cpp +++ b/src/mame/igs/igs_m027_023vid.cpp @@ -27,7 +27,6 @@ Main components for the PCB-0457-03-GS are: #include "machine/nvram.h" #include "machine/ticket.h" #include "machine/timer.h" - #include "sound/ics2115.h" #include "emupal.h" @@ -110,7 +109,6 @@ class igs_m027_023vid_state : public driver_device TIMER_DEVICE_CALLBACK_MEMBER(interrupt); - u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); u16 sprites_r(offs_t offset); void screen_vblank(int state); @@ -148,17 +146,12 @@ void igs_m027_023vid_state::machine_reset() } -u32 igs_m027_023vid_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - return m_video->screen_update(screen, bitmap, cliprect); -} - void igs_m027_023vid_state::screen_vblank(int state) { // rising edge if (state) { - /* first 0xa00 of main ram = sprites, seems to be buffered, DMA? */ + // first 0xa00 of main ram = sprites, seems to be buffered, DMA? m_video->get_sprites(); } } @@ -344,7 +337,7 @@ void igs_m027_023vid_state::gpio_out_w(u8 data) TIMER_DEVICE_CALLBACK_MEMBER(igs_m027_023vid_state::interrupt) { - int scanline = param; + int const scanline = param; switch (scanline) { @@ -365,7 +358,7 @@ u16 igs_m027_023vid_state::sprites_r(offs_t offset) // it is also copied to a secondary RAM area, which seems to be our datasource in this case address_space &mem = m_maincpu->space(AS_PROGRAM); - u16 sprdata = mem.read_word(0x28000000 + offset * 2); + u16 const sprdata = mem.read_word(0x28000000 + offset * 2); return sprdata; } @@ -404,7 +397,7 @@ void igs_m027_023vid_state::m027_023vid(machine_config &config) m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(1000)); m_screen->set_size(512, 256); m_screen->set_visarea(0, 448-1, 0, 224-1); - m_screen->set_screen_update(FUNC(igs_m027_023vid_state::screen_update)); + m_screen->set_screen_update(m_video, FUNC(igs023_video_device::screen_update)); m_screen->set_palette(m_palette); m_screen->screen_vblank().set(FUNC(igs_m027_023vid_state::screen_vblank)); diff --git a/src/mame/igs/pgm.cpp b/src/mame/igs/pgm.cpp index 8d2cba261d2..9179a3fa003 100644 --- a/src/mame/igs/pgm.cpp +++ b/src/mame/igs/pgm.cpp @@ -457,11 +457,6 @@ void pgm_state::video_start() { } -u32 pgm_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - return m_video->screen_update(screen, bitmap, cliprect); -} - void pgm_state::screen_vblank(int state) { // rising edge @@ -493,7 +488,7 @@ void pgm_state::pgmbase(machine_config &config) /* video hardware */ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); screen.set_raw(50_MHz_XTAL/5, 640, 0, 448, 264, 0, 224); // or 20MHz / 2? framerate verified - screen.set_screen_update(FUNC(pgm_state::screen_update)); + screen.set_screen_update(m_video, FUNC(igs023_video_device::screen_update)); screen.screen_vblank().set(FUNC(pgm_state::screen_vblank)); screen.set_palette(m_palette); diff --git a/src/mame/igs/pgm.h b/src/mame/igs/pgm.h index 674d4651c63..17bfb2ba045 100644 --- a/src/mame/igs/pgm.h +++ b/src/mame/igs/pgm.h @@ -20,6 +20,7 @@ #include "machine/timer.h" #include "machine/v3021.h" #include "sound/ics2115.h" + #include "emupal.h" #include "tilemap.h" @@ -54,28 +55,28 @@ class pgm_state : public driver_device virtual void machine_reset() override ATTR_COLD; virtual void video_start() override ATTR_COLD; - /* memory pointers */ + // memory pointers required_shared_ptr m_mainram; optional_ioport m_region; optional_ioport m_regionhack; - /* devices */ + // devices required_device m_maincpu; - /* hack */ + // hack int m_irq4_disabled = 0; void pgm_base_mem(address_map &map) ATTR_COLD; void pgm_mem(address_map &map) ATTR_COLD; private: - /* memory pointers */ + // memory pointers required_shared_ptr m_z80_mainram; - /* devices */ + // devices required_device m_soundcpu; required_device m_palette; required_device m_soundlatch; @@ -83,7 +84,6 @@ class pgm_state : public driver_device required_device m_ics; required_device m_video; - /* used by rendering */ void coin_counter_w(u16 data); u8 z80_ram_r(offs_t offset); void z80_ram_w(offs_t offset, u8 data); @@ -92,7 +92,6 @@ class pgm_state : public driver_device void m68k_l1_w(u8 data); void z80_l3_w(u8 data); - u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void screen_vblank(int state); TIMER_DEVICE_CALLBACK_MEMBER(interrupt); u16 sprites_r(offs_t offset); @@ -104,10 +103,8 @@ class pgm_state : public driver_device -/*----------- defined in drivers/pgm.cpp -----------*/ +//----------- defined in igs/pgm.cpp ----------- INPUT_PORTS_EXTERN(pgm); -extern gfx_decode_entry const gfx_pgm[]; - #endif // MAME_IGS_PGM_H