diff options
author | 2019-10-08 03:29:50 +1100 | |
---|---|---|
committer | 2019-10-08 03:29:50 +1100 | |
commit | 6cb51d56739c2ce96652a56a3142a6c3fdd09436 (patch) | |
tree | 9eeb95783f98c216d0158a331d4b123c1d3c8156 | |
parent | 2d6d1580333b6e6c270194792ea352fe11529fbd (diff) |
(nw) use optional I/O ports for G&W
-rw-r--r-- | src/mame/drivers/finalizr.cpp | 1 | ||||
-rw-r--r-- | src/mame/drivers/hh_sm510.cpp | 553 | ||||
-rw-r--r-- | src/mame/includes/hh_sm510.h | 12 |
3 files changed, 252 insertions, 314 deletions
diff --git a/src/mame/drivers/finalizr.cpp b/src/mame/drivers/finalizr.cpp index 1f4a85cc9e8..7ad2e0eae59 100644 --- a/src/mame/drivers/finalizr.cpp +++ b/src/mame/drivers/finalizr.cpp @@ -274,6 +274,7 @@ void finalizr_state::finalizr(machine_config &config) m_audiocpu->set_addrmap(AS_IO, &finalizr_state::sound_io_map); m_audiocpu->p1_out_cb().set("dac", FUNC(dac_byte_interface::data_w)); m_audiocpu->p2_out_cb().set(FUNC(finalizr_state::i8039_irqen_w)); + //m_audiocpu->set_t0_clk_cb(finalizr_state::i8039_t0_w)); m_audiocpu->t1_in_cb().set(FUNC(finalizr_state::i8039_t1_r)); WATCHDOG_TIMER(config, "watchdog"); diff --git a/src/mame/drivers/hh_sm510.cpp b/src/mame/drivers/hh_sm510.cpp index 8742d5c4029..de0d050ba9a 100644 --- a/src/mame/drivers/hh_sm510.cpp +++ b/src/mame/drivers/hh_sm510.cpp @@ -233,138 +233,6 @@ void hh_sm510_state::common_sm511(machine_config &config, u16 width, u16 height) sm510_base(config, width, height); } -void hh_sm510_state::gnw_sm5a(machine_config &config, u16 width, u16 height) -{ - SM5A(config, m_maincpu); - m_maincpu->set_r_mask_option(sm510_base_device::RMASK_DIRECT); - m_maincpu->write_r().set(FUNC(hh_sm510_state::piezo_r1_w)); - m_maincpu->read_b().set_ioport("B"); - - sm500_base(config, width, height); -} - -void hh_sm510_state::gnw_sm5a_matrix(machine_config &config, u16 width, u16 height) -{ - SM5A(config, m_maincpu); - m_maincpu->set_r_mask_option(sm510_base_device::RMASK_DIRECT); - m_maincpu->write_r().set(FUNC(hh_sm510_state::piezo_input_w)); - - sm500_base(config, width, height); -} - -void hh_sm510_state::gnw_kb1013vk12_matrix(machine_config &config, u16 width, u16 height) -{ - KB1013VK12(config, m_maincpu); - m_maincpu->set_r_mask_option(sm510_base_device::RMASK_DIRECT); - m_maincpu->write_r().set(FUNC(hh_sm510_state::piezo_input_w)); - - sm500_base(config, width, height); -} - -void hh_sm510_state::gnw_sm510(machine_config &config, u16 width, u16 height) -{ - SM510(config, m_maincpu); - m_maincpu->set_r_mask_option(2); - m_maincpu->write_s().set(FUNC(hh_sm510_state::input_w)); - m_maincpu->write_r().set(FUNC(hh_sm510_state::piezo_r1_w)); - m_maincpu->read_b().set_ioport("B"); - - sm510_base(config, width, height); -} - -void hh_sm510_state::gnw_sm511(machine_config &config, u16 width, u16 height) -{ - common_sm511(config, width, height); - - m_maincpu->read_b().set_ioport("B"); -} - -void hh_sm510_state::gnw_dualh(machine_config &config, u16 leftwidth, u16 leftheight, u16 rightwidth, u16 rightheight) -{ - /* basic machine hardware */ - m_maincpu->write_segs().set(FUNC(hh_sm510_state::sm510_lcd_segment_w)); - m_maincpu->read_k().set(FUNC(hh_sm510_state::input_r)); - m_maincpu->write_s().set(FUNC(hh_sm510_state::input_w)); - m_maincpu->write_r().set(FUNC(hh_sm510_state::piezo_r1_w)); - m_maincpu->read_ba().set_ioport("BA"); - m_maincpu->read_b().set_ioport("B"); - - /* video hardware */ - screen_device &screen_left(SCREEN(config, "screen_left", SCREEN_TYPE_SVG)); - screen_left.set_refresh_hz(60); - screen_left.set_size(leftwidth, leftheight); - screen_left.set_visarea_full(); - - screen_device &screen_right(SCREEN(config, "screen_right", SCREEN_TYPE_SVG)); - screen_right.set_refresh_hz(60); - screen_right.set_size(rightwidth, rightheight); - screen_right.set_visarea_full(); - - config.set_default_layout(layout_gnw_dualh); - - /* sound hardware */ - SPEAKER(config, "mono").front_center(); - SPEAKER_SOUND(config, m_speaker); - m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); -} - -void hh_sm510_state::gnw_dualv(machine_config &config, u16 topwidth, u16 topheight, u16 botwidth, u16 botheight) -{ - /* basic machine hardware */ - m_maincpu->write_segs().set(FUNC(hh_sm510_state::sm510_lcd_segment_w)); - m_maincpu->read_k().set(FUNC(hh_sm510_state::input_r)); - m_maincpu->write_s().set(FUNC(hh_sm510_state::input_w)); - m_maincpu->write_r().set(FUNC(hh_sm510_state::piezo_r1_w)); - - /* video hardware */ - screen_device &screen_top(SCREEN(config, "screen_top", SCREEN_TYPE_SVG)); - screen_top.set_refresh_hz(60); - screen_top.set_size(topwidth, topheight); - screen_top.set_visarea_full(); - - screen_device &screen_bottom(SCREEN(config, "screen_bottom", SCREEN_TYPE_SVG)); - screen_bottom.set_refresh_hz(60); - screen_bottom.set_size(botwidth, botheight); - screen_bottom.set_visarea_full(); - - config.set_default_layout(layout_gnw_dualv); - - /* sound hardware */ - SPEAKER(config, "mono").front_center(); - SPEAKER_SOUND(config, m_speaker); - m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); -} - -void hh_sm510_state::gnw_sm510_dualh(machine_config &config, u16 leftwidth, u16 leftheight, u16 rightwidth, u16 rightheight) -{ - SM510(config, m_maincpu); - m_maincpu->set_r_mask_option(2); - - gnw_dualh(config, leftwidth, leftheight, rightwidth, rightheight); -} - -void hh_sm510_state::gnw_sm510_dualv(machine_config &config, u16 topwidth, u16 topheight, u16 botwidth, u16 botheight) -{ - SM510(config, m_maincpu); - m_maincpu->set_r_mask_option(2); - - gnw_dualv(config, topwidth, topheight, botwidth, botheight); -} - -void hh_sm510_state::gnw_sm511_dualv(machine_config &config, u16 topwidth, u16 topheight, u16 botwidth, u16 botheight) -{ - SM511(config, m_maincpu); - - gnw_dualv(config, topwidth, topheight, botwidth, botheight); -} - -void hh_sm510_state::gnw_sm512_dualv(machine_config &config, u16 topwidth, u16 topheight, u16 botwidth, u16 botheight) -{ - SM512(config, m_maincpu); - - gnw_dualv(config, topwidth, topheight, botwidth, botheight); -} - void hh_sm510_state::konami_sm510(machine_config &config, u16 width, u16 height) { SM510(config, m_maincpu); @@ -569,6 +437,175 @@ WRITE8_MEMBER(hh_sm510_state::piezo2bit_input_w) namespace { +class gnw_state : public hh_sm510_state +{ +protected: + gnw_state(const machine_config &mconfig, device_type type, const char *tag) : + hh_sm510_state(mconfig, type, tag), + m_io_ba(*this, "BA"), + m_io_b(*this, "B") + { + } + + void gnw_sm5a(machine_config &config, u16 width, u16 height); + void gnw_sm5a_matrix(machine_config &config, u16 width, u16 height); + void gnw_kb1013vk12_matrix(machine_config &config, u16 width, u16 height); + void gnw_sm510(machine_config &config, u16 width, u16 height); + void gnw_sm511(machine_config &config, u16 width, u16 height); + void gnw_sm510_dualh(machine_config &config, u16 leftwidth, u16 leftheight, u16 rightwidth, u16 rightheight); + void gnw_sm510_dualv(machine_config &config, u16 topwidth, u16 topheight, u16 botwidth, u16 botheight); + void gnw_sm511_dualv(machine_config &config, u16 topwidth, u16 topheight, u16 botwidth, u16 botheight); + void gnw_sm512_dualv(machine_config &config, u16 topwidth, u16 topheight, u16 botwidth, u16 botheight); + +private: + void gnw_dualh(machine_config &config, u16 leftwidth, u16 leftheight, u16 rightwidth, u16 rightheight); + void gnw_dualv(machine_config &config, u16 topwidth, u16 topheight, u16 botwidth, u16 botheight); + + optional_ioport m_io_ba, m_io_b; +}; + +void gnw_state::gnw_sm5a(machine_config &config, u16 width, u16 height) +{ + SM5A(config, m_maincpu); + m_maincpu->set_r_mask_option(sm510_base_device::RMASK_DIRECT); + m_maincpu->write_r().set(FUNC(gnw_state::piezo_r1_w)); + m_maincpu->read_ba().set([this] () { return m_io_ba.read_safe(1); }); + m_maincpu->read_b().set([this] () { return m_io_b.read_safe(1); }); + + sm500_base(config, width, height); +} + +void gnw_state::gnw_sm5a_matrix(machine_config &config, u16 width, u16 height) +{ + SM5A(config, m_maincpu); + m_maincpu->set_r_mask_option(sm510_base_device::RMASK_DIRECT); + m_maincpu->write_r().set(FUNC(gnw_state::piezo_input_w)); + m_maincpu->read_ba().set([this] () { return m_io_ba.read_safe(1); }); + m_maincpu->read_b().set([this] () { return m_io_b.read_safe(1); }); + + sm500_base(config, width, height); +} + +void gnw_state::gnw_kb1013vk12_matrix(machine_config &config, u16 width, u16 height) +{ + KB1013VK12(config, m_maincpu); + m_maincpu->set_r_mask_option(sm510_base_device::RMASK_DIRECT); + m_maincpu->write_r().set(FUNC(gnw_state::piezo_input_w)); + m_maincpu->read_ba().set([this] () { return m_io_ba.read_safe(1); }); + m_maincpu->read_b().set([this] () { return m_io_b.read_safe(1); }); + + sm500_base(config, width, height); +} + +void gnw_state::gnw_sm510(machine_config &config, u16 width, u16 height) +{ + SM510(config, m_maincpu); + m_maincpu->set_r_mask_option(2); + m_maincpu->write_s().set(FUNC(gnw_state::input_w)); + m_maincpu->write_r().set(FUNC(gnw_state::piezo_r1_w)); + m_maincpu->read_ba().set([this] () { return m_io_ba.read_safe(1); }); + m_maincpu->read_b().set([this] () { return m_io_b.read_safe(1); }); + + sm510_base(config, width, height); +} + +void gnw_state::gnw_sm511(machine_config &config, u16 width, u16 height) +{ + common_sm511(config, width, height); + + m_maincpu->read_ba().set([this] () { return m_io_ba.read_safe(1); }); + m_maincpu->read_b().set([this] () { return m_io_b.read_safe(1); }); +} + +void gnw_state::gnw_sm510_dualh(machine_config &config, u16 leftwidth, u16 leftheight, u16 rightwidth, u16 rightheight) +{ + SM510(config, m_maincpu); + m_maincpu->set_r_mask_option(2); + + gnw_dualh(config, leftwidth, leftheight, rightwidth, rightheight); +} + +void gnw_state::gnw_sm510_dualv(machine_config &config, u16 topwidth, u16 topheight, u16 botwidth, u16 botheight) +{ + SM510(config, m_maincpu); + m_maincpu->set_r_mask_option(2); + + gnw_dualv(config, topwidth, topheight, botwidth, botheight); +} + +void gnw_state::gnw_sm511_dualv(machine_config &config, u16 topwidth, u16 topheight, u16 botwidth, u16 botheight) +{ + SM511(config, m_maincpu); + + gnw_dualv(config, topwidth, topheight, botwidth, botheight); +} + +void gnw_state::gnw_sm512_dualv(machine_config &config, u16 topwidth, u16 topheight, u16 botwidth, u16 botheight) +{ + SM512(config, m_maincpu); + + gnw_dualv(config, topwidth, topheight, botwidth, botheight); +} + +void gnw_state::gnw_dualh(machine_config &config, u16 leftwidth, u16 leftheight, u16 rightwidth, u16 rightheight) +{ + /* basic machine hardware */ + m_maincpu->write_segs().set(FUNC(gnw_state::sm510_lcd_segment_w)); + m_maincpu->read_k().set(FUNC(gnw_state::input_r)); + m_maincpu->write_s().set(FUNC(gnw_state::input_w)); + m_maincpu->write_r().set(FUNC(gnw_state::piezo_r1_w)); + m_maincpu->read_ba().set([this] () { return m_io_ba.read_safe(1); }); + m_maincpu->read_b().set([this] () { return m_io_b.read_safe(1); }); + + /* video hardware */ + screen_device &screen_left(SCREEN(config, "screen_left", SCREEN_TYPE_SVG)); + screen_left.set_refresh_hz(60); + screen_left.set_size(leftwidth, leftheight); + screen_left.set_visarea_full(); + + screen_device &screen_right(SCREEN(config, "screen_right", SCREEN_TYPE_SVG)); + screen_right.set_refresh_hz(60); + screen_right.set_size(rightwidth, rightheight); + screen_right.set_visarea_full(); + + config.set_default_layout(layout_gnw_dualh); + + /* sound hardware */ + SPEAKER(config, "mono").front_center(); + SPEAKER_SOUND(config, m_speaker); + m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); +} + +void gnw_state::gnw_dualv(machine_config &config, u16 topwidth, u16 topheight, u16 botwidth, u16 botheight) +{ + /* basic machine hardware */ + m_maincpu->write_segs().set(FUNC(gnw_state::sm510_lcd_segment_w)); + m_maincpu->read_k().set(FUNC(gnw_state::input_r)); + m_maincpu->write_s().set(FUNC(gnw_state::input_w)); + m_maincpu->write_r().set(FUNC(gnw_state::piezo_r1_w)); + m_maincpu->read_ba().set([this] () { return m_io_ba.read_safe(1); }); + m_maincpu->read_b().set([this] () { return m_io_b.read_safe(1); }); + + /* video hardware */ + screen_device &screen_top(SCREEN(config, "screen_top", SCREEN_TYPE_SVG)); + screen_top.set_refresh_hz(60); + screen_top.set_size(topwidth, topheight); + screen_top.set_visarea_full(); + + screen_device &screen_bottom(SCREEN(config, "screen_bottom", SCREEN_TYPE_SVG)); + screen_bottom.set_refresh_hz(60); + screen_bottom.set_size(botwidth, botheight); + screen_bottom.set_visarea_full(); + + config.set_default_layout(layout_gnw_dualv); + + /* sound hardware */ + SPEAKER(config, "mono").front_center(); + SPEAKER_SOUND(config, m_speaker); + m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); +} + + /*************************************************************************** Nintendo Game & Watch: Ball (model AC-01) @@ -580,11 +617,11 @@ namespace { ***************************************************************************/ -class gnw_ball_state : public hh_sm510_state +class gnw_ball_state : public gnw_state { public: gnw_ball_state(const machine_config &mconfig, device_type type, const char *tag) : - hh_sm510_state(mconfig, type, tag) + gnw_state(mconfig, type, tag) { inp_fixed_last(); } @@ -616,8 +653,6 @@ INPUT_PORTS_END void gnw_ball_state::gnw_ball(machine_config &config) { gnw_sm5a(config, 1671, 1080); // R option mask confirmed - - m_maincpu->read_ba().set_ioport("BA"); } // roms @@ -645,11 +680,11 @@ ROM_END ***************************************************************************/ -class gnw_flagman_state : public hh_sm510_state +class gnw_flagman_state : public gnw_state { public: gnw_flagman_state(const machine_config &mconfig, device_type type, const char *tag) : - hh_sm510_state(mconfig, type, tag) + gnw_state(mconfig, type, tag) { } void gnw_flagman(machine_config &config); @@ -683,8 +718,6 @@ INPUT_PORTS_END void gnw_flagman_state::gnw_flagman(machine_config &config) { gnw_sm5a_matrix(config, 1511, 1080); // R mask option confirmed - - m_maincpu->read_b().set_ioport("B"); } // roms @@ -712,11 +745,11 @@ ROM_END ***************************************************************************/ -class gnw_vermin_state : public hh_sm510_state +class gnw_vermin_state : public gnw_state { public: gnw_vermin_state(const machine_config &mconfig, device_type type, const char *tag) : - hh_sm510_state(mconfig, type, tag) + gnw_state(mconfig, type, tag) { inp_fixed_last(); } @@ -748,8 +781,6 @@ INPUT_PORTS_END void gnw_vermin_state::gnw_vermin(machine_config &config) { gnw_sm5a(config, 1650, 1080); // R mask option confirmed - - m_maincpu->read_ba().set_ioport("BA"); } // roms @@ -779,11 +810,11 @@ ROM_END ***************************************************************************/ -class gnw_fires_state : public hh_sm510_state +class gnw_fires_state : public gnw_state { public: gnw_fires_state(const machine_config &mconfig, device_type type, const char *tag) : - hh_sm510_state(mconfig, type, tag) + gnw_state(mconfig, type, tag) { inp_fixed_last(); } @@ -815,8 +846,6 @@ INPUT_PORTS_END void gnw_fires_state::gnw_fires(machine_config &config) { gnw_sm5a(config, 1646, 1080); // R mask option confirmed - - m_maincpu->read_ba().set_ioport("BA"); } // roms @@ -846,11 +875,11 @@ ROM_END ***************************************************************************/ -class gnw_judge_state : public hh_sm510_state +class gnw_judge_state : public gnw_state { public: gnw_judge_state(const machine_config &mconfig, device_type type, const char *tag) : - hh_sm510_state(mconfig, type, tag) + gnw_state(mconfig, type, tag) { } void gnw_judge(machine_config &config); @@ -884,8 +913,6 @@ INPUT_PORTS_END void gnw_judge_state::gnw_judge(machine_config &config) { gnw_sm5a_matrix(config, 1647, 1080); // R mask option confirmed - - m_maincpu->read_b().set_ioport("B"); } // roms @@ -915,11 +942,11 @@ ROM_END ***************************************************************************/ -class gnw_helmet_state : public hh_sm510_state +class gnw_helmet_state : public gnw_state { public: gnw_helmet_state(const machine_config &mconfig, device_type type, const char *tag) : - hh_sm510_state(mconfig, type, tag) + gnw_state(mconfig, type, tag) { } void gnw_helmet(machine_config &config); @@ -958,9 +985,6 @@ INPUT_PORTS_END void gnw_helmet_state::gnw_helmet(machine_config &config) { gnw_sm5a_matrix(config, 1657, 1080); // R mask option confirmed - - m_maincpu->read_ba().set_ioport("BA"); - m_maincpu->read_b().set_ioport("B"); } // roms @@ -990,11 +1014,11 @@ ROM_END ***************************************************************************/ -class gnw_lion_state : public hh_sm510_state +class gnw_lion_state : public gnw_state { public: gnw_lion_state(const machine_config &mconfig, device_type type, const char *tag) : - hh_sm510_state(mconfig, type, tag) + gnw_state(mconfig, type, tag) { } void gnw_lion(machine_config &config); @@ -1033,8 +1057,6 @@ INPUT_PORTS_END void gnw_lion_state::gnw_lion(machine_config &config) { gnw_sm5a_matrix(config, 1646, 1080); // R mask option confirmed - - m_maincpu->read_b().set_ioport("B"); } // roms @@ -1060,11 +1082,11 @@ ROM_END ***************************************************************************/ -class gnw_pchute_state : public hh_sm510_state +class gnw_pchute_state : public gnw_state { public: gnw_pchute_state(const machine_config &mconfig, device_type type, const char *tag) : - hh_sm510_state(mconfig, type, tag) + gnw_state(mconfig, type, tag) { } void gnw_pchute(machine_config &config); @@ -1103,9 +1125,6 @@ INPUT_PORTS_END void gnw_pchute_state::gnw_pchute(machine_config &config) { gnw_sm5a_matrix(config, 1602, 1080); // R mask option confirmed - - m_maincpu->read_ba().set_ioport("BA"); - m_maincpu->read_b().set_ioport("B"); } // roms @@ -1135,11 +1154,11 @@ ROM_END ***************************************************************************/ -class gnw_octopus_state : public hh_sm510_state +class gnw_octopus_state : public gnw_state { public: gnw_octopus_state(const machine_config &mconfig, device_type type, const char *tag) : - hh_sm510_state(mconfig, type, tag) + gnw_state(mconfig, type, tag) { } void gnw_octopus(machine_config &config); @@ -1178,9 +1197,6 @@ INPUT_PORTS_END void gnw_octopus_state::gnw_octopus(machine_config &config) { gnw_sm5a_matrix(config, 1586, 1080); // R mask option confirmed - - m_maincpu->read_ba().set_ioport("BA"); - m_maincpu->read_b().set_ioport("B"); } // roms @@ -1208,11 +1224,11 @@ ROM_END ***************************************************************************/ -class gnw_popeye_state : public hh_sm510_state +class gnw_popeye_state : public gnw_state { public: gnw_popeye_state(const machine_config &mconfig, device_type type, const char *tag) : - hh_sm510_state(mconfig, type, tag) + gnw_state(mconfig, type, tag) { } void gnw_popeye(machine_config &config); @@ -1251,9 +1267,6 @@ INPUT_PORTS_END void gnw_popeye_state::gnw_popeye(machine_config &config) { gnw_sm5a_matrix(config, 1604, 1080); // R mask option confirmed - - m_maincpu->read_ba().set_ioport("BA"); - m_maincpu->read_b().set_ioport("B"); } // roms @@ -1283,11 +1296,11 @@ ROM_END ***************************************************************************/ -class gnw_chef_state : public hh_sm510_state +class gnw_chef_state : public gnw_state { public: gnw_chef_state(const machine_config &mconfig, device_type type, const char *tag) : - hh_sm510_state(mconfig, type, tag) + gnw_state(mconfig, type, tag) { } void merrycook(machine_config &config); @@ -1324,15 +1337,11 @@ INPUT_PORTS_END void gnw_chef_state::gnw_chef(machine_config &config) { gnw_sm5a_matrix(config, 1666, 1080); // assuming same R mask option as merry cook - - m_maincpu->read_ba().set_ioport("BA"); } void gnw_chef_state::merrycook(machine_config & config) { gnw_kb1013vk12_matrix(config, 1679, 1080); // R mask option confirmed - - m_maincpu->read_ba().set_ioport("BA"); } // roms @@ -1375,11 +1384,11 @@ ROM_END ***************************************************************************/ -class gnw_mmouse_state : public hh_sm510_state +class gnw_mmouse_state : public gnw_state { public: gnw_mmouse_state(const machine_config &mconfig, device_type type, const char *tag) : - hh_sm510_state(mconfig, type, tag) + gnw_state(mconfig, type, tag) { } void exospace(machine_config &config); @@ -1425,29 +1434,21 @@ INPUT_PORTS_END void gnw_mmouse_state::gnw_mmouse(machine_config &config) { gnw_sm5a_matrix(config, 1711, 1080); // R mask option ? - - m_maincpu->read_ba().set_ioport("BA"); } void gnw_mmouse_state::gnw_egg(machine_config &config) { gnw_sm5a_matrix(config, 1694, 1080); // R mask option ? - - m_maincpu->read_ba().set_ioport("BA"); } void gnw_mmouse_state::nupogodi(machine_config &config) { gnw_kb1013vk12_matrix(config, 1715, 1080); // R mask option ? - - m_maincpu->read_ba().set_ioport("BA"); } void gnw_mmouse_state::exospace(machine_config &config) { gnw_kb1013vk12_matrix(config, 1756, 1080); // R mask option ? - - m_maincpu->read_ba().set_ioport("BA"); } // roms @@ -1505,11 +1506,11 @@ ROM_END ***************************************************************************/ -class gnw_fire_state : public hh_sm510_state +class gnw_fire_state : public gnw_state { public: gnw_fire_state(const machine_config &mconfig, device_type type, const char *tag) : - hh_sm510_state(mconfig, type, tag) + gnw_state(mconfig, type, tag) { } void spacebridge(machine_config &config); @@ -1549,17 +1550,11 @@ INPUT_PORTS_END void gnw_fire_state::gnw_fire(machine_config &config) { gnw_sm5a_matrix(config, 1624, 1080); // R mask option confirmed - - m_maincpu->read_ba().set_ioport("BA"); - m_maincpu->read_b().set_ioport("B"); } void gnw_fire_state::spacebridge(machine_config & config) { gnw_kb1013vk12_matrix(config, 1673, 1080); // R mask option confirmed - - m_maincpu->read_ba().set_ioport("BA"); - m_maincpu->read_b().set_ioport("B"); } // roms @@ -1593,11 +1588,11 @@ ROM_END ***************************************************************************/ -class gnw_tbridge_state : public hh_sm510_state +class gnw_tbridge_state : public gnw_state { public: gnw_tbridge_state(const machine_config &mconfig, device_type type, const char *tag) : - hh_sm510_state(mconfig, type, tag) + gnw_state(mconfig, type, tag) { // increase lcd decay: unwanted segments light up m_decay_pivot = 25; @@ -1639,8 +1634,6 @@ INPUT_PORTS_END void gnw_tbridge_state::gnw_tbridge(machine_config &config) { gnw_sm510(config, 1587, 1080); // R mask option confirmed - - m_maincpu->read_ba().set_ioport("BA"); } // roms @@ -1666,11 +1659,11 @@ ROM_END ***************************************************************************/ -class gnw_fireatk_state : public hh_sm510_state +class gnw_fireatk_state : public gnw_state { public: gnw_fireatk_state(const machine_config &mconfig, device_type type, const char *tag) : - hh_sm510_state(mconfig, type, tag) + gnw_state(mconfig, type, tag) { } void gnw_fireatk(machine_config &config); @@ -1708,8 +1701,6 @@ INPUT_PORTS_END void gnw_fireatk_state::gnw_fireatk(machine_config &config) { gnw_sm510(config, 1655, 1080); // R mask option confirmed - - m_maincpu->read_ba().set_ioport("BA"); } // roms @@ -1735,11 +1726,11 @@ ROM_END ***************************************************************************/ -class gnw_stennis_state : public hh_sm510_state +class gnw_stennis_state : public gnw_state { public: gnw_stennis_state(const machine_config &mconfig, device_type type, const char *tag) : - hh_sm510_state(mconfig, type, tag) + gnw_state(mconfig, type, tag) { } void gnw_stennis(machine_config &config); @@ -1777,8 +1768,6 @@ INPUT_PORTS_END void gnw_stennis_state::gnw_stennis(machine_config &config) { gnw_sm510(config, 1581, 1080); // R mask option confirmed - - m_maincpu->read_ba().set_ioport("BA"); } // roms @@ -1804,11 +1793,11 @@ ROM_END ***************************************************************************/ -class gnw_opanic_state : public hh_sm510_state +class gnw_opanic_state : public gnw_state { public: gnw_opanic_state(const machine_config &mconfig, device_type type, const char *tag) : - hh_sm510_state(mconfig, type, tag) + gnw_state(mconfig, type, tag) { } void gnw_opanic(machine_config &config); @@ -1846,9 +1835,6 @@ INPUT_PORTS_END void gnw_opanic_state::gnw_opanic(machine_config &config) { gnw_sm510_dualv(config, 1920/2, 1292/2, 1920/2, 1230/2); // R mask option confirmed - - m_maincpu->read_ba().set_ioport("BA"); - m_maincpu->read_b().set_ioport("B"); } // roms @@ -1877,11 +1863,11 @@ ROM_END ***************************************************************************/ -class gnw_dkong_state : public hh_sm510_state +class gnw_dkong_state : public gnw_state { public: gnw_dkong_state(const machine_config &mconfig, device_type type, const char *tag) : - hh_sm510_state(mconfig, type, tag) + gnw_state(mconfig, type, tag) { } void gnw_dkong(machine_config &config); @@ -1918,8 +1904,6 @@ INPUT_PORTS_END void gnw_dkong_state::gnw_dkong(machine_config &config) { gnw_sm510_dualv(config, 1920/2, 1266/2, 1920/2, 1266/2); // R mask option confirmed - - m_maincpu->read_b().set_ioport("B"); } // roms @@ -1948,11 +1932,11 @@ ROM_END ***************************************************************************/ -class gnw_mickdon_state : public hh_sm510_state +class gnw_mickdon_state : public gnw_state { public: gnw_mickdon_state(const machine_config &mconfig, device_type type, const char *tag) : - hh_sm510_state(mconfig, type, tag) + gnw_state(mconfig, type, tag) { } void gnw_mickdon(machine_config &config); @@ -1987,7 +1971,6 @@ void gnw_mickdon_state::gnw_mickdon(machine_config &config) gnw_sm510_dualv(config, 1920/2, 1281/2, 1920/2, 1236/2); // R mask option confirmed m_maincpu->write_r().set(FUNC(gnw_mickdon_state::piezo_r2_w)); - m_maincpu->read_b().set_ioport("B"); } // roms @@ -2016,11 +1999,11 @@ ROM_END ***************************************************************************/ -class gnw_ghouse_state : public hh_sm510_state +class gnw_ghouse_state : public gnw_state { public: gnw_ghouse_state(const machine_config &mconfig, device_type type, const char *tag) : - hh_sm510_state(mconfig, type, tag) + gnw_state(mconfig, type, tag) { } void gnw_ghouse(machine_config &config); @@ -2062,9 +2045,6 @@ INPUT_PORTS_END void gnw_ghouse_state::gnw_ghouse(machine_config &config) { gnw_sm510_dualv(config, 1920/2, 1303/2, 1920/2, 1274/2); // R mask option confirmed - - m_maincpu->read_ba().set_ioport("BA"); - m_maincpu->read_b().set_ioport("B"); } // roms @@ -2093,11 +2073,11 @@ ROM_END ***************************************************************************/ -class gnw_dkong2_state : public hh_sm510_state +class gnw_dkong2_state : public gnw_state { public: gnw_dkong2_state(const machine_config &mconfig, device_type type, const char *tag) : - hh_sm510_state(mconfig, type, tag) + gnw_state(mconfig, type, tag) { } void gnw_dkong2(machine_config &config); @@ -2134,8 +2114,6 @@ INPUT_PORTS_END void gnw_dkong2_state::gnw_dkong2(machine_config &config) { gnw_sm510_dualv(config, 1920/2, 1241/2, 1920/2, 1237/2); // R mask option confirmed - - m_maincpu->read_b().set_ioport("B"); } // roms @@ -2164,11 +2142,11 @@ ROM_END ***************************************************************************/ -class gnw_mario_state : public hh_sm510_state +class gnw_mario_state : public gnw_state { public: gnw_mario_state(const machine_config &mconfig, device_type type, const char *tag) : - hh_sm510_state(mconfig, type, tag) + gnw_state(mconfig, type, tag) { } void gnw_mario(machine_config &config); @@ -2234,11 +2212,11 @@ ROM_END ***************************************************************************/ -class gnw_rshower_state : public hh_sm510_state +class gnw_rshower_state : public gnw_state { public: gnw_rshower_state(const machine_config &mconfig, device_type type, const char *tag) : - hh_sm510_state(mconfig, type, tag) + gnw_state(mconfig, type, tag) { } void gnw_rshower(machine_config &config); @@ -2310,11 +2288,11 @@ ROM_END ***************************************************************************/ -class gnw_lboat_state : public hh_sm510_state +class gnw_lboat_state : public gnw_state { public: gnw_lboat_state(const machine_config &mconfig, device_type type, const char *tag) : - hh_sm510_state(mconfig, type, tag) + gnw_state(mconfig, type, tag) { } void gnw_lboat(machine_config &config); @@ -2380,11 +2358,11 @@ ROM_END ***************************************************************************/ -class gnw_bjack_state : public hh_sm510_state +class gnw_bjack_state : public gnw_state { public: gnw_bjack_state(const machine_config &mconfig, device_type type, const char *tag) : - hh_sm510_state(mconfig, type, tag) + gnw_state(mconfig, type, tag) { } void gnw_bjack(machine_config &config); @@ -2443,11 +2421,11 @@ ROM_END ***************************************************************************/ -class gnw_squish_state : public hh_sm510_state +class gnw_squish_state : public gnw_state { public: gnw_squish_state(const machine_config &mconfig, device_type type, const char *tag) : - hh_sm510_state(mconfig, type, tag) + gnw_state(mconfig, type, tag) { // increase lcd decay: unwanted segments light up m_decay_pivot = 17; @@ -2488,9 +2466,6 @@ INPUT_PORTS_END void gnw_squish_state::gnw_squish(machine_config &config) { gnw_sm510_dualv(config, 1920/2, 1285/2, 1920/2, 1287/2); // R mask option confirmed - - m_maincpu->read_ba().set_ioport("BA"); - m_maincpu->read_b().set_ioport("B"); } // roms @@ -2519,11 +2494,11 @@ ROM_END ***************************************************************************/ -class gnw_bsweep_state : public hh_sm510_state +class gnw_bsweep_state : public gnw_state { public: gnw_bsweep_state(const machine_config &mconfig, device_type type, const char *tag) : - hh_sm510_state(mconfig, type, tag) + gnw_state(mconfig, type, tag) { } void gnw_bsweep(machine_config &config); @@ -2561,9 +2536,6 @@ INPUT_PORTS_END void gnw_bsweep_state::gnw_bsweep(machine_config &config) { gnw_sm512_dualv(config, 1920/2, 1291/2, 1920/2, 1239/2); - - m_maincpu->read_ba().set_ioport("BA"); - m_maincpu->read_b().set_ioport("B"); } // roms @@ -2595,11 +2567,11 @@ ROM_END ***************************************************************************/ -class gnw_sbuster_state : public hh_sm510_state +class gnw_sbuster_state : public gnw_state { public: gnw_sbuster_state(const machine_config &mconfig, device_type type, const char *tag) : - hh_sm510_state(mconfig, type, tag) + gnw_state(mconfig, type, tag) { } void gnw_sbuster(machine_config &config); @@ -2636,9 +2608,6 @@ INPUT_PORTS_END void gnw_sbuster_state::gnw_sbuster(machine_config &config) { gnw_sm511_dualv(config, 1920/2, 1246/2, 1920/2, 1269/2); - - m_maincpu->read_ba().set_ioport("BA"); - m_maincpu->read_b().set_ioport("B"); } // roms @@ -2670,11 +2639,11 @@ ROM_END ***************************************************************************/ -class gnw_gcliff_state : public hh_sm510_state +class gnw_gcliff_state : public gnw_state { public: gnw_gcliff_state(const machine_config &mconfig, device_type type, const char *tag) : - hh_sm510_state(mconfig, type, tag) + gnw_state(mconfig, type, tag) { } void gnw_gcliff(machine_config &config); @@ -2716,9 +2685,6 @@ INPUT_PORTS_END void gnw_gcliff_state::gnw_gcliff(machine_config &config) { gnw_sm512_dualv(config, 1920/2, 1257/2, 1920/2, 1239/2); - - m_maincpu->read_ba().set_ioport("BA"); - m_maincpu->read_b().set_ioport("B"); } // roms @@ -2750,11 +2716,11 @@ ROM_END ***************************************************************************/ -class gnw_zelda_state : public hh_sm510_state +class gnw_zelda_state : public gnw_state { public: gnw_zelda_state(const machine_config &mconfig, device_type type, const char *tag) : - hh_sm510_state(mconfig, type, tag) + gnw_state(mconfig, type, tag) { } void gnw_zelda(machine_config &config); @@ -2796,9 +2762,6 @@ INPUT_PORTS_END void gnw_zelda_state::gnw_zelda(machine_config &config) { gnw_sm512_dualv(config, 1920/2, 1346/2, 1920/2, 1291/2); - - m_maincpu->read_ba().set_ioport("BA"); - m_maincpu->read_b().set_ioport("B"); } // roms @@ -2836,11 +2799,11 @@ ROM_END ***************************************************************************/ -class gnw_dkjrp_state : public hh_sm510_state +class gnw_dkjrp_state : public gnw_state { public: gnw_dkjrp_state(const machine_config &mconfig, device_type type, const char *tag) : - hh_sm510_state(mconfig, type, tag) + gnw_state(mconfig, type, tag) { } void gnw_dkjrp(machine_config &config); @@ -2882,8 +2845,6 @@ INPUT_PORTS_END void gnw_dkjrp_state::gnw_dkjrp(machine_config &config) { gnw_sm511(config, 1920, 1049); - - m_maincpu->read_ba().set_ioport("BA"); } // roms @@ -2912,11 +2873,11 @@ ROM_END ***************************************************************************/ -class gnw_mbaway_state : public hh_sm510_state +class gnw_mbaway_state : public gnw_state { public: gnw_mbaway_state(const machine_config &mconfig, device_type type, const char *tag) : - hh_sm510_state(mconfig, type, tag) + gnw_state(mconfig, type, tag) { } void gnw_mbaway(machine_config &config); @@ -2954,8 +2915,6 @@ INPUT_PORTS_END void gnw_mbaway_state::gnw_mbaway(machine_config &config) { gnw_sm511(config, 1920, 1031); - - m_maincpu->read_ba().set_ioport("BA"); } // roms @@ -2986,11 +2945,11 @@ ROM_END ***************************************************************************/ -class gnw_dkjr_state : public hh_sm510_state +class gnw_dkjr_state : public gnw_state { public: gnw_dkjr_state(const machine_config &mconfig, device_type type, const char *tag) : - hh_sm510_state(mconfig, type, tag) + gnw_state(mconfig, type, tag) { } void gnw_dkjr(machine_config &config); @@ -3032,8 +2991,6 @@ INPUT_PORTS_END void gnw_dkjr_state::gnw_dkjr(machine_config &config) { gnw_sm510(config, 1647, 1080); // R mask option confirmed - - m_maincpu->read_ba().set_ioport("BA"); } // roms @@ -3060,11 +3017,11 @@ ROM_END ***************************************************************************/ -class gnw_mariocm_state : public hh_sm510_state +class gnw_mariocm_state : public gnw_state { public: gnw_mariocm_state(const machine_config &mconfig, device_type type, const char *tag) : - hh_sm510_state(mconfig, type, tag) + gnw_state(mconfig, type, tag) { } void gnw_mariocm(machine_config &config); @@ -3102,8 +3059,6 @@ INPUT_PORTS_END void gnw_mariocm_state::gnw_mariocm(machine_config &config) { gnw_sm510(config, 1647, 1080); // R mask option confirmed - - m_maincpu->read_ba().set_ioport("BA"); } // roms @@ -3131,11 +3086,11 @@ ROM_END ***************************************************************************/ -class gnw_manhole_state : public hh_sm510_state +class gnw_manhole_state : public gnw_state { public: gnw_manhole_state(const machine_config &mconfig, device_type type, const char *tag) : - hh_sm510_state(mconfig, type, tag) + gnw_state(mconfig, type, tag) { } void gnw_manhole(machine_config &config); @@ -3173,8 +3128,6 @@ INPUT_PORTS_END void gnw_manhole_state::gnw_manhole(machine_config &config) { gnw_sm510(config, 1560, 1080); // R mask option confirmed - - m_maincpu->read_ba().set_ioport("BA"); } // roms @@ -3200,11 +3153,11 @@ ROM_END ***************************************************************************/ -class gnw_tfish_state : public hh_sm510_state +class gnw_tfish_state : public gnw_state { public: gnw_tfish_state(const machine_config &mconfig, device_type type, const char *tag) : - hh_sm510_state(mconfig, type, tag) + gnw_state(mconfig, type, tag) { } void gnw_tfish(machine_config &config); @@ -3268,11 +3221,11 @@ ROM_END ***************************************************************************/ -class gnw_smb_state : public hh_sm510_state +class gnw_smb_state : public gnw_state { public: gnw_smb_state(const machine_config &mconfig, device_type type, const char *tag) : - hh_sm510_state(mconfig, type, tag) + gnw_state(mconfig, type, tag) { } void gnw_smb(machine_config &config); @@ -3346,11 +3299,11 @@ ROM_END ***************************************************************************/ -class gnw_climber_state : public hh_sm510_state +class gnw_climber_state : public gnw_state { public: gnw_climber_state(const machine_config &mconfig, device_type type, const char *tag) : - hh_sm510_state(mconfig, type, tag) + gnw_state(mconfig, type, tag) { } void gnw_climber(machine_config &config); @@ -3445,11 +3398,11 @@ ROM_END ***************************************************************************/ -class gnw_bfight_state : public hh_sm510_state +class gnw_bfight_state : public gnw_state { public: gnw_bfight_state(const machine_config &mconfig, device_type type, const char *tag) : - hh_sm510_state(mconfig, type, tag) + gnw_state(mconfig, type, tag) { } void gnw_bfight(machine_config &config); @@ -3531,11 +3484,11 @@ ROM_END ***************************************************************************/ -class gnw_ssparky_state : public hh_sm510_state +class gnw_ssparky_state : public gnw_state { public: gnw_ssparky_state(const machine_config &mconfig, device_type type, const char *tag) : - hh_sm510_state(mconfig, type, tag) + gnw_state(mconfig, type, tag) { } void gnw_ssparky(machine_config &config); @@ -3573,8 +3526,6 @@ INPUT_PORTS_END void gnw_ssparky_state::gnw_ssparky(machine_config &config) { gnw_sm510(config, 627, 1080); // R mask option confirmed - - m_maincpu->read_ba().set_ioport("BA"); } // roms @@ -3601,11 +3552,11 @@ ROM_END ***************************************************************************/ -class gnw_boxing_state : public hh_sm510_state +class gnw_boxing_state : public gnw_state { public: gnw_boxing_state(const machine_config &mconfig, device_type type, const char *tag) : - hh_sm510_state(mconfig, type, tag) + gnw_state(mconfig, type, tag) { } void gnw_boxing(machine_config &config); @@ -3665,8 +3616,6 @@ INPUT_PORTS_END void gnw_boxing_state::gnw_boxing(machine_config &config) { gnw_sm511(config, 1920, 524); - - m_maincpu->read_ba().set_ioport("BA"); } // roms diff --git a/src/mame/includes/hh_sm510.h b/src/mame/includes/hh_sm510.h index 5e90da0653d..67d727e4ca5 100644 --- a/src/mame/includes/hh_sm510.h +++ b/src/mame/includes/hh_sm510.h @@ -82,18 +82,6 @@ protected: void common_sm511(machine_config &config, u16 width, u16 height); - void gnw_sm5a(machine_config &config, u16 width, u16 height); - void gnw_sm5a_matrix(machine_config &config, u16 width, u16 height); - void gnw_kb1013vk12_matrix(machine_config &config, u16 width, u16 height); - void gnw_sm510(machine_config &config, u16 width, u16 height); - void gnw_sm511(machine_config &config, u16 width, u16 height); - void gnw_dualh(machine_config &config, u16 leftwidth, u16 leftheight, u16 rightwidth, u16 rightheight); - void gnw_dualv(machine_config &config, u16 topwidth, u16 topheight, u16 botwidth, u16 botheight); - void gnw_sm510_dualh(machine_config &config, u16 leftwidth, u16 leftheight, u16 rightwidth, u16 rightheight); - void gnw_sm510_dualv(machine_config &config, u16 topwidth, u16 topheight, u16 botwidth, u16 botheight); - void gnw_sm511_dualv(machine_config &config, u16 topwidth, u16 topheight, u16 botwidth, u16 botheight); - void gnw_sm512_dualv(machine_config &config, u16 topwidth, u16 topheight, u16 botwidth, u16 botheight); - void konami_sm510(machine_config &config, u16 width, u16 height); void tiger_sm510_1bit(machine_config &config, u16 width, u16 height); |