From 8f5d6f67be6ed1333359127b11ada76b78422c91 Mon Sep 17 00:00:00 2001 From: mamehaze <140764005+mamehaze@users.noreply.github.com> Date: Tue, 23 Jan 2024 15:20:03 +0000 Subject: handheld/hh_ht11xx.cpp: Add support for Brick Game (#11942) * new WORKING machines --------- Brick Game GA888 [azya52, David Haywood] --------- Co-authored-by: David Haywood --- src/mame/handheld/hh_ht11xx.cpp | 124 ++++++++++++++++++++++++++++++++++++---- src/mame/mame.lst | 1 + 2 files changed, 113 insertions(+), 12 deletions(-) diff --git a/src/mame/handheld/hh_ht11xx.cpp b/src/mame/handheld/hh_ht11xx.cpp index 62dc561bc7f..4caee1646fc 100644 --- a/src/mame/handheld/hh_ht11xx.cpp +++ b/src/mame/handheld/hh_ht11xx.cpp @@ -40,35 +40,74 @@ namespace { class hh_ht11xx_state : public driver_device { public: + + virtual DECLARE_INPUT_CHANGED_MEMBER(input_wakeup); + +protected: hh_ht11xx_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu"), + m_maincpu(*this, "maincpu") + { } + + void mcfg_svg_screen(machine_config &config, u16 width, u16 height, const char *tag = "screen"); + + required_device m_maincpu; +}; + +class hh_ht1190_state : public hh_ht11xx_state +{ +public: + hh_ht1190_state(const machine_config &mconfig, device_type type, const char *tag) : + hh_ht11xx_state(mconfig, type, tag), m_out_x(*this, "%u.%u", 0U, 0U), m_in(*this, "IN%u", 1) { } - virtual DECLARE_INPUT_CHANGED_MEMBER(input_wakeup); - void brke23p2(machine_config &config); protected: virtual void machine_start() override; -private: - void mcfg_svg_screen(machine_config &config, u16 width, u16 height, const char *tag = "screen"); - void segment_w(offs_t offset, u64 data); - required_device m_maincpu; +private: output_finder<8, 40> m_out_x; required_ioport_array<2> m_in; }; -void hh_ht11xx_state::machine_start() + +class hh_ht1130_state : public hh_ht11xx_state +{ +public: + hh_ht1130_state(const machine_config &mconfig, device_type type, const char *tag) : + hh_ht11xx_state(mconfig, type, tag), + m_out_x(*this, "%u.%u", 0U, 0U), + m_in(*this, "IN%u", 1) + { } + + void ga888(machine_config &config); + +protected: + virtual void machine_start() override; + + void segment_w(offs_t offset, u64 data); + +private: + output_finder<4, 32> m_out_x; + required_ioport_array<3> m_in; +}; + +void hh_ht1190_state::machine_start() { m_out_x.resolve(); } +void hh_ht1130_state::machine_start() +{ + m_out_x.resolve(); +} + + INPUT_CHANGED_MEMBER(hh_ht11xx_state::input_wakeup) { m_maincpu->set_input_line(HT1130_EXT_WAKEUP_LINE, newval ? CLEAR_LINE : ASSERT_LINE); @@ -88,8 +127,27 @@ static INPUT_PORTS_START( brke23p2 ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Left") INPUT_PORTS_END +static INPUT_PORTS_START( ga888 ) // the unit also has an up button, and a reset button, is 'up' connected to anything? + PORT_START("IN1") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_VOLUME_DOWN ) PORT_NAME("Pause / Power") PORT_CHANGED_MEMBER(DEVICE_SELF, hh_ht11xx_state, input_wakeup, 0) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START("IN2") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) -void hh_ht11xx_state::segment_w(offs_t offset, u64 data) + PORT_START("IN3") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START ) PORT_NAME("Start / Rotate") + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Down / Drop") + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Right / Sound") + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Left") +INPUT_PORTS_END + +void hh_ht1190_state::segment_w(offs_t offset, u64 data) { for (int i = 0; i < 40; i++) { @@ -98,6 +156,16 @@ void hh_ht11xx_state::segment_w(offs_t offset, u64 data) } } +void hh_ht1130_state::segment_w(offs_t offset, u64 data) +{ + for (int i = 0; i < 32; i++) + { + // output to x.y where x = COM# and y = SEG# + m_out_x[offset][i] = BIT(data, i); + } +} + + void hh_ht11xx_state::mcfg_svg_screen(machine_config &config, u16 width, u16 height, const char *tag) { screen_device &screen(SCREEN(config, tag, SCREEN_TYPE_SVG)); @@ -108,10 +176,10 @@ void hh_ht11xx_state::mcfg_svg_screen(machine_config &config, u16 width, u16 hei config.set_default_layout(layout_hh_ht11xx_single); } -void hh_ht11xx_state::brke23p2(machine_config &config) +void hh_ht1190_state::brke23p2(machine_config &config) { HT1190(config, m_maincpu, 1000000/8); // frequency? - m_maincpu->segment_out_cb().set(FUNC(hh_ht11xx_state::segment_w)); + m_maincpu->segment_out_cb().set(FUNC(hh_ht1190_state::segment_w)); m_maincpu->ps_in_cb().set_ioport(m_in[0]); m_maincpu->pp_in_cb().set_ioport(m_in[1]); @@ -121,15 +189,47 @@ void hh_ht11xx_state::brke23p2(machine_config &config) mcfg_svg_screen(config, 755, 1080); } +void hh_ht1130_state::ga888(machine_config &config) +{ + HT1130(config, m_maincpu, 1000000/8); // frequency? + m_maincpu->segment_out_cb().set(FUNC(hh_ht1130_state::segment_w)); + + m_maincpu->ps_in_cb().set_ioport(m_in[0]); + m_maincpu->pp_in_cb().set_ioport(m_in[1]); + m_maincpu->pm_in_cb().set_ioport(m_in[2]); + + SPEAKER(config, "speaker").front_center(); + + mcfg_svg_screen(config, 698, 1080); +} + ROM_START( brke23p2 ) ROM_REGION( 0x1000, "maincpu", 0 ) ROM_LOAD( "brke23p2.bin", 0x0000, 0x1000, CRC(8045fac4) SHA1(a36213309e6add31f31e4248f02f17de9914a5c1) ) // visual decap + ROM_REGION( 0x280, "melody", 0 ) + ROM_LOAD( "e23plusmarkii96in1.srom", 0x000, 0x280, CRC(591a8a21) SHA1(f039359e8e1d1bf75581a4c852b263c8c140e072) ) + ROM_REGION( 160500, "screen", 0) ROM_LOAD( "brke23p2.svg", 0, 160500, CRC(9edf8aab) SHA1(f2ab907d23517612196648f1b5b0cb9b4a1ab3bd) ) ROM_END +ROM_START( ga888 ) + ROM_REGION( 0x1000, "maincpu", 0 ) + ROM_LOAD( "ga888.bin", 0x0000, 0x1000, CRC(cb3f8ff4) SHA1(00b08773e8ee7577377f4d52cd1e6bb657b6f242) ) // visual decap + + ROM_REGION( 0x280, "melody", 0 ) + ROM_LOAD( "ga888.srom", 0x000, 0x280, CRC(a8495ac7) SHA1(f6c24fc9622bff73ab09b5ee77eb338f27f7a6b1) ) + + ROM_REGION( 84795, "screen", 0) + ROM_LOAD( "ga888.svg", 0, 84795, CRC(5aa70531) SHA1(fc7bc442e6c88365047cf081d1113c741b144934) ) +ROM_END + + } // anonymous namespace // some other dieshots have 1996 on them, it is also possible the software is from Holtek -CONS( 1993, brke23p2, 0, 0, brke23p2, brke23p2, hh_ht11xx_state, empty_init, "E-Star", "Brick Game 96 in 1 (E-23 Plus Mark II)", MACHINE_IMPERFECT_TIMING | MACHINE_NO_SOUND ) +CONS( 1993, brke23p2, 0, 0, brke23p2, brke23p2, hh_ht1190_state, empty_init, "E-Star", "Brick Game 96 in 1 (E-23 Plus Mark II)", MACHINE_IMPERFECT_TIMING | MACHINE_NO_SOUND ) + +CONS( 199?, ga888, 0, 0, ga888, ga888, hh_ht1130_state, empty_init, "", "Block Game & Echo Key GA888", MACHINE_IMPERFECT_TIMING | MACHINE_NO_SOUND ) // clone of Tetris Jr? + diff --git a/src/mame/mame.lst b/src/mame/mame.lst index 75ee11e4f4e..8a6f6df8a63 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -18826,6 +18826,7 @@ zackman // Bandai @source:handheld/hh_ht11xx.cpp brke23p2 +ga888 @source:handheld/hh_melps4.cpp cfrogger // Coleco -- cgit v1.2.3