From 2504edaaa738a8ad8844aac6bb50b73a855a66a6 Mon Sep 17 00:00:00 2001 From: hap Date: Sat, 19 Feb 2022 19:52:29 +0100 Subject: hh*: add private: section to classes --- src/mame/drivers/hh_amis2k.cpp | 43 +- src/mame/drivers/hh_cop400.cpp | 227 +++++----- src/mame/drivers/hh_cops1.cpp | 55 ++- src/mame/drivers/hh_hmcs40.cpp | 461 ++++++++++--------- src/mame/drivers/hh_melps4.cpp | 42 +- src/mame/drivers/hh_pic16.cpp | 188 ++++---- src/mame/drivers/hh_pps41.cpp | 128 +++--- src/mame/drivers/hh_sm510.cpp | 14 +- src/mame/drivers/hh_tms1k.cpp | 981 +++++++++++++++++++++++------------------ src/mame/drivers/hh_ucom4.cpp | 253 ++++++----- src/mame/drivers/tispeak.cpp | 51 ++- src/mame/drivers/tispellb.cpp | 23 +- src/mame/includes/hh_tms1k.h | 19 +- src/mame/layout/vidchal.lay | 4 +- 14 files changed, 1380 insertions(+), 1109 deletions(-) diff --git a/src/mame/drivers/hh_amis2k.cpp b/src/mame/drivers/hh_amis2k.cpp index a3886c0a330..53acb036d57 100644 --- a/src/mame/drivers/hh_amis2k.cpp +++ b/src/mame/drivers/hh_amis2k.cpp @@ -36,6 +36,10 @@ public: m_inputs(*this, "IN.%u", 0) { } +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + // devices required_device m_maincpu; optional_device m_display; @@ -43,16 +47,12 @@ public: optional_ioport_array<4> m_inputs; // max 4 // misc common - u16 m_a; // MCU address bus - u8 m_d; // MCU data bus - int m_f; // MCU F_out pin - u16 m_inp_mux; // multiplexed inputs mask + u16 m_a = 0; // MCU address bus + u8 m_d = 0; // MCU data bus + int m_f = 0; // MCU F_out pin + u16 m_inp_mux = 0; // multiplexed inputs mask u8 read_inputs(int columns); - -protected: - virtual void machine_start() override; - virtual void machine_reset() override; }; @@ -60,12 +60,6 @@ protected: void hh_amis2k_state::machine_start() { - // zerofill - m_a = 0; - m_d = 0; - m_f = 0; - m_inp_mux = 0; - // register for savestates save_item(NAME(m_a)); save_item(NAME(m_d)); @@ -145,6 +139,12 @@ public: hh_amis2k_state(mconfig, type, tag) { } + void wildfire(machine_config &config); + +protected: + virtual void machine_start() override; + +private: void update_display(); void write_d(u8 data); void write_a(u16 data); @@ -152,11 +152,7 @@ public: void speaker_update(); TIMER_DEVICE_CALLBACK_MEMBER(speaker_decay_sim); - double m_speaker_volume; - void wildfire(machine_config &config); - -protected: - virtual void machine_start() override; + double m_speaker_volume = 0.0; std::vector m_speaker_levels; }; @@ -164,9 +160,6 @@ protected: void wildfire_state::machine_start() { hh_amis2k_state::machine_start(); - - // zerofill/init - m_speaker_volume = 0; save_item(NAME(m_speaker_volume)); } @@ -236,7 +229,7 @@ static const u8 wildfire_7seg_table[0x10] = void wildfire_state::wildfire(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware AMI_S2152(config, m_maincpu, 850000); // approximation - RC osc. R=?, C=? m_maincpu->set_7seg_table(wildfire_7seg_table); m_maincpu->read_i().set_ioport("IN.0"); @@ -244,13 +237,13 @@ void wildfire_state::wildfire(machine_config &config) m_maincpu->write_a().set(FUNC(wildfire_state::write_a)); m_maincpu->write_f().set(FUNC(wildfire_state::write_f)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(12, 8); m_display->set_segmask(7, 0x7f); m_display->set_bri_levels(0.01, 0.1); // bumpers are dimmed config.set_default_layout(layout_wildfire); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); diff --git a/src/mame/drivers/hh_cop400.cpp b/src/mame/drivers/hh_cop400.cpp index 208398c8cd1..b8983aa1175 100644 --- a/src/mame/drivers/hh_cop400.cpp +++ b/src/mame/drivers/hh_cop400.cpp @@ -65,6 +65,12 @@ public: m_inputs(*this, "IN.%u", 0) { } + virtual DECLARE_INPUT_CHANGED_MEMBER(reset_button); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + // devices required_device m_maincpu; optional_device m_display; @@ -72,19 +78,14 @@ public: optional_ioport_array<6> m_inputs; // max 6 // misc common - u8 m_l; // MCU port L write data - u8 m_g; // MCU port G write data - u8 m_d; // MCU port D write data - int m_so; // MCU SO line state - int m_sk; // MCU SK line state - u16 m_inp_mux; // multiplexed inputs mask + u8 m_l = 0; // MCU port L write data + u8 m_g = 0; // MCU port G write data + u8 m_d = 0; // MCU port D write data + int m_so = 0; // MCU SO line state + int m_sk = 0; // MCU SK line state + u16 m_inp_mux = ~0; // multiplexed inputs mask u16 read_inputs(int columns, u16 colmask = ~0); - virtual DECLARE_INPUT_CHANGED_MEMBER(reset_button); - -protected: - virtual void machine_start() override; - virtual void machine_reset() override; }; @@ -92,14 +93,6 @@ protected: void hh_cop400_state::machine_start() { - // zerofill - m_l = 0; - m_g = 0; - m_d = 0; - m_so = 0; - m_sk = 0; - m_inp_mux = ~0; - // register for savestates save_item(NAME(m_l)); save_item(NAME(m_g)); @@ -170,10 +163,12 @@ public: hh_cop400_state(mconfig, type, tag) { } + void ctstein(machine_config &config); + +private: void write_g(u8 data); void write_l(u8 data); u8 read_l(); - void ctstein(machine_config &config); }; // handlers @@ -220,7 +215,7 @@ INPUT_PORTS_END void ctstein_state::ctstein(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware COP421(config, m_maincpu, 850000); // approximation - RC osc. R=12K, C=100pF m_maincpu->set_config(COP400_CKI_DIVISOR_4, COP400_CKO_OSCILLATOR_OUTPUT, false); // guessed m_maincpu->write_g().set(FUNC(ctstein_state::write_g)); @@ -228,11 +223,11 @@ void ctstein_state::ctstein(machine_config &config) m_maincpu->write_sk().set(m_speaker, FUNC(speaker_sound_device::level_w)); m_maincpu->read_l().set(FUNC(ctstein_state::read_l)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(1, 4); config.set_default_layout(layout_ctstein); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); } @@ -272,14 +267,15 @@ public: hh_cop400_state(mconfig, type, tag) { } + void h2hsoccerc(machine_config &config); + void h2hbaskbc(machine_config &config); + void h2hhockeyc(machine_config &config); + +private: void write_d(u8 data); void write_g(u8 data); void write_l(u8 data); u8 read_in(); - - void h2hsoccerc(machine_config &config); - void h2hbaskbc(machine_config &config); - void h2hhockeyc(machine_config &config); }; // handlers @@ -367,7 +363,7 @@ INPUT_PORTS_END void h2hbaskbc_state::h2hbaskbc(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware COP420(config, m_maincpu, 1000000); // approximation - RC osc. R=43K, C=101pF m_maincpu->set_config(COP400_CKI_DIVISOR_16, COP400_CKO_OSCILLATOR_OUTPUT, false); // guessed m_maincpu->write_d().set(FUNC(h2hbaskbc_state::write_d)); @@ -376,12 +372,12 @@ void h2hbaskbc_state::h2hbaskbc(machine_config &config) m_maincpu->read_in().set(FUNC(h2hbaskbc_state::read_in)); m_maincpu->write_so().set(m_speaker, FUNC(speaker_sound_device::level_w)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(16, 7); m_display->set_segmask(3, 0x7f); config.set_default_layout(layout_h2hbaskbc); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); } @@ -430,13 +426,15 @@ public: hh_cop400_state(mconfig, type, tag) { } + void einvaderc(machine_config &config); + +private: void update_display(); void write_d(u8 data); void write_g(u8 data); DECLARE_WRITE_LINE_MEMBER(write_sk); DECLARE_WRITE_LINE_MEMBER(write_so); void write_l(u8 data); - void einvaderc(machine_config &config); }; // handlers @@ -499,7 +497,7 @@ INPUT_PORTS_END void einvaderc_state::einvaderc(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware COP444L(config, m_maincpu, 850000); // approximation - RC osc. R=47K, C=100pF m_maincpu->set_config(COP400_CKI_DIVISOR_16, COP400_CKO_OSCILLATOR_OUTPUT, false); // guessed m_maincpu->read_in().set_ioport("IN.0"); @@ -509,7 +507,7 @@ void einvaderc_state::einvaderc(machine_config &config) m_maincpu->write_so().set(FUNC(einvaderc_state::write_so)); m_maincpu->write_l().set(FUNC(einvaderc_state::write_l)); - /* video hardware */ + // video hardware screen_device &mask(SCREEN(config, "mask", SCREEN_TYPE_SVG)); mask.set_refresh_hz(60); mask.set_size(919, 1080); @@ -519,7 +517,7 @@ void einvaderc_state::einvaderc(machine_config &config) m_display->set_segmask(7, 0x7f); config.set_default_layout(layout_einvaderc); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); } @@ -559,12 +557,14 @@ public: hh_cop400_state(mconfig, type, tag) { } + void unkeinv(machine_config &config); + +private: void update_display(); void write_g(u8 data); void write_d(u8 data); void write_l(u8 data); u8 read_l(); - void unkeinv(machine_config &config); }; // handlers @@ -627,7 +627,7 @@ INPUT_PORTS_END void unkeinv_state::unkeinv(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware COP421(config, m_maincpu, 850000); // frequency guessed m_maincpu->set_config(COP400_CKI_DIVISOR_4, COP400_CKO_OSCILLATOR_OUTPUT, false); // guessed m_maincpu->write_g().set(FUNC(unkeinv_state::write_g)); @@ -637,11 +637,11 @@ void unkeinv_state::unkeinv(machine_config &config) m_maincpu->read_l_tristate().set_constant(0xff); m_maincpu->write_so().set(m_speaker, FUNC(speaker_sound_device::level_w)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(6, 8); config.set_default_layout(layout_unkeinv); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); } @@ -681,21 +681,24 @@ public: m_motor_on_out(*this, "motor_on") { } + void lchicken(machine_config &config); + + DECLARE_READ_LINE_MEMBER(motor_switch_r); + +protected: + virtual void machine_start() override; + +private: output_finder<> m_motor_pos_out; output_finder<> m_motor_on_out; u8 m_motor_pos = 0; TIMER_DEVICE_CALLBACK_MEMBER(motor_sim_tick); - DECLARE_READ_LINE_MEMBER(motor_switch_r); void write_l(u8 data); void write_d(u8 data); void write_g(u8 data); u8 read_g(); - void lchicken(machine_config &config); - -protected: - virtual void machine_start() override; }; void lchicken_state::machine_start() @@ -782,7 +785,7 @@ INPUT_PORTS_END void lchicken_state::lchicken(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware COP421(config, m_maincpu, 850000); // approximation - RC osc. R=12K, C=100pF m_maincpu->set_config(COP400_CKI_DIVISOR_4, COP400_CKO_OSCILLATOR_OUTPUT, false); // guessed m_maincpu->write_l().set(FUNC(lchicken_state::write_l)); @@ -794,11 +797,11 @@ void lchicken_state::lchicken(machine_config &config) TIMER(config, "chicken_motor").configure_periodic(FUNC(lchicken_state::motor_sim_tick), attotime::from_msec(6000/0x100)); // ~6sec for a full rotation - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(3, 4); config.set_default_layout(layout_lchicken); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); } @@ -829,13 +832,15 @@ public: hh_cop400_state(mconfig, type, tag) { } + void funjacks(machine_config &config); + +private: void update_display(); void write_d(u8 data); void write_l(u8 data); void write_g(u8 data); u8 read_l(); u8 read_g(); - void funjacks(machine_config &config); }; // handlers @@ -906,7 +911,7 @@ INPUT_PORTS_END void funjacks_state::funjacks(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware COP410(config, m_maincpu, 850000); // approximation - RC osc. R=47K, C=56pF m_maincpu->set_config(COP400_CKI_DIVISOR_16, COP400_CKO_OSCILLATOR_OUTPUT, false); // guessed m_maincpu->write_d().set(FUNC(funjacks_state::write_d)); @@ -915,11 +920,11 @@ void funjacks_state::funjacks(machine_config &config) m_maincpu->read_l().set(FUNC(funjacks_state::read_l)); m_maincpu->read_g().set(FUNC(funjacks_state::read_g)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(4, 2); config.set_default_layout(layout_funjacks); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); } @@ -954,11 +959,13 @@ public: hh_cop400_state(mconfig, type, tag) { } + void funrlgl(machine_config &config); + +private: void update_display(); void write_d(u8 data); void write_l(u8 data); void write_g(u8 data); - void funrlgl(machine_config &config); }; // handlers @@ -1006,7 +1013,7 @@ INPUT_PORTS_END void funrlgl_state::funrlgl(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware COP410(config, m_maincpu, 800000); // approximation - RC osc. R=51K, C=91pF m_maincpu->set_config(COP400_CKI_DIVISOR_16, COP400_CKO_OSCILLATOR_OUTPUT, false); // guessed m_maincpu->write_d().set(FUNC(funrlgl_state::write_d)); @@ -1015,12 +1022,12 @@ void funrlgl_state::funrlgl(machine_config &config) m_maincpu->write_g().set(FUNC(funrlgl_state::write_g)); m_maincpu->read_g().set_ioport("IN.0"); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(4, 4); m_display->set_bri_levels(0.005, 0.1); // top led is brighter config.set_default_layout(layout_funrlgl); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); } @@ -1051,13 +1058,15 @@ public: hh_cop400_state(mconfig, type, tag) { } + void funtag(machine_config &config); + +private: void update_display(); void write_d(u8 data); void write_l(u8 data); void write_g(u8 data); u8 read_l(); u8 read_g(); - void funtag(machine_config &config); }; // handlers @@ -1127,7 +1136,7 @@ INPUT_PORTS_END void funtag_state::funtag(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware COP410(config, m_maincpu, 1000000); // approximation - RC osc. R=47K, C=91pF m_maincpu->set_config(COP400_CKI_DIVISOR_16, COP400_CKO_OSCILLATOR_OUTPUT, false); // guessed m_maincpu->write_d().set(FUNC(funtag_state::write_d)); @@ -1136,11 +1145,11 @@ void funtag_state::funtag(machine_config &config) m_maincpu->read_l().set(FUNC(funtag_state::read_l)); m_maincpu->read_g().set(FUNC(funtag_state::read_g)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(4, 2); config.set_default_layout(layout_funtag); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); } @@ -1182,8 +1191,15 @@ public: m_on_timer(*this, "on_timer") { } + void mbaskb2(machine_config &config); + void msoccer2(machine_config &config); + DECLARE_CUSTOM_INPUT_MEMBER(switch_r); +protected: + virtual void machine_reset() override; + +private: required_device m_subcpu; required_device m_on_timer; @@ -1193,12 +1209,6 @@ public: void sub_write_g(u8 data); void sub_write_d(u8 data); u8 sub_read_in(); - - void mbaskb2(machine_config &config); - void msoccer2(machine_config &config); - -protected: - virtual void machine_reset() override; }; void mbaskb2_state::machine_reset() @@ -1291,7 +1301,7 @@ INPUT_PORTS_END void mbaskb2_state::mbaskb2(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware COP420(config, m_maincpu, 500000); // approximation m_maincpu->set_config(COP400_CKI_DIVISOR_8, COP400_CKO_SYNC_INPUT, false); // guessed m_maincpu->write_g().set(FUNC(mbaskb2_state::main_write_g)); @@ -1315,13 +1325,13 @@ void mbaskb2_state::mbaskb2(machine_config &config) TIMER(config, "on_timer").configure_generic(nullptr); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(8, 7); m_display->set_segmask(0xc0, 0x7f); m_display->set_bri_levels(0.008, 0.04); // offense is brighter config.set_default_layout(layout_mbaskb2); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); } @@ -1372,11 +1382,13 @@ public: hh_cop400_state(mconfig, type, tag) { } + void lafootb(machine_config &config); + +private: void update_display(); void write_l(u8 data); void write_d(u8 data); u8 read_g(); - void lafootb(machine_config &config); }; // handlers @@ -1428,7 +1440,7 @@ INPUT_PORTS_END void lafootb_state::lafootb(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware COP421(config, m_maincpu, 900000); // approximation - RC osc. R=51K, C=100pF m_maincpu->set_config(COP400_CKI_DIVISOR_16, COP400_CKO_OSCILLATOR_OUTPUT, false); // guessed m_maincpu->write_l().set(FUNC(lafootb_state::write_l)); @@ -1436,7 +1448,7 @@ void lafootb_state::lafootb(machine_config &config) m_maincpu->read_g().set(FUNC(lafootb_state::read_g)); m_maincpu->write_sk().set(m_speaker, FUNC(speaker_sound_device::level_w)); - /* video hardware */ + // video hardware screen_device &mask(SCREEN(config, "mask", SCREEN_TYPE_SVG)); mask.set_refresh_hz(60); mask.set_size(1920, 864); @@ -1448,7 +1460,7 @@ void lafootb_state::lafootb(machine_config &config) m_display->set_bri_levels(0.005); config.set_default_layout(layout_lafootb); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); } @@ -1484,12 +1496,14 @@ public: hh_cop400_state(mconfig, type, tag) { } + void mdallas(machine_config &config); + +private: void update_display(); void write_l(u8 data); void write_d(u8 data); void write_g(u8 data); u8 read_in(); - void mdallas(machine_config &config); }; // handlers @@ -1580,7 +1594,7 @@ INPUT_PORTS_END void mdallas_state::mdallas(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware COP444L(config, m_maincpu, 1000000); // approximation - RC osc. R=57K, C=101pF m_maincpu->set_config(COP400_CKI_DIVISOR_16, COP400_CKO_OSCILLATOR_OUTPUT, false); // guessed m_maincpu->write_l().set(FUNC(mdallas_state::write_l)); @@ -1589,12 +1603,12 @@ void mdallas_state::mdallas(machine_config &config) m_maincpu->read_in().set(FUNC(mdallas_state::read_in)); m_maincpu->write_so().set(m_speaker, FUNC(speaker_sound_device::level_w)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(8, 8); m_display->set_segmask(0xff, 0xff); config.set_default_layout(layout_mdallas); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); } @@ -1628,10 +1642,12 @@ public: hh_cop400_state(mconfig, type, tag) { } + void plus1(machine_config &config); + +private: void write_d(u8 data); void write_l(u8 data); u8 read_l(); - void plus1(machine_config &config); }; // handlers @@ -1672,7 +1688,7 @@ INPUT_PORTS_END void plus1_state::plus1(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware COP410(config, m_maincpu, 1000000); // approximation - RC osc. R=51K, C=100pF m_maincpu->set_config(COP400_CKI_DIVISOR_16, COP400_CKO_OSCILLATOR_OUTPUT, false); // guessed m_maincpu->write_d().set(FUNC(plus1_state::write_d)); @@ -1680,9 +1696,9 @@ void plus1_state::plus1(machine_config &config) m_maincpu->write_l().set(FUNC(plus1_state::write_l)); m_maincpu->read_l().set(FUNC(plus1_state::read_l)); - /* no visual feedback! */ + // no visual feedback! - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); } @@ -1725,12 +1741,14 @@ public: hh_cop400_state(mconfig, type, tag) { } + void lightfgt(machine_config &config); + +private: void update_display(); DECLARE_WRITE_LINE_MEMBER(write_so); void write_d(u8 data); void write_l(u8 data); u8 read_g(); - void lightfgt(machine_config &config); }; // handlers @@ -1806,7 +1824,7 @@ INPUT_PORTS_END void lightfgt_state::lightfgt(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware COP421(config, m_maincpu, 950000); // approximation - RC osc. R=82K, C=56pF m_maincpu->set_config(COP400_CKI_DIVISOR_16, COP400_CKO_OSCILLATOR_OUTPUT, false); // guessed m_maincpu->write_so().set(FUNC(lightfgt_state::write_so)); @@ -1815,11 +1833,11 @@ void lightfgt_state::lightfgt(machine_config &config) m_maincpu->write_sk().set(m_speaker, FUNC(speaker_sound_device::level_w)); m_maincpu->read_g().set(FUNC(lightfgt_state::read_g)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(5, 5); config.set_default_layout(layout_lightfgt); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); } @@ -1851,12 +1869,14 @@ public: hh_cop400_state(mconfig, type, tag) { } + void bship82(machine_config &config); + +private: void write_d(u8 data); void write_g(u8 data); u8 read_l(); u8 read_in(); DECLARE_WRITE_LINE_MEMBER(write_so); - void bship82(machine_config &config); }; // handlers @@ -1957,7 +1977,7 @@ INPUT_PORTS_END void bship82_state::bship82(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware COP420(config, m_maincpu, 750000); // approximation - RC osc. R=14K, C=100pF m_maincpu->set_config(COP400_CKI_DIVISOR_4, COP400_CKO_OSCILLATOR_OUTPUT, false); // guessed m_maincpu->write_d().set(FUNC(bship82_state::write_d)); @@ -1967,11 +1987,11 @@ void bship82_state::bship82(machine_config &config) m_maincpu->write_so().set(FUNC(bship82_state::write_so)); m_maincpu->read_si().set_ioport("IN.4"); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(1, 1); config.set_default_layout(layout_bship82); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); static const double speaker_levels[8] = { 0.0, 1.0/7.0, 2.0/7.0, 3.0/7.0, 4.0/7.0, 5.0/7.0, 6.0/7.0, 1.0 }; @@ -2008,13 +2028,15 @@ public: hh_cop400_state(mconfig, type, tag) { } + void qkracer(machine_config &config); + +private: void update_display(); void write_d(u8 data); void write_g(u8 data); void write_l(u8 data); u8 read_in(); DECLARE_WRITE_LINE_MEMBER(write_sk); - void qkracer(machine_config &config); }; // handlers @@ -2096,7 +2118,7 @@ INPUT_PORTS_END void qkracer_state::qkracer(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware COP420(config, m_maincpu, 950000); // approximation - RC osc. R=47K, C=100pF m_maincpu->set_config(COP400_CKI_DIVISOR_16, COP400_CKO_OSCILLATOR_OUTPUT, false); // guessed m_maincpu->write_d().set(FUNC(qkracer_state::write_d)); @@ -2105,13 +2127,13 @@ void qkracer_state::qkracer(machine_config &config) m_maincpu->read_in().set(FUNC(qkracer_state::read_in)); m_maincpu->write_sk().set(FUNC(qkracer_state::write_sk)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(9, 7); m_display->set_segmask(0xdf, 0x7f); m_display->set_segmask(0x20, 0x41); // equals sign config.set_default_layout(layout_qkracer); - /* no sound! */ + // no sound! } // roms @@ -2151,13 +2173,16 @@ public: hh_cop400_state(mconfig, type, tag) { } + void scat(machine_config &config); + +private: + void main_map(address_map &map); + void update_display(); void write_d(u8 data); void write_g(u8 data); void write_l(u8 data); u8 read_in(); - void main_map(address_map &map); - void scat(machine_config &config); }; // handlers @@ -2243,7 +2268,7 @@ INPUT_PORTS_END void scat_state::scat(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware COP404L(config, m_maincpu, 1500000); // R/C OSC via MM74C14N m_maincpu->set_config(COP400_CKI_DIVISOR_32, COP400_CKO_OSCILLATOR_OUTPUT, false); // guessed m_maincpu->set_addrmap(AS_PROGRAM, &scat_state::main_map); @@ -2252,12 +2277,12 @@ void scat_state::scat(machine_config &config) m_maincpu->write_l().set(FUNC(scat_state::write_l)); m_maincpu->read_in().set(FUNC(scat_state::read_in)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(8, 8); m_display->set_segmask(0xff, 0xff); config.set_default_layout(layout_scat); - /* no sound! */ + // no sound! } // roms @@ -2295,11 +2320,13 @@ public: hh_cop400_state(mconfig, type, tag) { } + void vidchal(machine_config &config); + +private: void update_display(); void write_d(u8 data); void write_l(u8 data); DECLARE_WRITE_LINE_MEMBER(write_sk); - void vidchal(machine_config &config); }; // handlers @@ -2342,7 +2369,7 @@ INPUT_PORTS_END void vidchal_state::vidchal(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware COP420(config, m_maincpu, 900000); // approximation m_maincpu->set_config(COP400_CKI_DIVISOR_4, COP400_CKO_OSCILLATOR_OUTPUT, false); // guessed m_maincpu->write_d().set(FUNC(vidchal_state::write_d)); @@ -2351,12 +2378,12 @@ void vidchal_state::vidchal(machine_config &config) m_maincpu->read_in().set_ioport("IN.0"); m_maincpu->write_sk().set(FUNC(vidchal_state::write_sk)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(6+1, 8); m_display->set_segmask(0x3f, 0xff); config.set_default_layout(layout_vidchal); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); DAC_4BIT_BINARY_WEIGHTED_SIGN_MAGNITUDE(config, "dac").add_route(ALL_OUTPUTS, "mono", 0.125); // unknown DAC } diff --git a/src/mame/drivers/hh_cops1.cpp b/src/mame/drivers/hh_cops1.cpp index e36cfc0d8fe..aef775d03b5 100644 --- a/src/mame/drivers/hh_cops1.cpp +++ b/src/mame/drivers/hh_cops1.cpp @@ -48,6 +48,10 @@ public: m_inputs(*this, "IN.%u", 0) { } +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + // devices required_device m_maincpu; optional_device m_display; @@ -64,10 +68,6 @@ public: int m_blk = false; u8 read_inputs(int columns); - -protected: - virtual void machine_start() override; - virtual void machine_reset() override; }; @@ -152,17 +152,18 @@ public: hh_cops1_state(mconfig, type, tag) { } + void mbaskb(machine_config &config); + void msoccer(machine_config &config); + void mhockey(machine_config &config); + void mhockeya(machine_config &config); + +private: void update_display(); void write_do(u8 data); void write_blk(int state); void write_s(u8 data); void write_f(u8 data); u8 read_f(); - - void mbaskb(machine_config &config); - void msoccer(machine_config &config); - void mhockey(machine_config &config); - void mhockeya(machine_config &config); }; // handlers @@ -244,7 +245,7 @@ INPUT_PORTS_END void mbaskb_state::mbaskb(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware MM5799(config, m_maincpu, 370000); // approximation m_maincpu->write_do().set(FUNC(mbaskb_state::write_do)); m_maincpu->write_blk().set(FUNC(mbaskb_state::write_blk)); @@ -254,13 +255,13 @@ void mbaskb_state::mbaskb(machine_config &config) m_maincpu->read_k().set_ioport("IN.0"); m_maincpu->read_inb().set_ioport("IN.1"); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(8, 7); m_display->set_segmask(3, 0x7f); m_display->set_bri_levels(0.015, 0.2); // ball led is brighter config.set_default_layout(layout_mbaskb); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); static const double speaker_levels[4] = { 0.0, 1.0, -1.0, 0.0 }; @@ -351,6 +352,9 @@ public: m_ds8874(*this, "ds8874") { } + void qkracerm(machine_config &config); + +private: required_device m_ds8874; void ds8874_output_w(u16 data); @@ -360,7 +364,6 @@ public: u8 read_f(); u8 read_k(); int read_si(); - void qkracerm(machine_config &config); }; // handlers @@ -450,7 +453,7 @@ INPUT_PORTS_END void qkracerm_state::qkracerm(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware MM5799(config, m_maincpu, 220000); // approximation m_maincpu->set_option_ram_d12(true); m_maincpu->set_option_lb_10(5); @@ -460,14 +463,14 @@ void qkracerm_state::qkracerm(machine_config &config) m_maincpu->read_k().set(FUNC(qkracerm_state::read_k)); m_maincpu->read_si().set(FUNC(qkracerm_state::read_si)); - /* video hardware */ + // video hardware DS8874(config, m_ds8874).write_output().set(FUNC(qkracerm_state::ds8874_output_w)); PWM_DISPLAY(config, m_display).set_size(9, 7); m_display->set_segmask(0xdf, 0x7f); m_display->set_segmask(0x20, 0x41); // equals sign config.set_default_layout(layout_qkracerm); - /* no sound! */ + // no sound! } // roms @@ -508,13 +511,15 @@ public: hh_cops1_state(mconfig, type, tag) { } + void qkspeller(machine_config &config); + +private: void update_display(); void write_do(u8 data); void write_s(u8 data); void write_f(u8 data); u8 read_f(); u8 read_k(); - void qkspeller(machine_config &config); }; // handlers @@ -630,7 +635,7 @@ INPUT_PORTS_END void qkspeller_state::qkspeller(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware MM5799(config, m_maincpu, 220000); // approximation m_maincpu->write_do().set(FUNC(qkspeller_state::write_do)); m_maincpu->write_s().set(FUNC(qkspeller_state::write_s)); @@ -640,12 +645,12 @@ void qkspeller_state::qkspeller(machine_config &config) m_maincpu->read_inb().set_ioport("TEST.0"); m_maincpu->read_do3().set_ioport("TEST.1"); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(4, 7); m_display->set_segmask(3, 0x7f); config.set_default_layout(layout_qkspeller); - /* no sound! */ + // no sound! } // roms @@ -695,6 +700,9 @@ public: m_ds8874(*this, "ds8874") { } + void cambrp(machine_config &config); + +private: required_device m_ds8874; void ds8874_output_w(u16 data); @@ -703,7 +711,6 @@ public: void write_s(u8 data); u8 read_f(); u8 read_k(); - void cambrp(machine_config &config); }; // handlers @@ -789,7 +796,7 @@ INPUT_PORTS_END void cambrp_state::cambrp(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware MM5799(config, m_maincpu, 200000); // approximation m_maincpu->set_option_ram_d12(true); m_maincpu->set_option_lb_10(4); @@ -798,13 +805,13 @@ void cambrp_state::cambrp(machine_config &config) m_maincpu->read_f().set(FUNC(cambrp_state::read_f)); m_maincpu->read_k().set(FUNC(cambrp_state::read_k)); - /* video hardware */ + // video hardware DS8874(config, m_ds8874).write_output().set(FUNC(cambrp_state::ds8874_output_w)); PWM_DISPLAY(config, m_display).set_size(9, 8); m_display->set_segmask(0x1ff, 0xff); config.set_default_layout(layout_cambrp); - /* no sound! */ + // no sound! } // roms diff --git a/src/mame/drivers/hh_hmcs40.cpp b/src/mame/drivers/hh_hmcs40.cpp index 9e4626f83ef..0c69858ca4a 100644 --- a/src/mame/drivers/hh_hmcs40.cpp +++ b/src/mame/drivers/hh_hmcs40.cpp @@ -156,6 +156,12 @@ public: m_inputs(*this, "IN.%u", 0) { } + DECLARE_INPUT_CHANGED_MEMBER(single_interrupt_line); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + // devices required_device m_maincpu; optional_device m_display; @@ -163,22 +169,17 @@ public: optional_ioport_array<7> m_inputs; // max 7 // misc common - u8 m_r[8]; // MCU R ports write data (optional) - u16 m_d; // MCU D port write data (optional) - u8 m_int[2]; // MCU INT0/1 pins state - u16 m_inp_mux; // multiplexed inputs mask + u8 m_r[8] = { }; // MCU R ports write data (optional) + u16 m_d = 0; // MCU D port write data (optional) + u8 m_int[2] = { }; // MCU INT0/1 pins state + u16 m_inp_mux = 0; // multiplexed inputs mask - u32 m_grid; // VFD current row data - u64 m_plate; // VFD current column data + u32 m_grid = 0; // VFD current row data + u64 m_plate = 0; // VFD current column data u16 read_inputs(int columns); void refresh_interrupts(void); void set_interrupt(int line, int state); - DECLARE_INPUT_CHANGED_MEMBER(single_interrupt_line); - -protected: - virtual void machine_start() override; - virtual void machine_reset() override; }; @@ -186,14 +187,6 @@ protected: void hh_hmcs40_state::machine_start() { - // zerofill - memset(m_r, 0, sizeof(m_r)); - memset(m_int, 0, sizeof(m_int)); - m_d = 0; - m_inp_mux = 0; - m_grid = 0; - m_plate = 0; - // register for savestates save_item(NAME(m_r)); save_item(NAME(m_int)); @@ -283,10 +276,12 @@ public: hh_hmcs40_state(mconfig, type, tag) { } + void bambball(machine_config &config); + +private: void plate_w(offs_t offset, u8 data); void grid_w(u16 data); u8 input_r(); - void bambball(machine_config &config); }; // handlers @@ -354,7 +349,7 @@ INPUT_PORTS_END void bambball_state::bambball(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware HD38750(config, m_maincpu, 400000); // approximation m_maincpu->read_r<0>().set(FUNC(bambball_state::input_r)); m_maincpu->write_r<1>().set(FUNC(bambball_state::plate_w)); @@ -362,7 +357,7 @@ void bambball_state::bambball(machine_config &config) m_maincpu->write_r<3>().set(FUNC(bambball_state::plate_w)); m_maincpu->write_d().set(FUNC(bambball_state::grid_w)); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); screen.set_refresh_hz(60); screen.set_size(1920, 478); @@ -371,7 +366,7 @@ void bambball_state::bambball(machine_config &config) PWM_DISPLAY(config, m_display).set_size(9, 16); config.set_default_layout(layout_bambball); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); } @@ -407,11 +402,13 @@ public: hh_hmcs40_state(mconfig, type, tag) { } + void bmboxing(machine_config &config); + +private: void update_display(); void plate_w(offs_t offset, u8 data); void grid_w(u16 data); u8 input_r(); - void bmboxing(machine_config &config); }; // handlers @@ -501,7 +498,7 @@ INPUT_PORTS_END void bmboxing_state::bmboxing(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware HD38750(config, m_maincpu, 400000); // approximation m_maincpu->read_r<0>().set(FUNC(bmboxing_state::input_r)); m_maincpu->write_r<1>().set(FUNC(bmboxing_state::plate_w)); @@ -510,7 +507,7 @@ void bmboxing_state::bmboxing(machine_config &config) m_maincpu->write_d().set(FUNC(bmboxing_state::grid_w)); m_maincpu->read_d().set_ioport("IN.4"); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); screen.set_refresh_hz(60); screen.set_size(1920, 529); @@ -518,7 +515,7 @@ void bmboxing_state::bmboxing(machine_config &config) PWM_DISPLAY(config, m_display).set_size(9, 12); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); } @@ -554,13 +551,15 @@ public: hh_hmcs40_state(mconfig, type, tag) { } + void bfriskyt(machine_config &config); + + DECLARE_INPUT_CHANGED_MEMBER(input_changed) { update_int1(); } + +private: + void update_int1(); void update_display(); void plate_w(offs_t offset, u8 data); void grid_w(u16 data); - - void update_int1(); - DECLARE_INPUT_CHANGED_MEMBER(input_changed) { update_int1(); } - void bfriskyt(machine_config &config); }; // handlers @@ -631,7 +630,7 @@ INPUT_PORTS_END void bfriskyt_state::bfriskyt(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware HD38800(config, m_maincpu, 400000); // approximation m_maincpu->write_r<0>().set(FUNC(bfriskyt_state::plate_w)); m_maincpu->write_r<1>().set(FUNC(bfriskyt_state::plate_w)); @@ -639,7 +638,7 @@ void bfriskyt_state::bfriskyt(machine_config &config) m_maincpu->write_r<3>().set(FUNC(bfriskyt_state::plate_w)); m_maincpu->write_d().set(FUNC(bfriskyt_state::grid_w)); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); screen.set_refresh_hz(60); screen.set_size(1920, 675); @@ -647,7 +646,7 @@ void bfriskyt_state::bfriskyt(machine_config &config) PWM_DISPLAY(config, m_display).set_size(8, 22); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); } @@ -689,10 +688,12 @@ public: hh_hmcs40_state(mconfig, type, tag) { } + void packmon(machine_config &config); + +private: void plate_w(offs_t offset, u8 data); void grid_w(u16 data); u16 input_r(); - void packmon(machine_config &config); }; // handlers @@ -751,7 +752,7 @@ INPUT_PORTS_END void packmon_state::packmon(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware HD38800(config, m_maincpu, 400000); // approximation m_maincpu->write_r<0>().set(FUNC(packmon_state::plate_w)); m_maincpu->write_r<1>().set(FUNC(packmon_state::plate_w)); @@ -760,7 +761,7 @@ void packmon_state::packmon(machine_config &config) m_maincpu->write_d().set(FUNC(packmon_state::grid_w)); m_maincpu->read_d().set(FUNC(packmon_state::input_r)); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); screen.set_refresh_hz(60); screen.set_size(1920, 680); @@ -769,7 +770,7 @@ void packmon_state::packmon(machine_config &config) PWM_DISPLAY(config, m_display).set_size(10, 20); config.set_default_layout(layout_packmon); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); } @@ -806,12 +807,14 @@ public: hh_hmcs40_state(mconfig, type, tag) { } - void plate_w(offs_t offset, u8 data); - void grid_w(u16 data); + void bzaxxon(machine_config &config); - void update_int1(); DECLARE_INPUT_CHANGED_MEMBER(input_changed) { update_int1(); } - void bzaxxon(machine_config &config); + +private: + void update_int1(); + void plate_w(offs_t offset, u8 data); + void grid_w(u16 data); }; // handlers @@ -879,7 +882,7 @@ INPUT_PORTS_END void bzaxxon_state::bzaxxon(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware HD38800(config, m_maincpu, 450000); // approximation m_maincpu->write_r<0>().set(FUNC(bzaxxon_state::plate_w)); m_maincpu->write_r<1>().set(FUNC(bzaxxon_state::plate_w)); @@ -888,7 +891,7 @@ void bzaxxon_state::bzaxxon(machine_config &config) m_maincpu->write_d().set(FUNC(bzaxxon_state::grid_w)); m_maincpu->read_d().set_ioport("IN.5"); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); screen.set_refresh_hz(60); screen.set_size(613, 1080); @@ -896,7 +899,7 @@ void bzaxxon_state::bzaxxon(machine_config &config) PWM_DISPLAY(config, m_display).set_size(11, 20); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); } @@ -935,12 +938,14 @@ public: hh_hmcs40_state(mconfig, type, tag) { } - void plate_w(offs_t offset, u8 data); - void grid_w(u16 data); + void zackman(machine_config &config); - void update_int0(); DECLARE_INPUT_CHANGED_MEMBER(input_changed) { update_int0(); } - void zackman(machine_config &config); + +private: + void update_int0(); + void plate_w(offs_t offset, u8 data); + void grid_w(u16 data); }; // handlers @@ -1004,7 +1009,7 @@ INPUT_PORTS_END void zackman_state::zackman(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware HD38820(config, m_maincpu, 400000); // approximation m_maincpu->write_r<0>().set(FUNC(zackman_state::plate_w)); m_maincpu->write_r<1>().set(FUNC(zackman_state::plate_w)); @@ -1015,7 +1020,7 @@ void zackman_state::zackman(machine_config &config) m_maincpu->write_r<6>().set(FUNC(zackman_state::plate_w)); m_maincpu->write_d().set(FUNC(zackman_state::grid_w)); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); screen.set_refresh_hz(60); screen.set_size(487, 1080); @@ -1023,7 +1028,7 @@ void zackman_state::zackman(machine_config &config) PWM_DISPLAY(config, m_display).set_size(8, 29); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); } @@ -1059,13 +1064,15 @@ public: hh_hmcs40_state(mconfig, type, tag) { } + void bpengo(machine_config &config); + + DECLARE_INPUT_CHANGED_MEMBER(input_changed) { update_int0(); } + +private: + void update_int0(); void update_display(); void plate_w(offs_t offset, u8 data); void grid_w(u16 data); - - void update_int0(); - DECLARE_INPUT_CHANGED_MEMBER(input_changed) { update_int0(); } - void bpengo(machine_config &config); }; // handlers @@ -1136,7 +1143,7 @@ INPUT_PORTS_END void bpengo_state::bpengo(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware HD38820(config, m_maincpu, 400000); // approximation m_maincpu->write_r<0>().set(FUNC(bpengo_state::plate_w)); m_maincpu->write_r<1>().set(FUNC(bpengo_state::plate_w)); @@ -1148,7 +1155,7 @@ void bpengo_state::bpengo(machine_config &config) m_maincpu->write_d().set(FUNC(bpengo_state::grid_w)); m_maincpu->read_d().set_ioport("IN.5"); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); screen.set_refresh_hz(60); screen.set_size(1920, 759); @@ -1156,7 +1163,7 @@ void bpengo_state::bpengo(machine_config &config) PWM_DISPLAY(config, m_display).set_size(8, 25); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); } @@ -1192,13 +1199,15 @@ public: hh_hmcs40_state(mconfig, type, tag) { } + void bbtime(machine_config &config); + + DECLARE_INPUT_CHANGED_MEMBER(input_changed) { update_int0(); } + +private: + void update_int0(); void update_display(); void plate_w(offs_t offset, u8 data); void grid_w(u16 data); - - void update_int0(); - DECLARE_INPUT_CHANGED_MEMBER(input_changed) { update_int0(); } - void bbtime(machine_config &config); }; // handlers @@ -1266,7 +1275,7 @@ INPUT_PORTS_END void bbtime_state::bbtime(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware HD38820(config, m_maincpu, 400000); // approximation m_maincpu->write_r<0>().set(FUNC(bbtime_state::plate_w)); m_maincpu->write_r<1>().set(FUNC(bbtime_state::plate_w)); @@ -1277,7 +1286,7 @@ void bbtime_state::bbtime(machine_config &config) m_maincpu->write_r<6>().set(FUNC(bbtime_state::plate_w)); m_maincpu->write_d().set(FUNC(bbtime_state::grid_w)); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); screen.set_refresh_hz(60); screen.set_size(379, 1080); @@ -1285,7 +1294,7 @@ void bbtime_state::bbtime(machine_config &config) PWM_DISPLAY(config, m_display).set_size(6, 28); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); } @@ -1321,9 +1330,11 @@ public: hh_hmcs40_state(mconfig, type, tag) { } + void bdoramon(machine_config &config); + +private: void plate_w(offs_t offset, u8 data); void grid_w(u16 data); - void bdoramon(machine_config &config); }; // handlers @@ -1376,7 +1387,7 @@ INPUT_PORTS_END void bdoramon_state::bdoramon(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware HD38800(config, m_maincpu, 400000); // approximation m_maincpu->write_r<0>().set(FUNC(bdoramon_state::plate_w)); m_maincpu->write_r<1>().set(FUNC(bdoramon_state::plate_w)); @@ -1386,7 +1397,7 @@ void bdoramon_state::bdoramon(machine_config &config) m_maincpu->write_d().set(FUNC(bdoramon_state::grid_w)); m_maincpu->read_d().set_ioport("IN.2"); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); screen.set_refresh_hz(60); screen.set_size(1920, 668); @@ -1394,7 +1405,7 @@ void bdoramon_state::bdoramon(machine_config &config) PWM_DISPLAY(config, m_display).set_size(8, 19); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); } @@ -1430,9 +1441,11 @@ public: hh_hmcs40_state(mconfig, type, tag) { } + void bultrman(machine_config &config); + +private: void plate_w(offs_t offset, u8 data); void grid_w(u16 data); - void bultrman(machine_config &config); }; // handlers @@ -1478,7 +1491,7 @@ INPUT_PORTS_END void bultrman_state::bultrman(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware HD38800(config, m_maincpu, 350000); // approximation m_maincpu->write_r<0>().set(FUNC(bultrman_state::plate_w)); m_maincpu->write_r<1>().set(FUNC(bultrman_state::plate_w)); @@ -1487,7 +1500,7 @@ void bultrman_state::bultrman(machine_config &config) m_maincpu->write_d().set(FUNC(bultrman_state::grid_w)); m_maincpu->read_d().set_ioport("IN.1"); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); screen.set_refresh_hz(60); screen.set_size(1920, 673); @@ -1495,7 +1508,7 @@ void bultrman_state::bultrman(machine_config &config) PWM_DISPLAY(config, m_display).set_size(8, 18); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); } @@ -1531,10 +1544,12 @@ public: hh_hmcs40_state(mconfig, type, tag) { } + void machiman(machine_config &config); + +private: void update_display(); void plate_w(offs_t offset, u8 data); void grid_w(u16 data); - void machiman(machine_config &config); }; // handlers @@ -1577,7 +1592,7 @@ INPUT_PORTS_END void machiman_state::machiman(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware HD38820(config, m_maincpu, 400000); // approximation m_maincpu->write_r<0>().set(FUNC(machiman_state::plate_w)); m_maincpu->write_r<1>().set(FUNC(machiman_state::plate_w)); @@ -1587,7 +1602,7 @@ void machiman_state::machiman(machine_config &config) m_maincpu->write_d().set(FUNC(machiman_state::grid_w)); m_maincpu->read_d().set_ioport("IN.1"); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); screen.set_refresh_hz(60); screen.set_size(1534, 1080); @@ -1595,7 +1610,7 @@ void machiman_state::machiman(machine_config &config) PWM_DISPLAY(config, m_display).set_size(5, 19); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); } @@ -1638,6 +1653,9 @@ public: m_soundlatch(*this, "soundlatch%u", 0) { } + void pairmtch(machine_config &config); + +private: required_device m_audiocpu; required_device_array m_soundlatch; @@ -1649,7 +1667,6 @@ public: void sound_w(u8 data); void sound2_w(u8 data); void speaker_w(u16 data); - void pairmtch(machine_config &config); }; // handlers: maincpu side @@ -1745,7 +1762,7 @@ INPUT_PORTS_END void pairmtch_state::pairmtch(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware HD38820(config, m_maincpu, 400000); // approximation m_maincpu->write_r<2>().set(FUNC(pairmtch_state::plate_w)); m_maincpu->write_r<3>().set(FUNC(pairmtch_state::plate_w)); @@ -1763,11 +1780,11 @@ void pairmtch_state::pairmtch(machine_config &config) config.set_perfect_quantum(m_maincpu); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(6, 12); config.set_default_layout(layout_pairmtch); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); @@ -1809,10 +1826,12 @@ public: hh_hmcs40_state(mconfig, type, tag) { } + void alnattck(machine_config &config); + +private: void plate_w(offs_t offset, u8 data); void grid_w(u16 data); u16 input_r(); - void alnattck(machine_config &config); }; // handlers @@ -1878,7 +1897,7 @@ INPUT_PORTS_END void alnattck_state::alnattck(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware HD38800(config, m_maincpu, 400000); // approximation m_maincpu->write_r<0>().set(FUNC(alnattck_state::plate_w)); m_maincpu->write_r<1>().set(FUNC(alnattck_state::plate_w)); @@ -1887,7 +1906,7 @@ void alnattck_state::alnattck(machine_config &config) m_maincpu->write_d().set(FUNC(alnattck_state::grid_w)); m_maincpu->read_d().set(FUNC(alnattck_state::input_r)); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); screen.set_refresh_hz(60); screen.set_size(1920, 700); @@ -1895,7 +1914,7 @@ void alnattck_state::alnattck(machine_config &config) PWM_DISPLAY(config, m_display).set_size(10, 20); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); } @@ -1932,27 +1951,26 @@ public: hh_hmcs40_state(mconfig, type, tag) { } + void cdkong(machine_config &config); + +protected: + virtual void machine_start() override; + +private: void update_display(); void plate_w(offs_t offset, u8 data); void grid_w(u16 data); void speaker_update(); TIMER_DEVICE_CALLBACK_MEMBER(speaker_decay_sim); - double m_speaker_volume; - void cdkong(machine_config &config); - -protected: - virtual void machine_start() override; + double m_speaker_volume = 0.0; std::vector m_speaker_levels; }; void cdkong_state::machine_start() { hh_hmcs40_state::machine_start(); - - // zerofill/init - m_speaker_volume = 0; save_item(NAME(m_speaker_volume)); } @@ -2019,7 +2037,7 @@ INPUT_PORTS_END void cdkong_state::cdkong(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware HD38820(config, m_maincpu, 400000); // approximation m_maincpu->write_r<0>().set(FUNC(cdkong_state::plate_w)); m_maincpu->write_r<1>().set(FUNC(cdkong_state::plate_w)); @@ -2031,7 +2049,7 @@ void cdkong_state::cdkong(machine_config &config) m_maincpu->write_d().set(FUNC(cdkong_state::grid_w)); m_maincpu->read_d().set_ioport("IN.1"); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); screen.set_refresh_hz(60); screen.set_size(605, 1080); @@ -2039,7 +2057,7 @@ void cdkong_state::cdkong(machine_config &config) PWM_DISPLAY(config, m_display).set_size(11, 29); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); @@ -2090,13 +2108,15 @@ public: hh_hmcs40_state(mconfig, type, tag) { } + void cgalaxn(machine_config &config); + + DECLARE_INPUT_CHANGED_MEMBER(player_switch); + +private: void update_display(); void grid_w(offs_t offset, u8 data); void plate_w(u16 data); u8 input_r(); - - DECLARE_INPUT_CHANGED_MEMBER(player_switch); - void cgalaxn(machine_config &config); }; // handlers @@ -2169,7 +2189,7 @@ INPUT_PORTS_END void cgalaxn_state::cgalaxn(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware HD38800(config, m_maincpu, 400000); // approximation m_maincpu->read_r<0>().set(FUNC(cgalaxn_state::input_r)); m_maincpu->write_r<1>().set(FUNC(cgalaxn_state::grid_w)); @@ -2177,7 +2197,7 @@ void cgalaxn_state::cgalaxn(machine_config &config) m_maincpu->write_r<3>().set(FUNC(cgalaxn_state::grid_w)); m_maincpu->write_d().set(FUNC(cgalaxn_state::plate_w)); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); screen.set_refresh_hz(60); screen.set_size(526, 1080); @@ -2185,7 +2205,7 @@ void cgalaxn_state::cgalaxn(machine_config &config) PWM_DISPLAY(config, m_display).set_size(12, 15); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); } @@ -2233,10 +2253,12 @@ public: hh_hmcs40_state(mconfig, type, tag) { } + void cpacman(machine_config &config); + +private: void plate_w(offs_t offset, u8 data); void grid_w(u16 data); u8 input_r(); - void cpacman(machine_config &config); }; // handlers @@ -2298,7 +2320,7 @@ INPUT_PORTS_END void cpacman_state::cpacman(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware HD38820(config, m_maincpu, 400000); // approximation m_maincpu->read_r<0>().set(FUNC(cpacman_state::input_r)); m_maincpu->write_r<1>().set(FUNC(cpacman_state::plate_w)); @@ -2309,7 +2331,7 @@ void cpacman_state::cpacman(machine_config &config) m_maincpu->write_r<6>().set(FUNC(cpacman_state::plate_w)); m_maincpu->write_d().set(FUNC(cpacman_state::grid_w)); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); screen.set_refresh_hz(60); screen.set_size(484, 1080); @@ -2317,7 +2339,7 @@ void cpacman_state::cpacman(machine_config &config) PWM_DISPLAY(config, m_display).set_size(11, 27); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); } @@ -2369,10 +2391,12 @@ public: hh_hmcs40_state(mconfig, type, tag) { } + void cmspacmn(machine_config &config); + +private: void plate_w(offs_t offset, u8 data); void grid_w(u16 data); u8 input_r(); - void cmspacmn(machine_config &config); }; // handlers @@ -2434,7 +2458,7 @@ INPUT_PORTS_END void cmspacmn_state::cmspacmn(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware HD38820(config, m_maincpu, 400000); // approximation m_maincpu->read_r<0>().set(FUNC(cmspacmn_state::input_r)); m_maincpu->write_r<1>().set(FUNC(cmspacmn_state::plate_w)); @@ -2445,7 +2469,7 @@ void cmspacmn_state::cmspacmn(machine_config &config) m_maincpu->write_r<6>().set(FUNC(cmspacmn_state::plate_w)); m_maincpu->write_d().set(FUNC(cmspacmn_state::grid_w)); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); screen.set_refresh_hz(60); screen.set_size(481, 1080); @@ -2453,7 +2477,7 @@ void cmspacmn_state::cmspacmn(machine_config &config) PWM_DISPLAY(config, m_display).set_size(12, 33); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); } @@ -2493,11 +2517,13 @@ public: hh_hmcs40_state(mconfig, type, tag) { } + void egalaxn2(machine_config &config); + +private: void update_display(); void plate_w(offs_t offset, u8 data); void grid_w(u16 data); u8 input_r(); - void egalaxn2(machine_config &config); }; // handlers @@ -2570,7 +2596,7 @@ INPUT_PORTS_END void egalaxn2_state::egalaxn2(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware HD38820(config, m_maincpu, 400000); // approximation m_maincpu->read_r<0>().set(FUNC(egalaxn2_state::input_r)); m_maincpu->write_r<1>().set(FUNC(egalaxn2_state::plate_w)); @@ -2581,7 +2607,7 @@ void egalaxn2_state::egalaxn2(machine_config &config) m_maincpu->write_r<6>().set(FUNC(egalaxn2_state::plate_w)); m_maincpu->write_d().set(FUNC(egalaxn2_state::grid_w)); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); screen.set_refresh_hz(60); screen.set_size(505, 1080); @@ -2589,7 +2615,7 @@ void egalaxn2_state::egalaxn2(machine_config &config) PWM_DISPLAY(config, m_display).set_size(15, 24); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); } @@ -2668,7 +2694,7 @@ void epacman2_state::epacman2(machine_config &config) { egalaxn2(config); - /* video hardware */ + // video hardware screen_device *screen = subdevice("screen"); screen->set_size(505, 1080); screen->set_visarea_full(); @@ -2719,11 +2745,13 @@ public: hh_hmcs40_state(mconfig, type, tag) { } + void einvader2(machine_config &config); + +private: void update_display(); void plate_w(offs_t offset, u8 data); void grid_w(u16 data); u16 input_r(); - void einvader2(machine_config &config); }; // handlers @@ -2786,7 +2814,7 @@ INPUT_PORTS_END void einvader2_state::einvader2(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware HD38800(config, m_maincpu, 450000); // approximation m_maincpu->write_r<0>().set(FUNC(einvader2_state::plate_w)); m_maincpu->write_r<1>().set(FUNC(einvader2_state::plate_w)); @@ -2795,7 +2823,7 @@ void einvader2_state::einvader2(machine_config &config) m_maincpu->write_d().set(FUNC(einvader2_state::grid_w)); m_maincpu->read_d().set(FUNC(einvader2_state::input_r)); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); screen.set_refresh_hz(60); screen.set_size(469, 1080); @@ -2803,7 +2831,7 @@ void einvader2_state::einvader2(machine_config &config) PWM_DISPLAY(config, m_display).set_size(12, 14); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); } @@ -2838,35 +2866,34 @@ class eturtles_state : public hh_hmcs40_state public: eturtles_state(const machine_config &mconfig, device_type type, const char *tag) : hh_hmcs40_state(mconfig, type, tag), - m_audiocpu(*this, "audiocpu"), - m_cop_irq(0) + m_audiocpu(*this, "audiocpu") { } + void eturtles(machine_config &config); + + DECLARE_INPUT_CHANGED_MEMBER(input_changed) { update_int(); } + +protected: + virtual void machine_start() override; + required_device m_audiocpu; + void update_int(); virtual void update_display(); void plate_w(offs_t offset, u8 data); void grid_w(u16 data); - u8 m_cop_irq; DECLARE_WRITE_LINE_MEMBER(speaker_w); void cop_irq_w(u8 data); u8 cop_latch_r(); u8 cop_ack_r(); - void update_int(); - DECLARE_INPUT_CHANGED_MEMBER(input_changed) { update_int(); } - void eturtles(machine_config &config); - -protected: - virtual void machine_start() override; + u8 m_cop_irq = 0; }; void eturtles_state::machine_start() { hh_hmcs40_state::machine_start(); - - // register for savestates save_item(NAME(m_cop_irq)); } @@ -2975,7 +3002,7 @@ INPUT_PORTS_END void eturtles_state::eturtles(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware HD38820(config, m_maincpu, 400000); // approximation m_maincpu->write_r<0>().set(FUNC(eturtles_state::plate_w)); m_maincpu->write_r<1>().set(FUNC(eturtles_state::plate_w)); @@ -2995,7 +3022,7 @@ void eturtles_state::eturtles(machine_config &config) config.set_perfect_quantum(m_maincpu); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); screen.set_refresh_hz(60); screen.set_size(484, 1080); @@ -3003,7 +3030,7 @@ void eturtles_state::eturtles(machine_config &config) PWM_DISPLAY(config, m_display).set_size(15, 30); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); } @@ -3043,9 +3070,11 @@ public: eturtles_state(mconfig, type, tag) { } + void estargte(machine_config &config); + +private: virtual void update_display() override; u8 cop_data_r(); - void estargte(machine_config &config); }; // handlers (most of it is in eturtles_state above) @@ -3098,26 +3127,26 @@ INPUT_PORTS_END void estargte_state::estargte(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware HD38820(config, m_maincpu, 400000); // approximation - m_maincpu->write_r<0>().set(FUNC(eturtles_state::plate_w)); - m_maincpu->write_r<1>().set(FUNC(eturtles_state::plate_w)); - m_maincpu->write_r<2>().set(FUNC(eturtles_state::plate_w)); - m_maincpu->write_r<3>().set(FUNC(eturtles_state::plate_w)); - m_maincpu->write_r<4>().set(FUNC(eturtles_state::plate_w)); - m_maincpu->write_r<5>().set(FUNC(eturtles_state::plate_w)); - m_maincpu->write_r<6>().set(FUNC(eturtles_state::plate_w)); - m_maincpu->write_d().set(FUNC(eturtles_state::grid_w)); + m_maincpu->write_r<0>().set(FUNC(estargte_state::plate_w)); + m_maincpu->write_r<1>().set(FUNC(estargte_state::plate_w)); + m_maincpu->write_r<2>().set(FUNC(estargte_state::plate_w)); + m_maincpu->write_r<3>().set(FUNC(estargte_state::plate_w)); + m_maincpu->write_r<4>().set(FUNC(estargte_state::plate_w)); + m_maincpu->write_r<5>().set(FUNC(estargte_state::plate_w)); + m_maincpu->write_r<6>().set(FUNC(estargte_state::plate_w)); + m_maincpu->write_d().set(FUNC(estargte_state::grid_w)); COP411(config, m_audiocpu, 190000); // approximation m_audiocpu->set_config(COP400_CKI_DIVISOR_4, COP400_CKO_OSCILLATOR_OUTPUT, false); // guessed - m_audiocpu->write_sk().set(FUNC(eturtles_state::speaker_w)); - m_audiocpu->write_d().set(FUNC(eturtles_state::cop_irq_w)); + m_audiocpu->write_sk().set(FUNC(estargte_state::speaker_w)); + m_audiocpu->write_d().set(FUNC(estargte_state::cop_irq_w)); m_audiocpu->read_l().set(FUNC(estargte_state::cop_data_r)); config.set_perfect_quantum(m_maincpu); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); screen.set_refresh_hz(60); screen.set_size(1920, 854); @@ -3125,7 +3154,7 @@ void estargte_state::estargte(machine_config &config) PWM_DISPLAY(config, m_display).set_size(14, 29); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); } @@ -3167,10 +3196,12 @@ public: hh_hmcs40_state(mconfig, type, tag) { } + void ghalien(machine_config &config); + +private: void plate_w(offs_t offset, u8 data); void grid_w(u16 data); u16 input_r(); - void ghalien(machine_config &config); }; // handlers @@ -3237,7 +3268,7 @@ INPUT_PORTS_END void ghalien_state::ghalien(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware HD38800(config, m_maincpu, 400000); // approximation m_maincpu->write_r<0>().set(FUNC(ghalien_state::plate_w)); m_maincpu->write_r<1>().set(FUNC(ghalien_state::plate_w)); @@ -3246,7 +3277,7 @@ void ghalien_state::ghalien(machine_config &config) m_maincpu->write_d().set(FUNC(ghalien_state::grid_w)); m_maincpu->read_d().set(FUNC(ghalien_state::input_r)); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); screen.set_refresh_hz(60); screen.set_size(1920, 699); @@ -3254,7 +3285,7 @@ void ghalien_state::ghalien(machine_config &config) PWM_DISPLAY(config, m_display).set_size(10, 20); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); } @@ -3294,12 +3325,14 @@ public: hh_hmcs40_state(mconfig, type, tag) { } - void plate_w(offs_t offset, u8 data); - void grid_w(u16 data); + void gckong(machine_config &config); - void update_int1(); DECLARE_INPUT_CHANGED_MEMBER(input_changed) { update_int1(); } - void gckong(machine_config &config); + +private: + void update_int1(); + void plate_w(offs_t offset, u8 data); + void grid_w(u16 data); }; // handlers @@ -3369,7 +3402,7 @@ INPUT_PORTS_END void gckong_state::gckong(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware HD38800(config, m_maincpu, 400000); // approximation m_maincpu->write_r<0>().set(FUNC(gckong_state::plate_w)); m_maincpu->write_r<1>().set(FUNC(gckong_state::plate_w)); @@ -3378,7 +3411,7 @@ void gckong_state::gckong(machine_config &config) m_maincpu->write_d().set(FUNC(gckong_state::grid_w)); m_maincpu->read_d().set_ioport("IN.5"); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); screen.set_refresh_hz(60); screen.set_size(479, 1080); @@ -3387,7 +3420,7 @@ void gckong_state::gckong(machine_config &config) PWM_DISPLAY(config, m_display).set_size(11, 32); config.set_default_layout(layout_gckong); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); } @@ -3432,12 +3465,14 @@ public: hh_hmcs40_state(mconfig, type, tag) { } - void plate_w(offs_t offset, u8 data); - void grid_w(u16 data); + void gscobra(machine_config &config); - void update_int0(); DECLARE_INPUT_CHANGED_MEMBER(input_changed) { update_int0(); } - void gscobra(machine_config &config); + +private: + void update_int0(); + void plate_w(offs_t offset, u8 data); + void grid_w(u16 data); }; // handlers @@ -3502,7 +3537,7 @@ INPUT_PORTS_END void gscobra_state::gscobra(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware HD38820(config, m_maincpu, 400000); // approximation m_maincpu->write_r<0>().set(FUNC(gscobra_state::plate_w)); m_maincpu->write_r<1>().set(FUNC(gscobra_state::plate_w)); @@ -3513,7 +3548,7 @@ void gscobra_state::gscobra(machine_config &config) m_maincpu->write_r<6>().set(FUNC(gscobra_state::plate_w)); m_maincpu->write_d().set(FUNC(gscobra_state::grid_w)); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); screen.set_refresh_hz(60); screen.set_size(1920, 852); @@ -3521,7 +3556,7 @@ void gscobra_state::gscobra(machine_config &config) PWM_DISPLAY(config, m_display).set_size(9, 31); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); } @@ -3557,12 +3592,14 @@ public: hh_hmcs40_state(mconfig, type, tag) { } - void plate_w(offs_t offset, u8 data); - void grid_w(u16 data); + void gdigdug(machine_config &config); - void update_int1(); DECLARE_INPUT_CHANGED_MEMBER(input_changed) { update_int1(); } - void gdigdug(machine_config &config); + +private: + void update_int1(); + void plate_w(offs_t offset, u8 data); + void grid_w(u16 data); }; // handlers @@ -3628,7 +3665,7 @@ INPUT_PORTS_END void gdigdug_state::gdigdug(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware HD38820(config, m_maincpu, 400000); // approximation m_maincpu->write_r<0>().set(FUNC(gdigdug_state::plate_w)); m_maincpu->write_r<1>().set(FUNC(gdigdug_state::plate_w)); @@ -3639,7 +3676,7 @@ void gdigdug_state::gdigdug(machine_config &config) m_maincpu->write_r<6>().set(FUNC(gdigdug_state::plate_w)); m_maincpu->write_d().set(FUNC(gdigdug_state::grid_w)); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); screen.set_refresh_hz(60); screen.set_size(476, 1080); @@ -3647,7 +3684,7 @@ void gdigdug_state::gdigdug(machine_config &config) PWM_DISPLAY(config, m_display).set_size(9, 32); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); } @@ -3687,12 +3724,14 @@ public: hh_hmcs40_state(mconfig, type, tag) { } + void mwcbaseb(machine_config &config); + +private: void update_display(); void plate_w(offs_t offset, u8 data); void grid_w(u16 data); void speaker_w(u8 data); u8 input_r(); - void mwcbaseb(machine_config &config); }; // handlers @@ -3798,7 +3837,7 @@ INPUT_PORTS_END void mwcbaseb_state::mwcbaseb(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware HD38820(config, m_maincpu, 400000); // approximation m_maincpu->write_r<1>().set(FUNC(mwcbaseb_state::plate_w)); m_maincpu->write_r<2>().set(FUNC(mwcbaseb_state::plate_w)); @@ -3808,7 +3847,7 @@ void mwcbaseb_state::mwcbaseb(machine_config &config) m_maincpu->write_r<6>().set(FUNC(mwcbaseb_state::plate_w)); m_maincpu->write_d().set(FUNC(mwcbaseb_state::grid_w)); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); screen.set_refresh_hz(60); screen.set_size(1920, 478); @@ -3818,7 +3857,7 @@ void mwcbaseb_state::mwcbaseb(machine_config &config) m_display->set_bri_levels(0.001); // cyan elements strobed very briefly? config.set_default_layout(layout_mwcbaseb); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); static const double speaker_levels[] = { 0.0, 0.5, -0.5, 0.0, -0.5, 0.0, -1.0, -0.5 }; @@ -3861,13 +3900,15 @@ public: hh_hmcs40_state(mconfig, type, tag) { } + void msthawk(machine_config &config); + + DECLARE_INPUT_CHANGED_MEMBER(input_changed) { update_int0(); } + +private: + void update_int0(); void update_display(); void plate_w(offs_t offset, u8 data); void grid_w(u16 data); - - void update_int0(); - DECLARE_INPUT_CHANGED_MEMBER(input_changed) { update_int0(); } - void msthawk(machine_config &config); }; // handlers @@ -3941,7 +3982,7 @@ INPUT_PORTS_END void msthawk_state::msthawk(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware HD38800(config, m_maincpu, 400000); // approximation m_maincpu->write_r<0>().set(FUNC(msthawk_state::plate_w)); m_maincpu->write_r<1>().set(FUNC(msthawk_state::plate_w)); @@ -3949,7 +3990,7 @@ void msthawk_state::msthawk(machine_config &config) m_maincpu->write_r<3>().set(FUNC(msthawk_state::plate_w)); m_maincpu->write_d().set(FUNC(msthawk_state::grid_w)); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); screen.set_refresh_hz(60); screen.set_size(1920, 696); @@ -3958,7 +3999,7 @@ void msthawk_state::msthawk(machine_config &config) PWM_DISPLAY(config, m_display).set_size(10, 21); config.set_default_layout(layout_msthawk); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); } @@ -3994,9 +4035,11 @@ public: hh_hmcs40_state(mconfig, type, tag) { } + void pbqbert(machine_config &config); + +private: void plate_w(offs_t offset, u8 data); void grid_w(u16 data); - void pbqbert(machine_config &config); }; // handlers @@ -4037,7 +4080,7 @@ INPUT_PORTS_END void pbqbert_state::pbqbert(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware HD38820(config, m_maincpu, 400000); // approximation m_maincpu->write_r<0>().set(FUNC(pbqbert_state::plate_w)); m_maincpu->write_r<1>().set(FUNC(pbqbert_state::plate_w)); @@ -4049,7 +4092,7 @@ void pbqbert_state::pbqbert(machine_config &config) m_maincpu->write_d().set(FUNC(pbqbert_state::grid_w)); m_maincpu->read_d().set_ioport("IN.0"); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); screen.set_refresh_hz(60); screen.set_size(603, 1080); @@ -4057,7 +4100,7 @@ void pbqbert_state::pbqbert(machine_config &config) PWM_DISPLAY(config, m_display).set_size(8, 30); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); } @@ -4093,13 +4136,15 @@ public: hh_hmcs40_state(mconfig, type, tag) { } + void tmtron(machine_config &config); + + DECLARE_INPUT_CHANGED_MEMBER(input_changed) { update_int1(); } + +private: + void update_int1(); void update_display(); void plate_w(offs_t offset, u8 data); void grid_w(u16 data); - - void update_int1(); - DECLARE_INPUT_CHANGED_MEMBER(input_changed) { update_int1(); } - void tmtron(machine_config &config); }; // handlers @@ -4167,7 +4212,7 @@ INPUT_PORTS_END void tmtron_state::tmtron(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware HD38800(config, m_maincpu, 400000); // approximation m_maincpu->write_r<0>().set(FUNC(tmtron_state::plate_w)); m_maincpu->write_r<1>().set(FUNC(tmtron_state::plate_w)); @@ -4175,7 +4220,7 @@ void tmtron_state::tmtron(machine_config &config) m_maincpu->write_r<3>().set(FUNC(tmtron_state::plate_w)); m_maincpu->write_d().set(FUNC(tmtron_state::grid_w)); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); screen.set_refresh_hz(60); screen.set_size(1920, 662); @@ -4183,7 +4228,7 @@ void tmtron_state::tmtron(machine_config &config) PWM_DISPLAY(config, m_display).set_size(10, 23); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); } @@ -4223,13 +4268,15 @@ public: hh_hmcs40_state(mconfig, type, tag) { } + void kingman(machine_config &config); + + DECLARE_INPUT_CHANGED_MEMBER(input_changed) { update_int0(); } + +private: + void update_int0(); void update_display(); void plate_w(offs_t offset, u8 data); void grid_w(u16 data); - - void update_int0(); - DECLARE_INPUT_CHANGED_MEMBER(input_changed) { update_int0(); } - void kingman(machine_config &config); }; // handlers @@ -4297,7 +4344,7 @@ INPUT_PORTS_END void kingman_state::kingman(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware HD38800(config, m_maincpu, 400000); // approximation m_maincpu->write_r<0>().set(FUNC(kingman_state::plate_w)); m_maincpu->write_r<1>().set(FUNC(kingman_state::plate_w)); @@ -4305,7 +4352,7 @@ void kingman_state::kingman(machine_config &config) m_maincpu->write_r<3>().set(FUNC(kingman_state::plate_w)); m_maincpu->write_d().set(FUNC(kingman_state::grid_w)); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); screen.set_refresh_hz(60); screen.set_size(374, 1080); @@ -4313,7 +4360,7 @@ void kingman_state::kingman(machine_config &config) PWM_DISPLAY(config, m_display).set_size(9, 23); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); } @@ -4353,9 +4400,11 @@ public: hh_hmcs40_state(mconfig, type, tag) { } + void vinvader(machine_config &config); + +private: void plate_w(offs_t offset, u8 data); void grid_w(u16 data); - void vinvader(machine_config &config); }; // handlers @@ -4401,7 +4450,7 @@ INPUT_PORTS_END void vinvader_state::vinvader(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware HD38750(config, m_maincpu, 300000); // approximation m_maincpu->read_r<0>().set_ioport("IN.0"); m_maincpu->write_r<1>().set(FUNC(vinvader_state::plate_w)); @@ -4410,7 +4459,7 @@ void vinvader_state::vinvader(machine_config &config) m_maincpu->write_d().set(FUNC(vinvader_state::grid_w)); m_maincpu->read_d().set_ioport("IN.1"); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); screen.set_refresh_hz(60); screen.set_size(233, 1080); @@ -4418,7 +4467,7 @@ void vinvader_state::vinvader(machine_config &config) PWM_DISPLAY(config, m_display).set_size(9, 12); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); } diff --git a/src/mame/drivers/hh_melps4.cpp b/src/mame/drivers/hh_melps4.cpp index 185f917e7a0..060ddba845b 100644 --- a/src/mame/drivers/hh_melps4.cpp +++ b/src/mame/drivers/hh_melps4.cpp @@ -35,6 +35,12 @@ public: m_inputs(*this, "IN.%u", 0) { } + virtual DECLARE_INPUT_CHANGED_MEMBER(reset_button); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + // devices required_device m_maincpu; optional_device m_display; @@ -42,17 +48,12 @@ public: optional_ioport_array<4> m_inputs; // max 4 // misc common - u16 m_inp_mux; // multiplexed inputs mask + u16 m_inp_mux = 0; // multiplexed inputs mask - u32 m_grid; // VFD current row data - u32 m_plate; // VFD current column data + u32 m_grid = 0; // VFD current row data + u32 m_plate = 0; // VFD current column data u8 read_inputs(int columns); - virtual DECLARE_INPUT_CHANGED_MEMBER(reset_button); - -protected: - virtual void machine_start() override; - virtual void machine_reset() override; }; @@ -60,11 +61,6 @@ protected: void hh_melps4_state::machine_start() { - // zerofill - m_inp_mux = 0; - m_grid = 0; - m_plate = 0; - // register for savestates save_item(NAME(m_inp_mux)); save_item(NAME(m_grid)); @@ -134,12 +130,14 @@ public: hh_melps4_state(mconfig, type, tag) { } + void cfrogger(machine_config &config); + +private: void update_display(); void plate_w(offs_t offset, u8 data); void grid_w(u16 data); DECLARE_WRITE_LINE_MEMBER(speaker_w); u16 input_r(); - void cfrogger(machine_config &config); }; // handlers @@ -207,7 +205,7 @@ INPUT_PORTS_END void cfrogger_state::cfrogger(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware M58846(config, m_maincpu, 600_kHz_XTAL); m_maincpu->read_k().set(FUNC(cfrogger_state::input_r)); m_maincpu->write_s().set(FUNC(cfrogger_state::plate_w)); @@ -216,7 +214,7 @@ void cfrogger_state::cfrogger(machine_config &config) m_maincpu->write_d().set(FUNC(cfrogger_state::grid_w)); m_maincpu->write_t().set(FUNC(cfrogger_state::speaker_w)); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); screen.set_refresh_hz(60); screen.set_size(500, 1080); @@ -224,7 +222,7 @@ void cfrogger_state::cfrogger(machine_config &config) PWM_DISPLAY(config, m_display).set_size(12, 16); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); } @@ -259,12 +257,14 @@ public: hh_melps4_state(mconfig, type, tag) { } + void gjungler(machine_config &config); + +private: void update_display(); void plate_w(offs_t offset, u8 data); void grid_w(u16 data); DECLARE_WRITE_LINE_MEMBER(speaker_w); u16 input_r(); - void gjungler(machine_config &config); }; // handlers @@ -332,7 +332,7 @@ INPUT_PORTS_END void gjungler_state::gjungler(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware M58846(config, m_maincpu, 600_kHz_XTAL); m_maincpu->read_k().set(FUNC(gjungler_state::input_r)); m_maincpu->write_s().set(FUNC(gjungler_state::plate_w)); @@ -342,7 +342,7 @@ void gjungler_state::gjungler(machine_config &config) m_maincpu->write_d().set(FUNC(gjungler_state::grid_w)); m_maincpu->write_t().set(FUNC(gjungler_state::speaker_w)); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); screen.set_refresh_hz(60); screen.set_size(481, 1080); @@ -350,7 +350,7 @@ void gjungler_state::gjungler(machine_config &config) PWM_DISPLAY(config, m_display).set_size(12, 18); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); } diff --git a/src/mame/drivers/hh_pic16.cpp b/src/mame/drivers/hh_pic16.cpp index 3dbab20c30f..6517ce61ab0 100644 --- a/src/mame/drivers/hh_pic16.cpp +++ b/src/mame/drivers/hh_pic16.cpp @@ -92,6 +92,12 @@ public: m_inputs(*this, "IN.%u", 0) { } + virtual DECLARE_INPUT_CHANGED_MEMBER(reset_button); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + // devices required_device m_maincpu; optional_device m_display; @@ -99,19 +105,14 @@ public: optional_ioport_array<6> m_inputs; // max 6 // misc common - u8 m_a; // MCU port A write data - u8 m_b; // " B - u8 m_c; // " C - u8 m_d; // " D - u16 m_inp_mux; // multiplexed inputs mask + u8 m_a = 0; // MCU port A write data + u8 m_b = 0; // " B + u8 m_c = 0; // " C + u8 m_d = 0; // " D + u16 m_inp_mux = ~0; // multiplexed inputs mask u16 read_inputs(int columns, u16 colmask = ~0); u8 read_rotated_inputs(int columns, u8 rowmask = ~0); - virtual DECLARE_INPUT_CHANGED_MEMBER(reset_button); - -protected: - virtual void machine_start() override; - virtual void machine_reset() override; }; @@ -119,13 +120,6 @@ protected: void hh_pic16_state::machine_start() { - // zerofill - m_a = 0; - m_b = 0; - m_c = 0; - m_d = 0; - m_inp_mux = ~0; - // register for savestates save_item(NAME(m_a)); save_item(NAME(m_b)); @@ -212,12 +206,14 @@ public: hh_pic16_state(mconfig, type, tag) { } + void touchme(machine_config &config); + +private: void update_display(); void update_speaker(); u8 read_a(); void write_b(u8 data); void write_c(u8 data); - void touchme(machine_config &config); }; // handlers @@ -287,7 +283,7 @@ INPUT_PORTS_END void touchme_state::touchme(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware PIC1655(config, m_maincpu, 300000); // approximation - RC osc. R=100K, C=47pF m_maincpu->read_a().set(FUNC(touchme_state::read_a)); m_maincpu->write_b().set(FUNC(touchme_state::write_b)); @@ -297,12 +293,12 @@ void touchme_state::touchme(machine_config &config) // PIC CLKOUT, tied to RTCC CLOCK(config, "clock", 300000/4).signal_handler().set_inputline("maincpu", PIC16C5x_RTCC); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(7, 7); m_display->set_segmask(3, 0x7f); config.set_default_layout(layout_touchme); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); static const double speaker_levels[] = { 0.0, 1.0, -1.0, 0.0 }; @@ -336,10 +332,12 @@ public: hh_pic16_state(mconfig, type, tag) { } + void pabball(machine_config &config); + +private: void update_display(); void write_b(u8 data); void write_c(u8 data); - void pabball(machine_config &config); }; // handlers @@ -397,19 +395,19 @@ INPUT_PORTS_END void pabball_state::pabball(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware PIC1655(config, m_maincpu, 1200000); // approximation - RC osc. R=18K, C=27pF m_maincpu->read_a().set_ioport("IN.0"); m_maincpu->write_b().set(FUNC(pabball_state::write_b)); m_maincpu->read_c().set_ioport("IN.1"); m_maincpu->write_c().set(FUNC(pabball_state::write_c)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(10, 8); m_display->set_segmask(0x200, 0xff); config.set_default_layout(layout_hh_pic16_test); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); } @@ -443,10 +441,12 @@ public: hh_pic16_state(mconfig, type, tag) { } + void melodym(machine_config &config); + +private: void write_b(u8 data); u8 read_c(); void write_c(u8 data); - void melodym(machine_config &config); }; // handlers @@ -519,19 +519,19 @@ INPUT_PORTS_END void melodym_state::melodym(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware PIC1655(config, m_maincpu, 1000000); // approximation m_maincpu->read_a().set_ioport("IN.5"); m_maincpu->write_b().set(FUNC(melodym_state::write_b)); m_maincpu->read_c().set(FUNC(melodym_state::read_c)); m_maincpu->write_c().set(FUNC(melodym_state::write_c)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(1, 1); m_display->set_bri_levels(0.9); config.set_default_layout(layout_melodym); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); } @@ -569,11 +569,13 @@ public: hh_pic16_state(mconfig, type, tag) { } + void maniac(machine_config &config); + +private: void update_display(); void update_speaker(); void write_b(u8 data); void write_c(u8 data); - void maniac(machine_config &config); }; // handlers @@ -621,18 +623,18 @@ INPUT_PORTS_END void maniac_state::maniac(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware PIC1655(config, m_maincpu, 1000000); // approximation - RC osc. R=~13.4K, C=470pF m_maincpu->read_a().set_ioport("IN.0"); m_maincpu->write_b().set(FUNC(maniac_state::write_b)); m_maincpu->write_c().set(FUNC(maniac_state::write_c)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(2, 7); m_display->set_segmask(3, 0x7f); config.set_default_layout(layout_maniac); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); static const double speaker_levels[] = { 0.0, 1.0, -1.0, 0.0 }; @@ -682,6 +684,12 @@ public: hh_pic16_state(mconfig, type, tag) { } + void flash(machine_config &config); + +protected: + virtual void machine_start() override; + +private: void update_display(); void write_b(u8 data); u8 read_c(); @@ -689,19 +697,12 @@ public: void speaker_decay_reset(); TIMER_DEVICE_CALLBACK_MEMBER(speaker_decay_sim); - double m_speaker_volume; - void flash(machine_config &config); - -protected: - virtual void machine_start() override; + double m_speaker_volume = 0.0; }; void flash_state::machine_start() { hh_pic16_state::machine_start(); - - // zerofill/init - m_speaker_volume = 0; save_item(NAME(m_speaker_volume)); } @@ -776,19 +777,19 @@ INPUT_PORTS_END void flash_state::flash(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware PIC1655(config, m_maincpu, 1050000); // approximation m_maincpu->read_a().set_ioport("IN.0"); m_maincpu->write_b().set(FUNC(flash_state::write_b)); m_maincpu->read_c().set(FUNC(flash_state::read_c)); m_maincpu->write_c().set(FUNC(flash_state::write_c)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(2, 7+4); m_display->set_segmask(3, 0x7f); config.set_default_layout(layout_flash); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); TIMER(config, "speaker_decay").configure_periodic(FUNC(flash_state::speaker_decay_sim), attotime::from_msec(25)); @@ -832,16 +833,18 @@ public: hh_pic16_state(mconfig, type, tag) { } - void write_b(u8 data); - void write_c(u8 data); - u8 read_c(); + void matchme(machine_config &config); - void set_clock(); DECLARE_INPUT_CHANGED_MEMBER(speed_switch) { set_clock(); } - void matchme(machine_config &config); protected: virtual void machine_reset() override; + +private: + void set_clock(); + void write_b(u8 data); + void write_c(u8 data); + u8 read_c(); }; void matchme_state::machine_reset() @@ -933,18 +936,18 @@ INPUT_PORTS_END void matchme_state::matchme(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware PIC1655(config, m_maincpu, 1200000); // see set_clock m_maincpu->read_a().set_ioport("IN.3"); m_maincpu->write_b().set(FUNC(matchme_state::write_b)); m_maincpu->read_c().set(FUNC(matchme_state::read_c)); m_maincpu->write_c().set(FUNC(matchme_state::write_c)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(1, 8); config.set_default_layout(layout_matchme); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); } @@ -983,11 +986,13 @@ public: hh_pic16_state(mconfig, type, tag) { } + void drdunk(machine_config &config); + +private: void update_display(); u8 read_a(); void write_b(u8 data); void write_c(u8 data); - void drdunk(machine_config &config); }; // handlers @@ -1053,20 +1058,20 @@ INPUT_PORTS_END void drdunk_state::drdunk(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware PIC1655(config, m_maincpu, 800000); // approximation - RC osc. R=18K, C=47pF m_maincpu->read_a().set(FUNC(drdunk_state::read_a)); m_maincpu->write_b().set(FUNC(drdunk_state::write_b)); m_maincpu->read_c().set_constant(0xff); m_maincpu->write_c().set(FUNC(drdunk_state::write_c)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(6, 7); m_display->set_segmask(0x30, 0x7f); m_display->set_bri_levels(0.01, 0.2); // player led is brighter config.set_default_layout(layout_drdunk); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); } @@ -1112,25 +1117,24 @@ public: hh_pic16_state(mconfig, type, tag) { } + void leboom(machine_config &config); + +protected: + virtual void machine_start() override; + +private: u8 read_a(); void write_b(u8 data); void write_c(u8 data); void speaker_decay_reset(); TIMER_DEVICE_CALLBACK_MEMBER(speaker_decay_sim); - double m_speaker_volume; - void leboom(machine_config &config); - -protected: - virtual void machine_start() override; + double m_speaker_volume = 0.0; }; void leboom_state::machine_start() { hh_pic16_state::machine_start(); - - // zerofill/init - m_speaker_volume = 0; save_item(NAME(m_speaker_volume)); } @@ -1218,18 +1222,18 @@ INPUT_PORTS_END void leboom_state::leboom(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware PIC1655(config, m_maincpu, 1000000); // approximation m_maincpu->read_a().set(FUNC(leboom_state::read_a)); m_maincpu->write_b().set(FUNC(leboom_state::write_b)); m_maincpu->read_c().set_constant(0xff); m_maincpu->write_c().set(FUNC(leboom_state::write_c)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(1, 1); config.set_default_layout(layout_leboom); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); TIMER(config, "speaker_decay").configure_periodic(FUNC(leboom_state::speaker_decay_sim), attotime::from_msec(25)); @@ -1267,12 +1271,14 @@ public: hh_pic16_state(mconfig, type, tag) { } + void rockpin(machine_config &config); + +private: void update_display(); void write_a(u8 data); void write_b(u8 data); void write_c(u8 data); void write_d(u8 data); - void rockpin(machine_config &config); }; // handlers @@ -1329,7 +1335,7 @@ INPUT_PORTS_END void rockpin_state::rockpin(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware PIC1650(config, m_maincpu, 450000); // approximation - RC osc. R=47K, C=47pF m_maincpu->read_a().set_ioport("IN.0"); m_maincpu->write_a().set(FUNC(rockpin_state::write_a)); @@ -1343,12 +1349,12 @@ void rockpin_state::rockpin(machine_config &config) // PIC CLKOUT, tied to RTCC CLOCK(config, "clock", 450000/4).signal_handler().set_inputline(m_maincpu, PIC16C5x_RTCC); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(3+6, 8); m_display->set_segmask(7, 0x7f); config.set_default_layout(layout_rockpin); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); static const double speaker_levels[] = { 0.0, 1.0, -1.0, 0.0 }; @@ -1386,11 +1392,13 @@ public: hh_pic16_state(mconfig, type, tag) { } + void hccbaskb(machine_config &config); + +private: void update_display(); u8 read_a(); void write_b(u8 data); void write_c(u8 data); - void hccbaskb(machine_config &config); }; // handlers @@ -1456,20 +1464,20 @@ INPUT_PORTS_END void hccbaskb_state::hccbaskb(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware PIC1655(config, m_maincpu, 800000); // approximation - RC osc. R=15K, C=47pF m_maincpu->read_a().set(FUNC(hccbaskb_state::read_a)); m_maincpu->write_b().set(FUNC(hccbaskb_state::write_b)); m_maincpu->read_c().set_constant(0xff); m_maincpu->write_c().set(FUNC(hccbaskb_state::write_c)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(7, 7); m_display->set_segmask(0x60, 0x7f); m_display->set_bri_levels(0.01, 0.2); // player led is brighter config.set_default_layout(layout_hccbaskb); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); } @@ -1510,11 +1518,13 @@ public: hh_pic16_state(mconfig, type, tag) { } + void ttfball(machine_config &config); + +private: void update_display(); u8 read_a(); void write_b(u8 data); void write_c(u8 data); - void ttfball(machine_config &config); }; // handlers @@ -1618,20 +1628,20 @@ INPUT_PORTS_END void ttfball_state::ttfball(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware PIC1655(config, m_maincpu, 500000); // approximation - RC osc. R=27K(set 1) or 33K(set 2), C=68pF m_maincpu->read_a().set(FUNC(ttfball_state::read_a)); m_maincpu->write_b().set(FUNC(ttfball_state::write_b)); m_maincpu->read_c().set_constant(0xff); m_maincpu->write_c().set(FUNC(ttfball_state::write_c)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(9, 11); m_display->set_segmask(0x7f, 0xff); m_display->set_bri_levels(0.002, 0.02); // player led is brighter config.set_default_layout(layout_ttfball); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); } @@ -1671,12 +1681,14 @@ public: hh_pic16_state(mconfig, type, tag) { } + void uspbball(machine_config &config); + +private: void update_display(); void write_a(u8 data); void write_b(u8 data); void write_c(u8 data); void write_d(u8 data); - void uspbball(machine_config &config); }; // handlers @@ -1735,7 +1747,7 @@ INPUT_PORTS_END void uspbball_state::uspbball(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware PIC1650(config, m_maincpu, 900000); // approximation - RC osc. R=22K, C=47pF m_maincpu->read_a().set_ioport("IN.0"); m_maincpu->write_a().set(FUNC(uspbball_state::write_a)); @@ -1749,12 +1761,12 @@ void uspbball_state::uspbball(machine_config &config) // PIC CLKOUT, tied to RTCC CLOCK(config, "clock", 900000/4).signal_handler().set_inputline("maincpu", PIC16C5x_RTCC); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(6, 16); m_display->set_segmask(7, 0x7f); config.set_default_layout(layout_hh_pic16_test); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); } @@ -1789,13 +1801,15 @@ public: hh_pic16_state(mconfig, type, tag) { } + void us2pfball(machine_config &config); + +private: void update_display(); u8 read_a(); void write_a(u8 data); void write_b(u8 data); void write_c(u8 data); void write_d(u8 data); - void us2pfball(machine_config &config); }; // handlers @@ -1877,7 +1891,7 @@ INPUT_PORTS_END void us2pfball_state::us2pfball(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware PIC1650(config, m_maincpu, 800000); // approximation - RC osc. R=39K, C=75pF m_maincpu->read_a().set(FUNC(us2pfball_state::read_a)); m_maincpu->write_a().set(FUNC(us2pfball_state::write_a)); @@ -1891,12 +1905,12 @@ void us2pfball_state::us2pfball(machine_config &config) // PIC CLKOUT, tied to RTCC CLOCK(config, "clock", 800000/4).signal_handler().set_inputline("maincpu", PIC16C5x_RTCC); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(10, 7); m_display->set_segmask(0xff, 0x7f); config.set_default_layout(layout_us2pfball); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); } diff --git a/src/mame/drivers/hh_pps41.cpp b/src/mame/drivers/hh_pps41.cpp index a6147c5ea85..c17c79e9973 100644 --- a/src/mame/drivers/hh_pps41.cpp +++ b/src/mame/drivers/hh_pps41.cpp @@ -50,6 +50,13 @@ public: m_inputs(*this, "IN.%u", 0) { } + virtual DECLARE_INPUT_CHANGED_MEMBER(reset_button); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override { update_int(); } + virtual void device_post_load() override { update_int(); } + // devices required_device m_maincpu; optional_device m_display; @@ -65,14 +72,7 @@ public: u16 m_r = 0; u8 read_inputs(int columns); - virtual DECLARE_INPUT_CHANGED_MEMBER(reset_button); - -protected: virtual void update_int() { ; } - - virtual void machine_start() override; - virtual void machine_reset() override { update_int(); } - virtual void device_post_load() override { update_int(); } }; @@ -149,10 +149,12 @@ public: hh_pps41_state(mconfig, type, tag) { } + void ftri1(machine_config &config); + +private: void update_display(); void write_d(u16 data); void write_r(u16 data); - void ftri1(machine_config &config); }; // handlers @@ -200,18 +202,18 @@ INPUT_PORTS_END void ftri1_state::ftri1(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware MM78(config, m_maincpu, 300000); // approximation - VC osc. R=68K m_maincpu->write_d().set(FUNC(ftri1_state::write_d)); m_maincpu->write_r().set(FUNC(ftri1_state::write_r)); m_maincpu->read_p().set_ioport("IN.0"); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(9, 8); m_display->set_segmask(0x1e0, 0x7f); config.set_default_layout(layout_ftri1); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); @@ -252,15 +254,16 @@ public: m_beeper(*this, "beeper") { } + void mastmind(machine_config &config); + void smastmind(machine_config &config); + +private: optional_device m_beeper; void update_display(); void write_d(u16 data); void write_r(u16 data); u8 read_p(); - - void mastmind(machine_config &config); - void smastmind(machine_config &config); }; // handlers @@ -325,18 +328,18 @@ INPUT_PORTS_END void mastmind_state::mastmind(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware MM75(config, m_maincpu, 360000); // approximation - VC osc. R=56K m_maincpu->write_d().set(FUNC(mastmind_state::write_d)); m_maincpu->write_r().set(FUNC(mastmind_state::write_r)); m_maincpu->read_p().set(FUNC(mastmind_state::read_p)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(8, 7); m_display->set_segmask(0xff, 0x7f); config.set_default_layout(layout_mastmind); - /* no sound! */ + // no sound! } void mastmind_state::smastmind(machine_config &config) @@ -345,7 +348,7 @@ void mastmind_state::smastmind(machine_config &config) config.set_default_layout(layout_smastmind); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); BEEP(config, m_beeper, 2400); // approximation m_beeper->add_route(ALL_OUTPUTS, "mono", 0.25); @@ -398,14 +401,16 @@ public: hh_pps41_state(mconfig, type, tag) { } + void dunksunk(machine_config &config); + DECLARE_INPUT_CHANGED_MEMBER(difficulty_switch) { update_int(); } DECLARE_INPUT_CHANGED_MEMBER(game_switch) { update_int(); } - virtual void update_int() override; +private: + virtual void update_int() override; void update_display(); void write_d(u16 data); void write_r(u16 data); - void dunksunk(machine_config &config); }; // handlers @@ -467,19 +472,19 @@ INPUT_PORTS_END void dunksunk_state::dunksunk(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware MM76EL(config, m_maincpu, 390000); // approximation - VC osc. R=56K m_maincpu->write_d().set(FUNC(dunksunk_state::write_d)); m_maincpu->write_r().set(FUNC(dunksunk_state::write_r)); m_maincpu->read_p().set_ioport("IN.0"); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(9, 7); m_display->set_segmask(0x1e0, 0x7f); m_display->set_bri_levels(0.015, 0.2); // player led is brighter config.set_default_layout(layout_dunksunk); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); @@ -524,14 +529,16 @@ public: hh_pps41_state(mconfig, type, tag) { } + void memoquiz(machine_config &config); + DECLARE_INPUT_CHANGED_MEMBER(digits_switch) { update_int(); } - virtual void update_int() override; +private: + virtual void update_int() override; void update_display(); void write_d(u16 data); void write_r(u16 data); u8 read_p(); - void memoquiz(machine_config &config); }; // handlers @@ -608,18 +615,18 @@ INPUT_PORTS_END void memoquiz_state::memoquiz(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware MM75(config, m_maincpu, 360000); // approximation - VC osc. R=56K m_maincpu->write_d().set(FUNC(memoquiz_state::write_d)); m_maincpu->write_r().set(FUNC(memoquiz_state::write_r)); m_maincpu->read_p().set(FUNC(memoquiz_state::read_p)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(8, 8); m_display->set_segmask(0xff, 0xff); config.set_default_layout(layout_memoquiz); - /* no sound! */ + // no sound! } // roms @@ -655,11 +662,13 @@ public: hh_pps41_state(mconfig, type, tag) { } + void mfootb2(machine_config &config); + +private: void update_display(); void write_d(u16 data); void write_r(u16 data); void write_spk(u8 data); - void mfootb2(machine_config &config); }; // handlers @@ -712,7 +721,7 @@ INPUT_PORTS_END void mfootb2_state::mfootb2(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware MM77LA(config, m_maincpu, 380000); // approximation - VC osc. R=56K m_maincpu->write_d().set(FUNC(mfootb2_state::write_d)); m_maincpu->read_d().set_ioport("IN.1"); @@ -720,14 +729,14 @@ void mfootb2_state::mfootb2(machine_config &config) m_maincpu->read_p().set_ioport("IN.0"); m_maincpu->write_spk().set(FUNC(mfootb2_state::write_spk)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(10, 11); m_display->set_segmask(0x3c7, 0x7f); m_display->set_segmask(0x002, 0xff); m_display->set_bri_levels(0.015, 0.2); // ball led is brighter config.set_default_layout(layout_mfootb2); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); static const double speaker_levels[4] = { 0.0, 1.0, -1.0, 0.0 }; @@ -767,12 +776,14 @@ public: hh_pps41_state(mconfig, type, tag) { } + void brainbaf(machine_config &config); + +private: void update_display(); void write_d(u16 data); void write_r(u16 data); u8 read_p(); void write_spk(u8 data); - void brainbaf(machine_config &config); }; // handlers @@ -875,19 +886,19 @@ INPUT_PORTS_END void brainbaf_state::brainbaf(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware MM78LA(config, m_maincpu, 440000); // approximation - VC osc. R=10K m_maincpu->write_d().set(FUNC(brainbaf_state::write_d)); m_maincpu->write_r().set(FUNC(brainbaf_state::write_r)); m_maincpu->read_p().set(FUNC(brainbaf_state::read_p)); m_maincpu->write_spk().set(FUNC(brainbaf_state::write_spk)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(8, 14); m_display->set_segmask(0xff, 0x3fff); config.set_default_layout(layout_brainbaf); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); static const double speaker_levels[4] = { 0.0, 1.0, -1.0, 0.0 }; @@ -928,12 +939,14 @@ public: hh_pps41_state(mconfig, type, tag) { } + void horocomp(machine_config &config); + +private: void update_display(); void write_d(u16 data); void write_r(u16 data); u8 read_p(); void write_spk(u8 data); - void horocomp(machine_config &config); }; // handlers @@ -1051,19 +1064,19 @@ INPUT_PORTS_END void horocomp_state::horocomp(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware MM78LA(config, m_maincpu, 440000); // approximation - VC osc. R=10K m_maincpu->write_d().set(FUNC(horocomp_state::write_d)); m_maincpu->write_r().set(FUNC(horocomp_state::write_r)); m_maincpu->read_p().set(FUNC(horocomp_state::read_p)); m_maincpu->write_spk().set(FUNC(horocomp_state::write_spk)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(8, 14); m_display->set_segmask(0xff, 0x3fff); config.set_default_layout(layout_horocomp); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); static const double speaker_levels[4] = { 0.0, 1.0, -1.0, 0.0 }; @@ -1105,6 +1118,9 @@ public: m_subcpu(*this, "subcpu") { } + void mwcfootb(machine_config &config); + +private: required_device m_subcpu; void update_display(); @@ -1116,8 +1132,6 @@ public: void sub_write_d(u16 data); void sub_write_r(u16 data); - - void mwcfootb(machine_config &config); }; // handlers @@ -1234,7 +1248,7 @@ INPUT_PORTS_END void mwcfootb_state::mwcfootb(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware MM78(config, m_maincpu, 360000); // approximation - VC osc. R=56K m_maincpu->write_d().set(FUNC(mwcfootb_state::main_write_d)); m_maincpu->read_d().set(FUNC(mwcfootb_state::main_read_d)); @@ -1250,7 +1264,7 @@ void mwcfootb_state::mwcfootb(machine_config &config) config.set_perfect_quantum(m_maincpu); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); screen.set_refresh_hz(60); screen.set_size(1920, 571); @@ -1260,7 +1274,7 @@ void mwcfootb_state::mwcfootb(machine_config &config) m_display->set_segmask(0x7f, 0x7f); config.set_default_layout(layout_mwcfootb); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); @@ -1301,14 +1315,16 @@ public: hh_pps41_state(mconfig, type, tag) { } + void scrabsen(machine_config &config); + DECLARE_INPUT_CHANGED_MEMBER(players_switch) { update_int(); } - virtual void update_int() override; +private: + virtual void update_int() override; void update_display(); void write_d(u16 data); void write_r(u16 data); u8 read_p(); - void scrabsen(machine_config &config); }; // handlers @@ -1404,17 +1420,17 @@ INPUT_PORTS_END void scrabsen_state::scrabsen(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware MM76EL(config, m_maincpu, 380000); // approximation - VC osc. R=56K m_maincpu->write_d().set(FUNC(scrabsen_state::write_d)); m_maincpu->write_r().set(FUNC(scrabsen_state::write_r)); m_maincpu->read_p().set(FUNC(scrabsen_state::read_p)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(2, 8); config.set_default_layout(layout_scrabsen); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); @@ -1452,14 +1468,16 @@ public: hh_pps41_state(mconfig, type, tag) { } + void rdqa(machine_config &config); + DECLARE_INPUT_CHANGED_MEMBER(players_switch) { update_int(); } - virtual void update_int() override; +private: + virtual void update_int() override; void update_display(); void write_d(u16 data); void write_r(u16 data); u8 read_p(); - void rdqa(machine_config &config); }; // handlers @@ -1538,18 +1556,18 @@ INPUT_PORTS_END void rdqa_state::rdqa(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware MM76EL(config, m_maincpu, 400000); // approximation - VC osc. R=56K m_maincpu->write_d().set(FUNC(rdqa_state::write_d)); m_maincpu->write_r().set(FUNC(rdqa_state::write_r)); m_maincpu->read_p().set(FUNC(rdqa_state::read_p)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(5, 7); m_display->set_segmask(0x1f, 0x7f); config.set_default_layout(layout_rdqa); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); static const double speaker_levels[4] = { 0.0, 1.0, -1.0, 0.0 }; diff --git a/src/mame/drivers/hh_sm510.cpp b/src/mame/drivers/hh_sm510.cpp index b374ce1e4e7..2167178044c 100644 --- a/src/mame/drivers/hh_sm510.cpp +++ b/src/mame/drivers/hh_sm510.cpp @@ -5678,14 +5678,15 @@ public: inp_fixed_last(); } - // R2 connects to a single LED behind the screen - void led_w(u8 data) { m_led_out = data >> 1 & 1; } - output_finder<> m_led_out; - void tgaiden(machine_config &config); protected: virtual void machine_start() override; + +private: + // R2 connects to a single LED behind the screen + void led_w(u8 data) { m_led_out = data >> 1 & 1; } + output_finder<> m_led_out; }; void tgaiden_state::machine_start() @@ -5736,7 +5737,6 @@ INPUT_PORTS_END void tgaiden_state::tgaiden(machine_config &config) { sm510_tiger(config, 1476, 1080); - m_maincpu->write_r().append(FUNC(tgaiden_state::led_w)); } @@ -8164,8 +8164,10 @@ public: inp_fixed_last(); } - virtual void input_w(u8 data) override; void tnmarebc(machine_config &config); + +private: + virtual void input_w(u8 data) override; }; // handlers diff --git a/src/mame/drivers/hh_tms1k.cpp b/src/mame/drivers/hh_tms1k.cpp index 75fccdb1f6b..a9246a2a36d 100644 --- a/src/mame/drivers/hh_tms1k.cpp +++ b/src/mame/drivers/hh_tms1k.cpp @@ -432,11 +432,13 @@ public: hh_tms1k_state(mconfig, type, tag) { } + void matchnum(machine_config &config); + +private: void update_display(); void write_r(u16 data); void write_o(u16 data); u8 read_k(); - void matchnum(machine_config &config); }; // handlers @@ -516,18 +518,18 @@ INPUT_PORTS_END void matchnum_state::matchnum(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1000(config, m_maincpu, 325000); // approximation - RC osc. R=47K, C=47pF m_maincpu->k().set(FUNC(matchnum_state::read_k)); m_maincpu->r().set(FUNC(matchnum_state::write_r)); m_maincpu->o().set(FUNC(matchnum_state::write_o)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(4, 8); m_display->set_segmask(0xf, 0x7f); config.set_default_layout(layout_matchnum); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); static const double speaker_levels[4] = { 0.0, 1.0, -1.0, 0.0 }; @@ -573,11 +575,13 @@ public: hh_tms1k_state(mconfig, type, tag) { } + void arrball(machine_config &config); + +private: void update_display(); void write_r(u16 data); void write_o(u16 data); u8 read_k(); - void arrball(machine_config &config); }; // handlers @@ -627,19 +631,19 @@ INPUT_PORTS_END void arrball_state::arrball(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1000(config, m_maincpu, 325000); // approximation - RC osc. R=47K, C=47pF m_maincpu->k().set(FUNC(arrball_state::read_k)); m_maincpu->r().set(FUNC(arrball_state::write_r)); m_maincpu->o().set(FUNC(arrball_state::write_o)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(7, 7); m_display->set_segmask(0x10, 0x7f); m_display->set_segmask(0x20, 0x06); // left digit only segments B and C config.set_default_layout(layout_arrball); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); static const double speaker_levels[4] = { 0.0, 1.0, -1.0, 0.0 }; @@ -693,11 +697,13 @@ public: hh_tms1k_state(mconfig, type, tag) { } + void mathmagi(machine_config &config); + +private: void update_display(); void write_r(u16 data); void write_o(u16 data); u8 read_k(); - void mathmagi(machine_config &config); }; // handlers @@ -794,19 +800,19 @@ static const u16 mathmagi_output_pla[0x20] = void mathmagi_state::mathmagi(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1100(config, m_maincpu, 175000); // approximation - RC osc. R=68K, C=82pF m_maincpu->set_output_pla(mathmagi_output_pla); m_maincpu->k().set(FUNC(mathmagi_state::read_k)); m_maincpu->r().set(FUNC(mathmagi_state::write_r)); m_maincpu->o().set(FUNC(mathmagi_state::write_o)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(11, 7); m_display->set_segmask(0xff, 0x7f); config.set_default_layout(layout_mathmagi); - /* no sound! */ + // no sound! } // roms @@ -934,16 +940,15 @@ INPUT_PORTS_END void bcheetah_state::bcheetah(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1000(config, m_maincpu, 100000); // approximation - RC osc. R=47K, C=47pF m_maincpu->k().set(FUNC(bcheetah_state::read_k)); m_maincpu->r().set(FUNC(bcheetah_state::write_r)); m_maincpu->o().set(FUNC(bcheetah_state::write_o)); - /* no visual feedback! */ config.set_default_layout(layout_bcheetah); - /* no sound! */ + // no sound! } // roms @@ -1100,18 +1105,18 @@ INPUT_PORTS_END void palmf31_state::palmf31(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1040(config, m_maincpu, 250000); // approximation m_maincpu->k().set(FUNC(palmf31_state::read_k)); m_maincpu->o().set(FUNC(palmf31_state::write_o)); m_maincpu->r().set(FUNC(palmf31_state::write_r)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(9, 8); m_display->set_segmask(0x1ff, 0xff); config.set_default_layout(layout_palmf31); - /* no sound! */ + // no sound! } // roms @@ -1268,18 +1273,18 @@ INPUT_PORTS_END void palmmd8_state::palmmd8(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1070(config, m_maincpu, 250000); // approximation - RC osc. R=56K, C=68pf m_maincpu->k().set(FUNC(palmmd8_state::read_k)); m_maincpu->o().set(FUNC(palmmd8_state::write_o)); m_maincpu->r().set(FUNC(palmmd8_state::write_r)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(21, 8); m_display->set_segmask(0xfffff, 0xff); config.set_default_layout(layout_palmmd8); - /* no sound! */ + // no sound! } // roms @@ -1317,11 +1322,13 @@ public: hh_tms1k_state(mconfig, type, tag) { } + void amaztron(machine_config &config); + +private: void update_display(); void write_r(u16 data); void write_o(u16 data); u8 read_k(); - void amaztron(machine_config &config); }; // handlers @@ -1409,18 +1416,18 @@ INPUT_PORTS_END void amaztron_state::amaztron(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1100(config, m_maincpu, 300000); // approximation - RC osc. R=33K?, C=100pF m_maincpu->k().set(FUNC(amaztron_state::read_k)); m_maincpu->r().set(FUNC(amaztron_state::write_r)); m_maincpu->o().set(FUNC(amaztron_state::write_o)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(4, 7); m_display->set_segmask(0xc, 0x7f); config.set_default_layout(layout_amaztron); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); @@ -1460,11 +1467,13 @@ public: hh_tms1k_state(mconfig, type, tag) { } + void zodiac(machine_config &config); + +private: void update_display(); void write_r(u16 data); void write_o(u16 data); u8 read_k(); - void zodiac(machine_config &config); }; // handlers @@ -1562,18 +1571,18 @@ INPUT_PORTS_END void zodiac_state::zodiac(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1100(config, m_maincpu, 500000); // approximation - RC osc. R=18K, C=100pF m_maincpu->k().set(FUNC(zodiac_state::read_k)); m_maincpu->r().set(FUNC(zodiac_state::write_r)); m_maincpu->o().set(FUNC(zodiac_state::write_o)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(10, 8); m_display->set_segmask(0xff, 0x7f); config.set_default_layout(layout_zodiac); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); @@ -1617,11 +1626,13 @@ public: hh_tms1k_state(mconfig, type, tag) { } + void cqback(machine_config &config); + +private: void update_display(); void write_r(u16 data); void write_o(u16 data); u8 read_k(); - void cqback(machine_config &config); }; // handlers @@ -1693,19 +1704,19 @@ INPUT_PORTS_END void cqback_state::cqback(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1100(config, m_maincpu, 310000); // approximation - RC osc. R=33K, C=100pF m_maincpu->k().set(FUNC(cqback_state::read_k)); m_maincpu->r().set(FUNC(cqback_state::write_r)); m_maincpu->o().set(FUNC(cqback_state::write_o)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(9, 11); m_display->set_segmask(0x1ff, 0xff); m_display->set_bri_levels(0.003, 0.03); // offense leds are brighter config.set_default_layout(layout_cqback); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); @@ -1749,11 +1760,13 @@ public: hh_tms1k_state(mconfig, type, tag) { } + void h2hfootb(machine_config &config); + +private: void update_display(); void write_r(u16 data); void write_o(u16 data); u8 read_k(); - void h2hfootb(machine_config &config); }; // handlers @@ -1825,19 +1838,19 @@ INPUT_PORTS_END void h2hfootb_state::h2hfootb(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1100(config, m_maincpu, 310000); // approximation - RC osc. R=39K, C=100pF m_maincpu->k().set(FUNC(h2hfootb_state::read_k)); m_maincpu->r().set(FUNC(h2hfootb_state::write_r)); m_maincpu->o().set(FUNC(h2hfootb_state::write_o)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(9, 9); m_display->set_segmask(0x1ff, 0x7f); m_display->set_bri_levels(0.003, 0.03); // offense leds are brighter config.set_default_layout(layout_h2hfootb); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); @@ -1882,30 +1895,29 @@ public: m_cap_empty_timer(*this, "cap_empty") { } + void h2hbaskb(machine_config &config); + void h2hhockey(machine_config &config); + +protected: + virtual void machine_start() override; + +private: required_device m_cap_empty_timer; TIMER_DEVICE_CALLBACK_MEMBER(cap_empty_callback); - bool m_cap_state; - attotime m_cap_charge; + bool m_cap_state = false; + attotime m_cap_charge = attotime::zero; void update_display(); void write_r(u16 data); void write_o(u16 data); u8 read_k(); - void h2hbaskb(machine_config &config); - void h2hhockey(machine_config &config); - -protected: - virtual void machine_start() override; }; void h2hbaskb_state::machine_start() { hh_tms1k_state::machine_start(); - // zerofill/register for savestates - m_cap_state = false; - m_cap_charge = attotime::zero; - + // register for savestates save_item(NAME(m_cap_state)); save_item(NAME(m_cap_charge)); } @@ -2012,7 +2024,7 @@ INPUT_PORTS_END void h2hbaskb_state::h2hbaskb(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1000(config, m_maincpu, 375000); // approximation - RC osc. R=43K, C=100pF m_maincpu->k().set(FUNC(h2hbaskb_state::read_k)); m_maincpu->r().set(FUNC(h2hbaskb_state::write_r)); @@ -2020,12 +2032,12 @@ void h2hbaskb_state::h2hbaskb(machine_config &config) TIMER(config, "cap_empty").configure_generic(FUNC(h2hbaskb_state::cap_empty_callback)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(6+6, 7); m_display->set_segmask(0xc0, 0x7f); config.set_default_layout(layout_h2hbaskb); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); @@ -2083,17 +2095,19 @@ public: hh_tms1k_state(mconfig, type, tag) { } - void update_display(); - void write_r(u16 data); - void write_o(u16 data); - u8 read_k(); + void h2hbaseb(machine_config &config); - void set_clock(); DECLARE_INPUT_CHANGED_MEMBER(skill_switch) { set_clock(); } - void h2hbaseb(machine_config &config); protected: virtual void machine_reset() override; + +private: + void set_clock(); + void update_display(); + void write_r(u16 data); + void write_o(u16 data); + u8 read_k(); }; void h2hbaseb_state::machine_reset() @@ -2177,18 +2191,18 @@ INPUT_PORTS_END void h2hbaseb_state::h2hbaseb(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1170(config, m_maincpu, 350000); // see set_clock m_maincpu->k().set(FUNC(h2hbaseb_state::read_k)); m_maincpu->r().set(FUNC(h2hbaseb_state::write_r)); m_maincpu->o().set(FUNC(h2hbaseb_state::write_o)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(9, 9); m_display->set_segmask(0x1ff, 0x7f); config.set_default_layout(layout_h2hbaseb); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); @@ -2227,11 +2241,13 @@ public: hh_tms1k_state(mconfig, type, tag) { } + void h2hboxing(machine_config &config); + +private: void update_display(); void write_r(u16 data); void write_o(u16 data); u8 read_k(); - void h2hboxing(machine_config &config); }; // handlers @@ -2302,18 +2318,18 @@ INPUT_PORTS_END void h2hboxing_state::h2hboxing(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1100(config, m_maincpu, 350000); // approximation - RC osc. R=39K, C=100pF m_maincpu->k().set(FUNC(h2hboxing_state::read_k)); m_maincpu->r().set(FUNC(h2hboxing_state::write_r)); m_maincpu->o().set(FUNC(h2hboxing_state::write_o)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(11, 8); m_display->set_segmask(0x600, 0x7f); config.set_default_layout(layout_h2hboxing); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); @@ -2368,6 +2384,12 @@ public: m_pinout(0) { } + void quizwizc(machine_config &config); + +protected: + virtual void machine_start() override; + +private: DECLARE_DEVICE_IMAGE_LOAD_MEMBER(cart_load); u16 m_pinout; // cartridge R pins @@ -2375,10 +2397,6 @@ public: void write_r(u16 data); void write_o(u16 data); u8 read_k(); - void quizwizc(machine_config &config); - -protected: - virtual void machine_start() override; }; void quizwizc_state::machine_start() @@ -2484,23 +2502,23 @@ INPUT_PORTS_END void quizwizc_state::quizwizc(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1000(config, m_maincpu, 300000); // approximation - RC osc. R=43K, C=100pF m_maincpu->k().set(FUNC(quizwizc_state::read_k)); m_maincpu->r().set(FUNC(quizwizc_state::write_r)); m_maincpu->o().set(FUNC(quizwizc_state::write_o)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(10+1, 8); m_display->set_segmask(0x3c0, 0x7f); config.set_default_layout(layout_quizwizc); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); - /* cartridge */ + // cartridge generic_cartslot_device &cartslot(GENERIC_CARTSLOT(config, "cartslot", generic_plain_slot, "quizwiz_cart")); cartslot.set_must_be_loaded(true); cartslot.set_device_load(FUNC(quizwizc_state::cart_load)); @@ -2556,6 +2574,12 @@ public: m_pinout(0) { } + void tc4(machine_config &config); + +protected: + virtual void machine_start() override; + +private: DECLARE_DEVICE_IMAGE_LOAD_MEMBER(cart_load); u8 m_pinout; // cartridge K pins @@ -2563,10 +2587,6 @@ public: void write_r(u16 data); void write_o(u16 data); u8 read_k(); - void tc4(machine_config &config); - -protected: - virtual void machine_start() override; }; void tc4_state::machine_start() @@ -2671,24 +2691,24 @@ INPUT_PORTS_END void tc4_state::tc4(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1400(config, m_maincpu, 450000); // approximation - RC osc. R=27.3K, C=100pF m_maincpu->k().set(FUNC(tc4_state::read_k)); m_maincpu->r().set(FUNC(tc4_state::write_r)); m_maincpu->o().set(FUNC(tc4_state::write_o)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(10, 9); m_display->set_segmask(0x3a0, 0x7f); m_display->set_bri_levels(0.005, 0.05); // offense leds are brighter config.set_default_layout(layout_tc4); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); - /* cartridge */ + // cartridge generic_cartslot_device &cartslot(GENERIC_CARTSLOT(config, "cartslot", generic_plain_slot, "tc4_cart")); cartslot.set_must_be_loaded(true); // system won't power on without cartridge cartslot.set_device_load(FUNC(tc4_state::cart_load)); @@ -2735,11 +2755,13 @@ public: hh_tms1k_state(mconfig, type, tag) { } + void cnbaskb(machine_config &config); + +private: void update_display(); void write_r(u16 data); void write_o(u16 data); u8 read_k(); - void cnbaskb(machine_config &config); }; // handlers @@ -2801,19 +2823,19 @@ INPUT_PORTS_END void cnbaskb_state::cnbaskb(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1000(config, m_maincpu, 375000); // approximation - RC osc. R=39K, C=47pF m_maincpu->k().set(FUNC(cnbaskb_state::read_k)); m_maincpu->r().set(FUNC(cnbaskb_state::write_r)); m_maincpu->o().set(FUNC(cnbaskb_state::write_o)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(9, 7); m_display->set_segmask(0x180, 0x7f); m_display->set_bri_levels(0.01, 0.1); // player led is brighter config.set_default_layout(layout_cnbaskb); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); @@ -2860,11 +2882,13 @@ public: hh_tms1k_state(mconfig, type, tag) { } + void cmsport(machine_config &config); + +private: void update_display(); void write_r(u16 data); void write_o(u16 data); u8 read_k(); - void cmsport(machine_config &config); }; // handlers @@ -2928,19 +2952,19 @@ INPUT_PORTS_END void cmsport_state::cmsport(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1000(config, m_maincpu, 350000); // approximation - RC osc. R=47K, C=47pF m_maincpu->k().set(FUNC(cmsport_state::read_k)); m_maincpu->r().set(FUNC(cmsport_state::write_r)); m_maincpu->o().set(FUNC(cmsport_state::write_o)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(9, 8); m_display->set_segmask(0x60, 0x7f); m_display->set_bri_levels(0.01, 0.1); // player led is brighter config.set_default_layout(layout_cmsport); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); @@ -2990,6 +3014,9 @@ public: m_ds8874(*this, "ds8874") { } + void cnfball(machine_config &config); + +private: required_device m_ds8874; void ds8874_output_w(u16 data); @@ -2997,7 +3024,6 @@ public: void write_r(u16 data); void write_o(u16 data); u8 read_k(); - void cnfball(machine_config &config); }; // handlers @@ -3069,13 +3095,13 @@ INPUT_PORTS_END void cnfball_state::cnfball(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1000(config, m_maincpu, 350000); // approximation - RC osc. R=39K, C=47pF m_maincpu->k().set(FUNC(cnfball_state::read_k)); m_maincpu->r().set(FUNC(cnfball_state::write_r)); m_maincpu->o().set(FUNC(cnfball_state::write_o)); - /* video hardware */ + // video hardware DS8874(config, m_ds8874).write_output().set(FUNC(cnfball_state::ds8874_output_w)); PWM_DISPLAY(config, m_display).set_size(9, 8+3); m_display->set_segmask(0xc3, 0x7f); @@ -3083,7 +3109,7 @@ void cnfball_state::cnfball(machine_config &config) m_display->set_bri_levels(0.01, 0.1); // player led is brighter config.set_default_layout(layout_cnfball); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); static const double speaker_levels[4] = { 0.0, 1.0, -1.0, 0.0 }; @@ -3130,11 +3156,13 @@ public: hh_tms1k_state(mconfig, type, tag) { } + void cnfball2(machine_config &config); + +private: void update_display(); void write_r(u16 data); void write_o(u16 data); u8 read_k(); - void cnfball2(machine_config &config); }; // handlers @@ -3203,18 +3231,18 @@ INPUT_PORTS_END void cnfball2_state::cnfball2(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1100(config, m_maincpu, 325000); // approximation - RC osc. R=47K, C=47pF m_maincpu->k().set(FUNC(cnfball2_state::read_k)); m_maincpu->r().set(FUNC(cnfball2_state::write_r)); m_maincpu->o().set(FUNC(cnfball2_state::write_o)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(9, 11); m_display->set_segmask(0x1ff, 0xff); config.set_default_layout(layout_cnfball2); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); @@ -3262,11 +3290,13 @@ public: hh_tms1k_state(mconfig, type, tag) { } + void eleciq(machine_config &config); + +private: void update_display(); void write_r(u16 data); void write_o(u16 data); u8 read_k(); - void eleciq(machine_config &config); }; // handlers @@ -3352,18 +3382,18 @@ INPUT_PORTS_END void eleciq_state::eleciq(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1000(config, m_maincpu, 325000); // approximation - RC osc. R=47K, C=50pF m_maincpu->k().set(FUNC(eleciq_state::read_k)); m_maincpu->r().set(FUNC(eleciq_state::write_r)); m_maincpu->o().set(FUNC(eleciq_state::write_o)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(9, 7); m_display->set_segmask(0x180, 0x7f); config.set_default_layout(layout_eleciq); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); @@ -3404,10 +3434,12 @@ public: hh_tms1k_state(mconfig, type, tag) { } + void qfire(machine_config &config); + +private: void write_r(u16 data); void write_o(u16 data); u8 read_k(); - void qfire(machine_config &config); }; // handlers @@ -3466,18 +3498,18 @@ INPUT_PORTS_END void qfire_state::qfire(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1000(config, m_maincpu, 375000); // approximation - RC osc. R=39K, C=47pF m_maincpu->k().set(FUNC(qfire_state::read_k)); m_maincpu->r().set(FUNC(qfire_state::write_r)); m_maincpu->o().set(FUNC(qfire_state::write_o)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(3, 7); m_display->set_segmask(3, 0x7f); config.set_default_layout(layout_qfire); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); @@ -3518,11 +3550,13 @@ public: hh_tms1k_state(mconfig, type, tag) { } + void esoccer(machine_config &config); + +private: void update_display(); void write_r(u16 data); void write_o(u16 data); u8 read_k(); - void esoccer(machine_config &config); }; // handlers @@ -3584,19 +3618,19 @@ INPUT_PORTS_END void esoccer_state::esoccer(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1000(config, m_maincpu, 350000); // approximation - RC osc. R=47K, C=33pF m_maincpu->k().set(FUNC(esoccer_state::read_k)); m_maincpu->r().set(FUNC(esoccer_state::write_r)); m_maincpu->o().set(FUNC(esoccer_state::write_o)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(10, 7); m_display->set_segmask(0x300, 0x7f); m_display->set_bri_levels(0.01, 0.1); // player led is brighter config.set_default_layout(layout_esoccer); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); @@ -3656,11 +3690,13 @@ public: hh_tms1k_state(mconfig, type, tag) { } + void ebball(machine_config &config); + +private: void update_display(); void write_r(u16 data); void write_o(u16 data); u8 read_k(); - void ebball(machine_config &config); }; // handlers @@ -3732,18 +3768,18 @@ INPUT_PORTS_END void ebball_state::ebball(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1000(config, m_maincpu, 375000); // approximation - RC osc. R=43K, C=47pF m_maincpu->k().set(FUNC(ebball_state::read_k)); m_maincpu->r().set(FUNC(ebball_state::write_r)); m_maincpu->o().set(FUNC(ebball_state::write_o)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(9, 7); m_display->set_segmask(0x100, 0x7f); config.set_default_layout(layout_ebball); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); @@ -3799,11 +3835,13 @@ public: hh_tms1k_state(mconfig, type, tag) { } + void ebball2(machine_config &config); + +private: void update_display(); void write_r(u16 data); void write_o(u16 data); u8 read_k(); - void ebball2(machine_config &config); }; // handlers @@ -3868,18 +3906,18 @@ INPUT_PORTS_END void ebball2_state::ebball2(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1000(config, m_maincpu, 350000); // approximation - RC osc. R=47K, C=47pF m_maincpu->k().set(FUNC(ebball2_state::read_k)); m_maincpu->r().set(FUNC(ebball2_state::write_r)); m_maincpu->o().set(FUNC(ebball2_state::write_o)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(10, 8); m_display->set_segmask(7, 0x7f); config.set_default_layout(layout_ebball2); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); @@ -3940,17 +3978,19 @@ public: hh_tms1k_state(mconfig, type, tag) { } - void update_display(); - void write_r(u16 data); - void write_o(u16 data); - u8 read_k(); + void ebball3(machine_config &config); - void set_clock(); DECLARE_INPUT_CHANGED_MEMBER(skill_switch) { set_clock(); } - void ebball3(machine_config &config); protected: virtual void machine_reset() override; + +private: + void set_clock(); + void update_display(); + void write_r(u16 data); + void write_o(u16 data); + u8 read_k(); }; void ebball3_state::machine_reset() @@ -4050,19 +4090,19 @@ INPUT_PORTS_END void ebball3_state::ebball3(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1100(config, m_maincpu, 340000); // see set_clock m_maincpu->k().set(FUNC(ebball3_state::read_k)); m_maincpu->r().set(FUNC(ebball3_state::write_r)); m_maincpu->o().set(FUNC(ebball3_state::write_o)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(10+2, 7); m_display->set_segmask(3, 0x7f); m_display->set_segmask(0xc00, 0x22); config.set_default_layout(layout_ebball3); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); @@ -4114,11 +4154,13 @@ public: hh_tms1k_state(mconfig, type, tag) { } + void esbattle(machine_config &config); + +private: void update_display(); void write_r(u16 data); void write_o(u16 data); u8 read_k(); - void esbattle(machine_config &config); }; // handlers @@ -4175,18 +4217,18 @@ INPUT_PORTS_END void esbattle_state::esbattle(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1000(config, m_maincpu, 425000); // approximation - RC osc. R=47K, C=33pF m_maincpu->k().set(FUNC(esbattle_state::read_k)); m_maincpu->r().set(FUNC(esbattle_state::write_r)); m_maincpu->o().set(FUNC(esbattle_state::write_o)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(10, 8); m_display->set_segmask(0x300, 0x7f); config.set_default_layout(layout_esbattle); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); @@ -4223,11 +4265,13 @@ public: hh_tms1k_state(mconfig, type, tag) { } + void blastit(machine_config &config); + +private: void update_display(); void write_r(u16 data); void write_o(u16 data); u8 read_k(); - void blastit(machine_config &config); }; // handlers @@ -4278,19 +4322,19 @@ INPUT_PORTS_END void blastit_state::blastit(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1000(config, m_maincpu, 425000); // approximation - RC osc. R=47K, C=33pF m_maincpu->k().set(FUNC(blastit_state::read_k)); m_maincpu->r().set(FUNC(blastit_state::write_r)); m_maincpu->o().set(FUNC(blastit_state::write_o)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(10, 7); m_display->set_segmask(0x380, 0x7f); m_display->set_bri_levels(0.01, 0.115); // ball/paddle is slightly brighter config.set_default_layout(layout_blastit); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); @@ -4331,16 +4375,17 @@ public: hh_tms1k_state(mconfig, type, tag) { } - void update_display(); - void write_r(u16 data); - void write_o(u16 data); - - void set_clock(); DECLARE_INPUT_CHANGED_MEMBER(skill_switch) { set_clock(); } void einvader(machine_config &config); protected: virtual void machine_reset() override; + +private: + void set_clock(); + void update_display(); + void write_r(u16 data); + void write_o(u16 data); }; void einvader_state::machine_reset() @@ -4396,13 +4441,13 @@ INPUT_PORTS_END void einvader_state::einvader(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1100(config, m_maincpu, 320000); // see set_clock m_maincpu->k().set_ioport("IN.0"); m_maincpu->r().set(FUNC(einvader_state::write_r)); m_maincpu->o().set(FUNC(einvader_state::write_o)); - /* video hardware */ + // video hardware screen_device &mask(SCREEN(config, "mask", SCREEN_TYPE_SVG)); mask.set_refresh_hz(60); mask.set_size(945, 1080); @@ -4413,7 +4458,7 @@ void einvader_state::einvader(machine_config &config) m_display->set_bri_levels(0.01, 0.1); // ufo/player explosion is brighter config.set_default_layout(layout_einvader); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); @@ -4455,11 +4500,13 @@ public: hh_tms1k_state(mconfig, type, tag) { } + void efootb4(machine_config &config); + +private: void update_display(); void write_r(u16 data); void write_o(u16 data); u8 read_k(); - void efootb4(machine_config &config); }; // handlers @@ -4535,13 +4582,13 @@ INPUT_PORTS_END void efootb4_state::efootb4(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1670(config, m_maincpu, 400000); // approximation - RC osc. R=42K, C=47pF m_maincpu->k().set(FUNC(efootb4_state::read_k)); m_maincpu->r().set(FUNC(efootb4_state::write_r)); m_maincpu->o().set(FUNC(efootb4_state::write_o)); - /* video hardware */ + // video hardware screen_device &mask(SCREEN(config, "mask", SCREEN_TYPE_SVG)); mask.set_refresh_hz(60); mask.set_size(1920, 904); @@ -4551,7 +4598,7 @@ void efootb4_state::efootb4(machine_config &config) m_display->set_segmask(0xfc00, 0x7f); config.set_default_layout(layout_efootb4); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); @@ -4603,11 +4650,13 @@ public: hh_tms1k_state(mconfig, type, tag) { } + void ebaskb2(machine_config &config); + +private: void update_display(); void write_r(u16 data); void write_o(u16 data); u8 read_k(); - void ebaskb2(machine_config &config); }; // handlers @@ -4677,19 +4726,19 @@ INPUT_PORTS_END void ebaskb2_state::ebaskb2(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1100(config, m_maincpu, 360000); // approximation - RC osc. R=33K, C=82pF m_maincpu->k().set(FUNC(ebaskb2_state::read_k)); m_maincpu->r().set(FUNC(ebaskb2_state::write_r)); m_maincpu->o().set(FUNC(ebaskb2_state::write_o)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(10, 7); m_display->set_segmask(0xf, 0x7f); m_display->set_bri_levels(0.01, 0.1); // ball carrier led is brighter config.set_default_layout(layout_ebaskb2); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); @@ -4746,18 +4795,20 @@ public: hh_tms1k_state(mconfig, type, tag) { } - void update_display(); - void write_r(u16 data); - void write_o(u16 data); - u8 read_k(); - - void set_clock(); - DECLARE_INPUT_CHANGED_MEMBER(skill_switch) { set_clock(); } void raisedvl(machine_config &config); void ebknight(machine_config &config); + DECLARE_INPUT_CHANGED_MEMBER(skill_switch) { set_clock(); } + protected: virtual void machine_reset() override; + +private: + void set_clock(); + void update_display(); + void write_r(u16 data); + void write_o(u16 data); + u8 read_k(); }; void raisedvl_state::machine_reset() @@ -4831,18 +4882,18 @@ INPUT_PORTS_END void raisedvl_state::raisedvl(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1100(config, m_maincpu, 350000); // see set_clock m_maincpu->k().set(FUNC(raisedvl_state::read_k)); m_maincpu->r().set(FUNC(raisedvl_state::write_r)); m_maincpu->o().set(FUNC(raisedvl_state::write_o)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(10, 7); m_display->set_segmask(7, 0x7f); config.set_default_layout(layout_raisedvl); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); @@ -4913,11 +4964,13 @@ public: hh_tms1k_state(mconfig, type, tag) { } + void f2pbball(machine_config &config); + +private: void update_display(); void write_r(u16 data); void write_o(u16 data); u8 read_k(); - void f2pbball(machine_config &config); }; // handlers @@ -4983,18 +5036,18 @@ INPUT_PORTS_END void f2pbball_state::f2pbball(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1000(config, m_maincpu, 325000); // approximation - RC osc. R=51K, C=39pF m_maincpu->k().set(FUNC(f2pbball_state::read_k)); m_maincpu->r().set(FUNC(f2pbball_state::write_r)); m_maincpu->o().set(FUNC(f2pbball_state::write_o)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(9, 8); m_display->set_segmask(0x1e0, 0x7f); config.set_default_layout(layout_f2pbball); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); @@ -5035,17 +5088,19 @@ public: hh_tms1k_state(mconfig, type, tag) { } - void update_display(); - void write_r(u16 data); - void write_o(u16 data); - u8 read_k(); + void f3in1(machine_config &config); - void set_clock(); DECLARE_INPUT_CHANGED_MEMBER(skill_switch) { set_clock(); } - void f3in1(machine_config &config); protected: virtual void machine_reset() override; + +private: + void set_clock(); + void update_display(); + void write_r(u16 data); + void write_o(u16 data); + u8 read_k(); }; void f3in1_state::machine_reset() @@ -5128,19 +5183,19 @@ INPUT_PORTS_END void f3in1_state::f3in1(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1100(config, m_maincpu, 300000); // see set_clock m_maincpu->k().set(FUNC(f3in1_state::read_k)); m_maincpu->r().set(FUNC(f3in1_state::write_r)); m_maincpu->o().set(FUNC(f3in1_state::write_o)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(10, 8); m_display->set_segmask(0x3c0, 0x7f); m_display->set_bri_levels(0.003, 0.05); // player led is brighter config.set_default_layout(layout_f3in1); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); @@ -5183,16 +5238,17 @@ public: m_beeper(*this, "beeper") { } + void gpoker(machine_config &config); + +protected: + virtual void machine_reset() override; + required_device m_beeper; void update_display(); virtual void write_r(u16 data); virtual void write_o(u16 data); virtual u8 read_k(); - void gpoker(machine_config &config); - -protected: - virtual void machine_reset() override; }; void gpoker_state::machine_reset() @@ -5291,18 +5347,18 @@ INPUT_PORTS_END void gpoker_state::gpoker(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1370(config, m_maincpu, 375000); // approximation - RC osc. R=47K, C=47pF m_maincpu->k().set(FUNC(gpoker_state::read_k)); m_maincpu->r().set(FUNC(gpoker_state::write_r)); m_maincpu->o().set(FUNC(gpoker_state::write_o)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(11, 14); m_display->set_segmask(0x7ff, 0x20ff); // 7seg + bottom-right diagonal config.set_default_layout(layout_gpoker); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); BEEP(config, m_beeper, 2400); // astable multivibrator - C1 and C2 are 0.003uF, R1 and R4 are 1K, R2 and R3 are 100K m_beeper->add_route(ALL_OUTPUTS, "mono", 0.25); @@ -5344,8 +5400,10 @@ public: gpoker_state(mconfig, type, tag) { } - virtual void write_r(u16 data) override; void gjackpot(machine_config &config); + +private: + virtual void write_r(u16 data) override; }; // handlers @@ -5420,11 +5478,11 @@ void gjackpot_state::gjackpot(machine_config &config) { gpoker(config); - /* basic machine hardware */ + // basic machine hardware TMS1670(config.replace(), m_maincpu, 375000); // approximation - RC osc. R=47K, C=47pF - m_maincpu->k().set(FUNC(gpoker_state::read_k)); + m_maincpu->k().set(FUNC(gjackpot_state::read_k)); m_maincpu->r().set(FUNC(gjackpot_state::write_r)); - m_maincpu->o().set(FUNC(gpoker_state::write_o)); + m_maincpu->o().set(FUNC(gjackpot_state::write_o)); config.set_default_layout(layout_gjackpot); } @@ -5470,11 +5528,13 @@ public: hh_tms1k_state(mconfig, type, tag) { } + void ginv(machine_config &config); + +private: void update_display(); virtual void write_r(u16 data); virtual void write_o(u16 data); virtual u8 read_k(); - void ginv(machine_config &config); }; // handlers @@ -5534,13 +5594,13 @@ INPUT_PORTS_END void ginv_state::ginv(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1370(config, m_maincpu, 350000); // approximation - RC osc. R=47K, C=47pF m_maincpu->k().set(FUNC(ginv_state::read_k)); m_maincpu->r().set(FUNC(ginv_state::write_r)); m_maincpu->o().set(FUNC(ginv_state::write_o)); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); screen.set_refresh_hz(60); screen.set_size(236, 1080); @@ -5548,7 +5608,7 @@ void ginv_state::ginv(machine_config &config) PWM_DISPLAY(config, m_display).set_size(9, 12); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); @@ -5594,11 +5654,13 @@ public: hh_tms1k_state(mconfig, type, tag) { } + void ginv1000(machine_config &config); + +private: void update_display(); virtual void write_r(u16 data); virtual void write_o(u16 data); virtual u8 read_k(); - void ginv1000(machine_config &config); }; // handlers @@ -5659,13 +5721,13 @@ INPUT_PORTS_END void ginv1000_state::ginv1000(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1370(config, m_maincpu, 350000); // approximation m_maincpu->k().set(FUNC(ginv1000_state::read_k)); m_maincpu->r().set(FUNC(ginv1000_state::write_r)); m_maincpu->o().set(FUNC(ginv1000_state::write_o)); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); screen.set_refresh_hz(60); screen.set_size(226, 1080); @@ -5673,7 +5735,7 @@ void ginv1000_state::ginv1000(machine_config &config) PWM_DISPLAY(config, m_display).set_size(10, 12); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); @@ -5720,6 +5782,9 @@ public: m_expander(*this, "expander") { } + void ginv2000(machine_config &config); + +private: required_device m_expander; void expander_w(offs_t offset, u8 data); @@ -5727,7 +5792,6 @@ public: virtual void write_r(u16 data); virtual void write_o(u16 data); virtual u8 read_k(); - void ginv2000(machine_config &config); }; // handlers @@ -5795,7 +5859,7 @@ INPUT_PORTS_END void ginv2000_state::ginv2000(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1370(config, m_maincpu, 425000); // approximation - RC osc. R=36K, C=47pF m_maincpu->k().set(FUNC(ginv2000_state::read_k)); m_maincpu->r().set(FUNC(ginv2000_state::write_r)); @@ -5807,7 +5871,7 @@ void ginv2000_state::ginv2000(machine_config &config) m_expander->write_port6_callback().set(FUNC(ginv2000_state::expander_w)); m_expander->write_port7_callback().set(FUNC(ginv2000_state::expander_w)); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); screen.set_refresh_hz(60); screen.set_size(364, 1080); @@ -5815,7 +5879,7 @@ void ginv2000_state::ginv2000(machine_config &config) PWM_DISPLAY(config, m_display).set_size(10, 16); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); @@ -5865,11 +5929,13 @@ public: hh_tms1k_state(mconfig, type, tag) { } + void fxmcr165(machine_config &config); + +private: void update_display(); void write_r(u16 data); void write_o(u16 data); u8 read_k(); - void fxmcr165(machine_config &config); }; // handlers @@ -5956,18 +6022,18 @@ INPUT_PORTS_END void fxmcr165_state::fxmcr165(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1100(config, m_maincpu, 400_kHz_XTAL); m_maincpu->k().set(FUNC(fxmcr165_state::read_k)); m_maincpu->r().set(FUNC(fxmcr165_state::write_r)); m_maincpu->o().set(FUNC(fxmcr165_state::write_o)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(1+1, 7); m_display->set_segmask(1, 0x7f); config.set_default_layout(layout_fxmcr165); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); @@ -6011,10 +6077,12 @@ public: hh_tms1k_state(mconfig, type, tag) { } + void elecdet(machine_config &config); + +private: void write_r(u16 data); void write_o(u16 data); u8 read_k(); - void elecdet(machine_config &config); }; // handlers @@ -6095,19 +6163,19 @@ INPUT_PORTS_END void elecdet_state::elecdet(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS0980(config, m_maincpu, 425000); // approximation m_maincpu->k().set(FUNC(elecdet_state::read_k)); m_maincpu->r().set(FUNC(elecdet_state::write_r)); m_maincpu->o().set(FUNC(elecdet_state::write_o)); - m_maincpu->power_off().set(FUNC(hh_tms1k_state::auto_power_off)); + m_maincpu->power_off().set(FUNC(elecdet_state::auto_power_off)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(7, 7); m_display->set_segmask(0x7f, 0x7f); config.set_default_layout(layout_elecdet); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); static const double speaker_levels[4] = { 0.0, 0.5, 0.5, 1.0}; @@ -6154,11 +6222,13 @@ public: hh_tms1k_state(mconfig, type, tag) { } + void starwbc(machine_config &config); + +private: void update_display(); void write_r(u16 data); void write_o(u16 data); u8 read_k(); - void starwbc(machine_config &config); }; // handlers @@ -6241,18 +6311,18 @@ INPUT_PORTS_END void starwbc_state::starwbc(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1100(config, m_maincpu, 350000); // approximation - RC osc. R=51K, C=47pF m_maincpu->k().set(FUNC(starwbc_state::read_k)); m_maincpu->r().set(FUNC(starwbc_state::write_r)); m_maincpu->o().set(FUNC(starwbc_state::write_o)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(10, 8); m_display->set_segmask(0x140, 0x7f); config.set_default_layout(layout_starwbc); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); @@ -6302,11 +6372,13 @@ public: hh_tms1k_state(mconfig, type, tag) { } + void astro(machine_config &config); + +private: void update_display(); void write_r(u16 data); void write_o(u16 data); u8 read_k(); - void astro(machine_config &config); }; // handlers @@ -6391,18 +6463,18 @@ INPUT_PORTS_END void astro_state::astro(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1470(config, m_maincpu, 450000); // approximation - RC osc. R=4.7K, C=33pF m_maincpu->k().set(FUNC(astro_state::read_k)); m_maincpu->r().set(FUNC(astro_state::write_r)); m_maincpu->o().set(FUNC(astro_state::write_o)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(10, 8); m_display->set_segmask(0x3ff, 0xff); config.set_default_layout(layout_astro); - /* no sound! */ + // no sound! } // roms @@ -6454,11 +6526,13 @@ public: hh_tms1k_state(mconfig, type, tag) { } + void elecbowl(machine_config &config); + +private: void update_display(); void write_r(u16 data); void write_o(u16 data); u8 read_k(); - void elecbowl(machine_config &config); }; // handlers @@ -6552,20 +6626,20 @@ static const u16 elecbowl_output_pla[0x20] = void elecbowl_state::elecbowl(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1100(config, m_maincpu, 350000); // approximation - RC osc. R=33K, C=100pF m_maincpu->set_output_pla(elecbowl_output_pla); m_maincpu->k().set(FUNC(elecbowl_state::read_k)); m_maincpu->r().set(FUNC(elecbowl_state::write_r)); m_maincpu->o().set(FUNC(elecbowl_state::write_o)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(7, 8); m_display->set_segmask(0xf, 0x7f); m_display->set_segmask(0x10, 0x06); // 1 config.set_default_layout(layout_elecbowl); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); @@ -6610,12 +6684,14 @@ public: m_lcd(*this, "lcd") { } + void horseran(machine_config &config); + +private: required_device m_lcd; void lcd_output_w(offs_t offset, u32 data); void write_r(u16 data); u8 read_k(); - void horseran(machine_config &config); }; // handlers @@ -6718,12 +6794,12 @@ INPUT_PORTS_END void horseran_state::horseran(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1100(config, m_maincpu, 300000); // approximation - RC osc. R=56K, C=47pF m_maincpu->k().set(FUNC(horseran_state::read_k)); m_maincpu->r().set(FUNC(horseran_state::write_r)); - /* video hardware */ + // video hardware HLCD0569(config, m_lcd, 1100); // C=0.022uF m_lcd->write_cols().set(FUNC(horseran_state::lcd_output_w)); @@ -6731,7 +6807,7 @@ void horseran_state::horseran(machine_config &config) m_display->set_segmask(0x3f<<3, 0x7f); config.set_default_layout(layout_horseran); - /* no sound! */ + // no sound! } // roms @@ -6768,10 +6844,12 @@ public: hh_tms1k_state(mconfig, type, tag) { } + void mdndclab(machine_config &config); + +private: void write_r(u16 data); void write_o(u16 data); u8 read_k(); - void mdndclab(machine_config &config); }; // handlers @@ -6911,16 +6989,15 @@ INPUT_PORTS_END void mdndclab_state::mdndclab(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1100(config, m_maincpu, 475000); // approximation - RC osc. R=27K, C=100pF m_maincpu->k().set(FUNC(mdndclab_state::read_k)); m_maincpu->r().set(FUNC(mdndclab_state::write_r)); m_maincpu->o().set(FUNC(mdndclab_state::write_o)); - /* no visual feedback! */ config.set_default_layout(layout_mdndclab); // playing board - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); @@ -6967,10 +7044,12 @@ public: hh_tms1k_state(mconfig, type, tag) { } + void comp4(machine_config &config); + +private: void write_r(u16 data); void write_o(u16 data); u8 read_k(); - void comp4(machine_config &config); }; // handlers @@ -7026,17 +7105,17 @@ INPUT_PORTS_END void comp4_state::comp4(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS0970(config, m_maincpu, 250000); // approximation m_maincpu->k().set(FUNC(comp4_state::read_k)); m_maincpu->r().set(FUNC(comp4_state::write_r)); m_maincpu->o().set(FUNC(comp4_state::write_o)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(1, 11); config.set_default_layout(layout_comp4); - /* no sound! */ + // no sound! } // roms @@ -7087,10 +7166,12 @@ public: hh_tms1k_state(mconfig, type, tag) { } + void bship(machine_config &config); + +private: void write_r(u16 data); void write_o(u16 data); u8 read_k(); - void bship(machine_config &config); }; // handlers @@ -7193,17 +7274,17 @@ INPUT_PORTS_END void bship_state::bship(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1000(config, m_maincpu, 200000); // approximation - RC osc. R=100K, C=47pF m_maincpu->k().set(FUNC(bship_state::read_k)); m_maincpu->r().set(FUNC(bship_state::write_r)); m_maincpu->o().set(FUNC(bship_state::write_o)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(1, 1); config.set_default_layout(layout_bship); - /* sound hardware */ + // sound hardware // TODO } @@ -7243,12 +7324,14 @@ public: m_sn(*this, "sn76477") { } + void bshipb(machine_config &config); + +private: required_device m_sn; void write_r(u16 data); void write_o(u16 data); u8 read_k(); - void bshipb(machine_config &config); }; // handlers @@ -7309,17 +7392,17 @@ u8 bshipb_state::read_k() void bshipb_state::bshipb(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1000(config, m_maincpu, 200000); // approximation - RC osc. R=100K, C=47pF m_maincpu->k().set(FUNC(bshipb_state::read_k)); m_maincpu->r().set(FUNC(bshipb_state::write_r)); m_maincpu->o().set(FUNC(bshipb_state::write_o)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(1, 1); config.set_default_layout(layout_bship); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SN76477(config, m_sn); m_sn->set_noise_params(RES_K(47), RES_K(100), CAP_P(47)); // R18, R17, C8 @@ -7377,9 +7460,11 @@ public: hh_tms1k_state(mconfig, type, tag) { } + void simon(machine_config &config); + +private: void write_r(u16 data); u8 read_k(); - void simon(machine_config &config); }; // handlers @@ -7446,16 +7531,16 @@ INPUT_PORTS_END void simon_state::simon(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1000(config, m_maincpu, 350000); // approximation - RC osc. R=33K, C=100pF m_maincpu->k().set(FUNC(simon_state::read_k)); m_maincpu->r().set(FUNC(simon_state::write_r)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(1, 4); config.set_default_layout(layout_simon); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); @@ -7505,15 +7590,17 @@ public: hh_tms1k_state(mconfig, type, tag) { } - void write_r(u16 data); - u8 read_k(); + void ssimon(machine_config &config); - void set_clock(); DECLARE_INPUT_CHANGED_MEMBER(speed_switch) { set_clock(); } - void ssimon(machine_config &config); protected: virtual void machine_reset() override; + +private: + void set_clock(); + void write_r(u16 data); + u8 read_k(); }; void ssimon_state::machine_reset() @@ -7613,16 +7700,16 @@ INPUT_PORTS_END void ssimon_state::ssimon(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1100(config, m_maincpu, 275000); // see set_clock m_maincpu->k().set(FUNC(ssimon_state::read_k)); m_maincpu->r().set(FUNC(ssimon_state::write_r)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(1, 4); config.set_default_layout(layout_ssimon); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); @@ -7683,7 +7770,7 @@ private: void write_o(u16 data); u8 read_k(); - int m_gearbox_pos; + int m_gearbox_pos = 0; bool sensor_state() { return m_gearbox_pos < 0 && m_display->element_on(0, 0); } TIMER_DEVICE_CALLBACK_MEMBER(gearbox_sim_tick); @@ -7698,14 +7785,14 @@ void bigtrak_state::machine_start() { hh_tms1k_state::machine_start(); + // resolve handlers m_left_motor_forward.resolve(); m_left_motor_reverse.resolve(); m_right_motor_forward.resolve(); m_right_motor_reverse.resolve(); m_ext_out.resolve(); - // zerofill/register for savestates - m_gearbox_pos = 0; + // register for savestates save_item(NAME(m_gearbox_pos)); } @@ -7823,7 +7910,7 @@ INPUT_PORTS_END void bigtrak_state::bigtrak(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1000(config, m_maincpu, 200000); // approximation - RC osc. R=83K, C=100pF m_maincpu->k().set(FUNC(bigtrak_state::read_k)); m_maincpu->r().set(FUNC(bigtrak_state::write_r)); @@ -7831,11 +7918,11 @@ void bigtrak_state::bigtrak(machine_config &config) TIMER(config, "gearbox").configure_periodic(FUNC(bigtrak_state::gearbox_sim_tick), attotime::from_msec(1)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(1, 2); config.set_default_layout(layout_bigtrak); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); static const double speaker_levels[8] = { 0.0, 1.0/3.0, 1.0/3.0, 2.0/3.0, 1.0/3.0, 2.0/3.0, 2.0/3.0, 1.0 }; @@ -7901,11 +7988,11 @@ private: output_finder<> m_card_pos_out; output_finder<> m_motor_on_out; - int m_motor_pos; - int m_motor_pos_prev; - int m_motor_decay; - bool m_motor_on; - bool m_sensor_blind; + int m_motor_pos = 0; + int m_motor_pos_prev = -1; + int m_motor_decay = 0; + bool m_motor_on = false; + bool m_sensor_blind = false; TIMER_DEVICE_CALLBACK_MEMBER(motor_sim_tick); @@ -7922,13 +8009,6 @@ void mbdtower_state::machine_start() m_card_pos_out.resolve(); m_motor_on_out.resolve(); - // zerofill - m_motor_pos = 0; - m_motor_pos_prev = -1; - m_motor_decay = 0; - m_motor_on = false; - m_sensor_blind = false; - // register for savestates save_item(NAME(m_motor_pos)); /* save_item(NAME(m_motor_pos_prev)); */ // don't save! @@ -8077,7 +8157,7 @@ INPUT_PORTS_END void mbdtower_state::mbdtower(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1400(config, m_maincpu, 425000); // approximation - RC osc. R=43K, C=56pF m_maincpu->k().set(FUNC(mbdtower_state::read_k)); m_maincpu->r().set(FUNC(mbdtower_state::write_r)); @@ -8085,12 +8165,12 @@ void mbdtower_state::mbdtower(machine_config &config) TIMER(config, "tower_motor").configure_periodic(FUNC(mbdtower_state::motor_sim_tick), attotime::from_msec(3500/0x80)); // ~3.5sec for a full rotation - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(3, 7); m_display->set_segmask(6, 0x7f); config.set_default_layout(layout_mbdtower); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); @@ -8130,10 +8210,12 @@ public: hh_tms1k_state(mconfig, type, tag) { } + void arcmania(machine_config &config); + +private: void write_r(u16 data); void write_o(u16 data); u8 read_k(); - void arcmania(machine_config &config); }; // handlers @@ -8201,17 +8283,17 @@ INPUT_PORTS_END void arcmania_state::arcmania(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1100(config, m_maincpu, 250000); // approximation - RC osc. R=56K, C=100pF m_maincpu->k().set(FUNC(arcmania_state::read_k)); m_maincpu->r().set(FUNC(arcmania_state::write_r)); m_maincpu->o().set(FUNC(arcmania_state::write_o)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(1, 9); config.set_default_layout(layout_arcmania); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); static const double speaker_levels[8] = { 0.0, 1.0/3.0, 1.0/3.0, 2.0/3.0, 1.0/3.0, 2.0/3.0, 2.0/3.0, 1.0 }; @@ -8254,10 +8336,12 @@ public: hh_tms1k_state(mconfig, type, tag) { } + void cnsector(machine_config &config); + +private: void write_r(u16 data); void write_o(u16 data); u8 read_k(); - void cnsector(machine_config &config); }; // handlers @@ -8333,18 +8417,18 @@ INPUT_PORTS_END void cnsector_state::cnsector(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS0970(config, m_maincpu, 250000); // approximation m_maincpu->k().set(FUNC(cnsector_state::read_k)); m_maincpu->r().set(FUNC(cnsector_state::write_r)); m_maincpu->o().set(FUNC(cnsector_state::write_o)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(10, 8); m_display->set_segmask(0x3f, 0xff); config.set_default_layout(layout_cnsector); - /* no sound! */ + // no sound! } // roms @@ -8396,10 +8480,12 @@ public: hh_tms1k_state(mconfig, type, tag) { } + void merlin(machine_config &config); + +protected: virtual void write_r(u16 data); virtual void write_o(u16 data); virtual u8 read_k(); - void merlin(machine_config &config); }; // handlers @@ -8463,17 +8549,17 @@ INPUT_PORTS_END void merlin_state::merlin(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1100(config, m_maincpu, 350000); // approximation - RC osc. R=33K, C=100pF m_maincpu->k().set(FUNC(merlin_state::read_k)); m_maincpu->r().set(FUNC(merlin_state::write_r)); m_maincpu->o().set(FUNC(merlin_state::write_o)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(1, 11); config.set_default_layout(layout_merlin); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); static const double speaker_levels[8] = { 0.0, 1.0/3.0, 1.0/3.0, 2.0/3.0, 1.0/3.0, 2.0/3.0, 2.0/3.0, 1.0 }; @@ -8544,7 +8630,7 @@ void mmerlin_state::mmerlin(machine_config &config) { merlin(config); - /* basic machine hardware */ + // basic machine hardware TMS1400(config.replace(), m_maincpu, 425000); // approximation - RC osc. R=30K, C=100pF m_maincpu->k().set(FUNC(mmerlin_state::read_k)); m_maincpu->r().set(FUNC(mmerlin_state::write_r)); @@ -8588,10 +8674,12 @@ public: hh_tms1k_state(mconfig, type, tag) { } + void pbmastm(machine_config &config); + +private: void write_r(u16 data); void write_o(u16 data); u8 read_k(); - void pbmastm(machine_config &config); }; // handlers @@ -8656,17 +8744,17 @@ INPUT_PORTS_END void pbmastm_state::pbmastm(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1000(config, m_maincpu, 300000); // approximation - RC osc. R=56K, C=47pF m_maincpu->k().set(FUNC(pbmastm_state::read_k)); m_maincpu->r().set(FUNC(pbmastm_state::write_r)); m_maincpu->o().set(FUNC(pbmastm_state::write_o)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(1, 10); config.set_default_layout(layout_pbmastm); - /* no sound! */ + // no sound! } // roms @@ -8705,10 +8793,12 @@ public: hh_tms1k_state(mconfig, type, tag) { } + void stopthief(machine_config &config); + +private: void write_r(u16 data); void write_o(u16 data); u8 read_k(); - void stopthief(machine_config &config); }; // handlers @@ -8778,19 +8868,19 @@ INPUT_PORTS_END void stopthief_state::stopthief(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS0980(config, m_maincpu, 425000); // approximation m_maincpu->k().set(FUNC(stopthief_state::read_k)); m_maincpu->r().set(FUNC(stopthief_state::write_r)); m_maincpu->o().set(FUNC(stopthief_state::write_o)); - m_maincpu->power_off().set(FUNC(hh_tms1k_state::auto_power_off)); + m_maincpu->power_off().set(FUNC(stopthief_state::auto_power_off)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(3, 7); m_display->set_segmask(7, 0x7f); config.set_default_layout(layout_stopthief); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); static const double speaker_levels[7] = { 1.0/7.0, 1.0/6.0, 1.0/5.0, 1.0/4.0, 1.0/3.0, 1.0/2.0, 1.0 }; @@ -8858,11 +8948,13 @@ public: hh_tms1k_state(mconfig, type, tag) { } + void bankshot(machine_config &config); + +private: void update_display(); void write_r(u16 data); void write_o(u16 data); u8 read_k(); - void bankshot(machine_config &config); }; // handlers @@ -8928,18 +9020,18 @@ INPUT_PORTS_END void bankshot_state::bankshot(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1400(config, m_maincpu, 475000); // approximation - RC osc. R=24K, C=100pF m_maincpu->k().set(FUNC(bankshot_state::read_k)); m_maincpu->r().set(FUNC(bankshot_state::write_r)); m_maincpu->o().set(FUNC(bankshot_state::write_o)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(11, 8); m_display->set_bri_levels(0.01, 0.08); // cue ball is brigher config.set_default_layout(layout_bankshot); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); @@ -9000,11 +9092,13 @@ public: hh_tms1k_state(mconfig, type, tag) { } + void splitsec(machine_config &config); + +private: void update_display(); void write_r(u16 data); void write_o(u16 data); u8 read_k(); - void splitsec(machine_config &config); }; // handlers @@ -9059,17 +9153,17 @@ INPUT_PORTS_END void splitsec_state::splitsec(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1400(config, m_maincpu, 475000); // approximation - RC osc. R=24K, C=100pF m_maincpu->k().set(FUNC(splitsec_state::read_k)); m_maincpu->r().set(FUNC(splitsec_state::write_r)); m_maincpu->o().set(FUNC(splitsec_state::write_o)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(8, 7); config.set_default_layout(layout_splitsec); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); @@ -9109,10 +9203,12 @@ public: hh_tms1k_state(mconfig, type, tag) { } + void lostreas(machine_config &config); + +private: void write_r(u16 data); void write_o(u16 data); u8 read_k(); - void lostreas(machine_config &config); }; // handlers @@ -9184,17 +9280,17 @@ INPUT_PORTS_END void lostreas_state::lostreas(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1100(config, m_maincpu, 425000); // approximation - RC osc. R=39K, C=47pF m_maincpu->k().set(FUNC(lostreas_state::read_k)); m_maincpu->r().set(FUNC(lostreas_state::write_r)); m_maincpu->o().set(FUNC(lostreas_state::write_o)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(1, 11); config.set_default_layout(layout_lostreas); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); @@ -9247,10 +9343,12 @@ public: hh_tms1k_state(mconfig, type, tag) { } + void alphie(machine_config &config); + +private: void write_r(u16 data); void write_o(u16 data); u8 read_k(); - void alphie(machine_config &config); }; // handlers @@ -9329,18 +9427,18 @@ static const u16 alphie_output_pla[0x20] = void alphie_state::alphie(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1000(config, m_maincpu, 350000); // approximation m_maincpu->set_output_pla(alphie_output_pla); m_maincpu->k().set(FUNC(alphie_state::read_k)); m_maincpu->r().set(FUNC(alphie_state::write_r)); m_maincpu->o().set(FUNC(alphie_state::write_o)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(1, 5); config.set_default_layout(layout_alphie); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); @@ -9381,11 +9479,13 @@ public: hh_tms1k_state(mconfig, type, tag) { } + void tcfball(machine_config &config); + +protected: void update_display(); virtual void write_r(u16 data); virtual void write_o(u16 data); virtual u8 read_k(); - void tcfball(machine_config &config); }; // handlers @@ -9450,20 +9550,20 @@ INPUT_PORTS_END void tcfball_state::tcfball(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1100(config, m_maincpu, 375000); // approximation - RC osc. R=56K, C=24pF m_maincpu->k().set(FUNC(tcfball_state::read_k)); m_maincpu->r().set(FUNC(tcfball_state::write_r)); m_maincpu->o().set(FUNC(tcfball_state::write_o)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(11, 8); m_display->set_segmask(0x77, 0x7f); m_display->set_segmask(0x08, 0xff); // R3 has DP m_display->set_bri_levels(0.003, 0.03); // offense leds are brighter config.set_default_layout(layout_tcfball); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); @@ -9526,7 +9626,7 @@ void tcfballa_state::tcfballa(machine_config &config) { tcfball(config); - /* basic machine hardware */ + // basic machine hardware m_maincpu->set_clock(375000); // approximation - RC osc. R=47K, C=50pF config.set_default_layout(layout_tcfballa); @@ -9585,11 +9685,13 @@ public: hh_tms1k_state(mconfig, type, tag) { } + void tandy12(machine_config &config); + +private: void update_display(); void write_r(u16 data); void write_o(u16 data); u8 read_k(); - void tandy12(machine_config &config); }; // handlers @@ -9695,18 +9797,18 @@ static const u16 tandy12_output_pla[0x20] = void tandy12_state::tandy12(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1100(config, m_maincpu, 400000); // approximation - RC osc. R=39K, C=47pF m_maincpu->set_output_pla(tandy12_output_pla); m_maincpu->k().set(FUNC(tandy12_state::read_k)); m_maincpu->r().set(FUNC(tandy12_state::write_r)); m_maincpu->o().set(FUNC(tandy12_state::write_o)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(1, 13); config.set_default_layout(layout_tandy12); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); @@ -9751,10 +9853,12 @@ public: hh_tms1k_state(mconfig, type, tag) { } + void monkeysee(machine_config &config); + +private: void write_r(u16 data); void write_o(u16 data); u8 read_k(); - void monkeysee(machine_config &config); }; // handlers @@ -9817,17 +9921,17 @@ INPUT_PORTS_END void monkeysee_state::monkeysee(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1000(config, m_maincpu, 250000); // approximation - RC osc. R=68K, C=47pF m_maincpu->k().set(FUNC(monkeysee_state::read_k)); m_maincpu->r().set(FUNC(monkeysee_state::write_r)); m_maincpu->o().set(FUNC(monkeysee_state::write_o)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(1, 2); config.set_default_layout(layout_monkeysee); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); @@ -9870,13 +9974,15 @@ public: m_speech(*this, "speech") { } + void speechp(machine_config &config); + +private: required_device m_speech; void update_display(); virtual void write_r(u16 data); virtual void write_o(u16 data); virtual u8 read_k(); - void speechp(machine_config &config); }; // handlers @@ -9978,18 +10084,18 @@ INPUT_PORTS_END void speechp_state::speechp(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1000(config, m_maincpu, 400000); // approximation - RC osc. R=39K, C=47pF m_maincpu->k().set(FUNC(speechp_state::read_k)); m_maincpu->r().set(FUNC(speechp_state::write_r)); m_maincpu->o().set(FUNC(speechp_state::write_o)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(9, 8); m_display->set_segmask(0x1ff, 0xff); config.set_default_layout(layout_speechp); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); S14001A(config, m_speech, 25000); // approximation m_speech->add_route(ALL_OUTPUTS, "mono", 0.75); @@ -10033,11 +10139,13 @@ public: hh_tms1k_state(mconfig, type, tag) { } + void tisr16(machine_config &config); + +private: void update_display(); void write_o(u16 data); void write_r(u16 data); u8 read_k(); - void tisr16(machine_config &config); }; // handlers @@ -10212,18 +10320,18 @@ INPUT_PORTS_END void tisr16_state::tisr16(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1000(config, m_maincpu, 300000); // approximation - RC osc. R=43K, C=68pf (note: tisr16ii MCU RC osc. is different: R=30K, C=100pf, same freq) m_maincpu->k().set(FUNC(tisr16_state::read_k)); m_maincpu->o().set(FUNC(tisr16_state::write_o)); m_maincpu->r().set(FUNC(tisr16_state::write_r)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(12, 8); m_display->set_segmask(0xfff, 0xff); config.set_default_layout(layout_tisr16); - /* no sound! */ + // no sound! } // roms @@ -10375,26 +10483,26 @@ INPUT_PORTS_END void ti1250_state::ti1250(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS0950(config, m_maincpu, 200000); // approximation - RC osc. R=68K, C=68pf m_maincpu->k().set(FUNC(ti1250_state::read_k)); m_maincpu->o().set(FUNC(ti1250_state::write_o)); m_maincpu->r().set(FUNC(ti1250_state::write_r)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(9, 8); m_display->set_segmask(0xff, 0xff); m_display->set_segmask(0x100, 0x40); // R8 only has segment G connected config.set_default_layout(layout_ti1250); - /* no sound! */ + // no sound! } void ti1250_state::ti1270(machine_config &config) { ti1250(config); - /* basic machine hardware */ + // basic machine hardware TMS0970(config.replace(), m_maincpu, 250000); // approximation m_maincpu->k().set(FUNC(ti1250_state::read_k)); m_maincpu->o().set(FUNC(ti1250_state::write_o)); @@ -10552,18 +10660,18 @@ INPUT_PORTS_END void ti25503_state::ti25503(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1040(config, m_maincpu, 250000); // approximation m_maincpu->k().set(FUNC(ti25503_state::read_k)); m_maincpu->o().set(FUNC(ti25503_state::write_o)); m_maincpu->r().set(FUNC(ti25503_state::write_r)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(9, 8); m_display->set_segmask(0x1ff, 0xff); config.set_default_layout(layout_ti25503); - /* no sound! */ + // no sound! } // roms @@ -10704,18 +10812,18 @@ INPUT_PORTS_END void ti5100_state::ti5100(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1070(config, m_maincpu, 250000); // approximation m_maincpu->k().set(FUNC(ti5100_state::read_k)); m_maincpu->o().set(FUNC(ti5100_state::write_o)); m_maincpu->r().set(FUNC(ti5100_state::write_r)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(11, 9); m_display->set_segmask(0x7ff, 0xff); config.set_default_layout(layout_ti5100); - /* no sound! */ + // no sound! } // roms @@ -10974,20 +11082,20 @@ INPUT_PORTS_END void ti30_state::ti30(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS0980(config, m_maincpu, 400000); // guessed m_maincpu->k().set(FUNC(ti30_state::read_k)); m_maincpu->o().set(FUNC(ti30_state::write_o)); m_maincpu->r().set(FUNC(ti30_state::write_r)); - m_maincpu->power_off().set(FUNC(hh_tms1k_state::auto_power_off)); + m_maincpu->power_off().set(FUNC(ti30_state::auto_power_off)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(9, 8); m_display->set_segmask(0x1fe, 0xff); m_display->set_segmask(0x001, 0xe2); // 1st digit only has segments B,F,G,DP config.set_default_layout(layout_ti30); - /* no sound! */ + // no sound! } // roms @@ -11123,18 +11231,18 @@ INPUT_PORTS_END void ti1000_state::ti1000(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1990(config, m_maincpu, 250000); // approximation m_maincpu->k().set(FUNC(ti1000_state::read_k)); m_maincpu->o().set(FUNC(ti1000_state::write_o)); m_maincpu->r().set(FUNC(ti1000_state::write_r)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(8, 8); m_display->set_segmask(0xff, 0xff); config.set_default_layout(layout_ti1270); - /* no sound! */ + // no sound! } // roms @@ -11174,6 +11282,7 @@ public: void wizatron(machine_config &config); +protected: virtual void write_o(u16 data); virtual void write_r(u16 data); virtual u8 read_k(); @@ -11240,19 +11349,19 @@ INPUT_PORTS_END void wizatron_state::wizatron(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS0970(config, m_maincpu, 250000); // approximation m_maincpu->k().set(FUNC(wizatron_state::read_k)); m_maincpu->o().set(FUNC(wizatron_state::write_o)); m_maincpu->r().set(FUNC(wizatron_state::write_r)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(9, 7); m_display->set_segmask(0x1ff^8, 0x7f); m_display->set_segmask(8, 0x41); // equals sign config.set_default_layout(layout_wizatron); - /* no sound! */ + // no sound! } // roms @@ -11337,7 +11446,7 @@ void lilprof_state::lilprof(machine_config &config) { wizatron(config); - /* basic machine hardware */ + // basic machine hardware m_maincpu->k().set(FUNC(lilprof_state::read_k)); m_maincpu->o().set(FUNC(lilprof_state::write_o)); } @@ -11456,18 +11565,18 @@ INPUT_PORTS_END void lilprof78_state::lilprof78(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1990(config, m_maincpu, 250000); // approximation m_maincpu->k().set(FUNC(lilprof78_state::read_k)); m_maincpu->o().set(FUNC(lilprof78_state::write_o)); m_maincpu->r().set(FUNC(lilprof78_state::write_r)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(9, 7); m_display->set_segmask(0x1ff, 0x7f); config.set_default_layout(layout_wizatron); - /* no sound! */ + // no sound! } // roms @@ -11510,10 +11619,11 @@ public: m_ram(*this, "ram") { } - required_device m_ram; - void ti1680(machine_config &config); +private: + required_device m_ram; + virtual void update_display(); virtual void write_o(u16 data); virtual void write_r(u16 data); @@ -11601,21 +11711,21 @@ INPUT_PORTS_END void ti1680_state::ti1680(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1980(config, m_maincpu, 300000); // approximation m_maincpu->k().set(FUNC(ti1680_state::read_k)); m_maincpu->o().set(FUNC(ti1680_state::write_o)); m_maincpu->r().set(FUNC(ti1680_state::write_r)); - m_maincpu->power_off().set(FUNC(hh_tms1k_state::auto_power_off)); + m_maincpu->power_off().set(FUNC(ti1680_state::auto_power_off)); TMC0999(config, m_ram); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(9, 9); m_display->set_segmask(0x1fe, 0xff); config.set_default_layout(layout_ti1680); - /* no sound! */ + // no sound! } // roms @@ -11653,6 +11763,7 @@ public: void dataman(machine_config &config); +protected: virtual void update_display(); virtual void write_o(u16 data); virtual void write_r(u16 data); @@ -11732,19 +11843,19 @@ INPUT_PORTS_END void dataman_state::dataman(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1980(config, m_maincpu, 300000); // patent says 300kHz m_maincpu->k().set(FUNC(dataman_state::read_k)); m_maincpu->o().set(FUNC(dataman_state::write_o)); m_maincpu->r().set(FUNC(dataman_state::write_r)); - m_maincpu->power_off().set(FUNC(hh_tms1k_state::auto_power_off)); + m_maincpu->power_off().set(FUNC(dataman_state::auto_power_off)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(9, 8); m_display->set_segmask(0x1ff, 0x7f); config.set_default_layout(layout_dataman); - /* no sound! */ + // no sound! } // roms @@ -11819,12 +11930,12 @@ void mathmarv_state::mathmarv(machine_config &config) { dataman(config); - /* basic machine hardware */ + // basic machine hardware m_maincpu->r().set(FUNC(mathmarv_state::write_r)); config.set_default_layout(layout_mathmarv); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); } @@ -11871,10 +11982,12 @@ public: hh_tms1k_state(mconfig, type, tag) { } + void timaze(machine_config &config); + +private: void write_r(u16 data); void write_o(u16 data); u8 read_k(); - void timaze(machine_config &config); }; // handlers @@ -11909,18 +12022,18 @@ INPUT_PORTS_END void timaze_state::timaze(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1000(config, m_maincpu, 200000); // approximation - RC osc. R=80K, C=27pF m_maincpu->k().set(FUNC(timaze_state::read_k)); m_maincpu->r().set(FUNC(timaze_state::write_r)); m_maincpu->o().set(FUNC(timaze_state::write_o)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(1, 8); m_display->set_segmask(1, 0x5c); config.set_default_layout(layout_timaze); - /* no sound! */ + // no sound! } // roms @@ -11959,13 +12072,14 @@ public: m_60hz(*this, "ac_line") { } - void write_r(u16 data); - void write_o(u16 data); - u8 read_k(); void tithermos(machine_config &config); private: required_device m_60hz; + + void write_r(u16 data); + void write_o(u16 data); + u8 read_k(); }; // handlers @@ -12064,7 +12178,7 @@ INPUT_PORTS_END void tithermos_state::tithermos(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS0970(config, m_maincpu, 250000); // approximation m_maincpu->k().set(FUNC(tithermos_state::read_k)); m_maincpu->r().set(FUNC(tithermos_state::write_r)); @@ -12072,12 +12186,12 @@ void tithermos_state::tithermos(machine_config &config) CLOCK(config, "ac_line", 60); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(4, 7); m_display->set_segmask(0xf, 0x7f); config.set_default_layout(layout_tithermos); - /* no sound! */ + // no sound! } // roms @@ -12121,10 +12235,12 @@ public: hh_tms1k_state(mconfig, type, tag) { } + void subwars(machine_config &config); + +private: void update_display(); void write_r(u16 data); void write_o(u16 data); - void subwars(machine_config &config); }; // handlers @@ -12164,18 +12280,18 @@ INPUT_PORTS_END void subwars_state::subwars(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1200(config, m_maincpu, 550000); // approximation - RC osc. R=24K, C=47pF m_maincpu->k().set_ioport("IN.0"); m_maincpu->r().set(FUNC(subwars_state::write_r)); m_maincpu->o().set(FUNC(subwars_state::write_o)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(13, 7); m_display->set_segmask(0xf, 0x7f); config.set_default_layout(layout_subwars); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); @@ -12218,10 +12334,12 @@ public: hh_tms1k_state(mconfig, type, tag) { } + void copycat(machine_config &config); + +private: void write_r(u16 data); void write_o(u16 data); u8 read_k(); - void copycat(machine_config &config); }; // handlers @@ -12281,17 +12399,17 @@ INPUT_PORTS_END void copycat_state::copycat(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1000(config, m_maincpu, 320000); // approximation - RC osc. R=47K, C=47pF m_maincpu->k().set(FUNC(copycat_state::read_k)); m_maincpu->r().set(FUNC(copycat_state::write_r)); m_maincpu->o().set(FUNC(copycat_state::write_o)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(1, 4); config.set_default_layout(layout_copycat); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); static const double speaker_levels[4] = { 0.0, 1.0, -1.0, 0.0 }; @@ -12340,9 +12458,11 @@ public: hh_tms1k_state(mconfig, type, tag) { } + void copycatm2(machine_config &config); + +private: void write_r(u16 data); void write_o(u16 data); - void copycatm2(machine_config &config); }; // handlers @@ -12371,17 +12491,17 @@ INPUT_PORTS_END void copycatm2_state::copycatm2(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1730(config, m_maincpu, 275000); // approximation - RC osc. R=100K, C=47pF m_maincpu->k().set_ioport("IN.0"); m_maincpu->r().set(FUNC(copycatm2_state::write_r)); m_maincpu->o().set(FUNC(copycatm2_state::write_o)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(1, 4); config.set_default_layout(layout_copycatm2); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); static const double speaker_levels[4] = { 0.0, 1.0, -1.0, 0 }; @@ -12425,9 +12545,11 @@ public: hh_tms1k_state(mconfig, type, tag) { } + void ditto(machine_config &config); + +private: void write_r(u16 data); void write_o(u16 data); - void ditto(machine_config &config); }; // handlers @@ -12456,17 +12578,17 @@ INPUT_PORTS_END void ditto_state::ditto(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1700(config, m_maincpu, 275000); // approximation - RC osc. R=100K, C=47pF m_maincpu->k().set_ioport("IN.0"); m_maincpu->r().set(FUNC(ditto_state::write_r)); m_maincpu->o().set(FUNC(ditto_state::write_o)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(1, 4); config.set_default_layout(layout_ditto); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); static const double speaker_levels[4] = { 0.0, 1.0, -1.0, 0 }; @@ -12513,11 +12635,13 @@ public: hh_tms1k_state(mconfig, type, tag) { } + void ss7in1(machine_config &config); + +private: void update_display(); void write_r(u16 data); void write_o(u16 data); u8 read_k(); - void ss7in1(machine_config &config); }; // handlers @@ -12585,19 +12709,19 @@ INPUT_PORTS_END void ss7in1_state::ss7in1(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1400(config, m_maincpu, 450000); // approximation - RC osc. R=47K, C=47pF m_maincpu->k().set(FUNC(ss7in1_state::read_k)); m_maincpu->r().set(FUNC(ss7in1_state::write_r)); m_maincpu->o().set(FUNC(ss7in1_state::write_o)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(9, 8); m_display->set_segmask(0xf, 0x7f); m_display->set_bri_levels(0.005, 0.05); // player led is brighter config.set_default_layout(layout_7in1ss); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); @@ -12662,30 +12786,29 @@ public: m_expander(*this, "expander") { } + void tbreakup(machine_config &config); + + DECLARE_INPUT_CHANGED_MEMBER(skill_switch) { set_clock(); } + +protected: + virtual void machine_reset() override; + virtual void machine_start() override; + +private: required_device m_expander; - u8 m_exp_port[7]; + u8 m_exp_port[7] = { }; void expander_w(offs_t offset, u8 data); + void set_clock(); void update_display(); void write_r(u16 data); void write_o(u16 data); u8 read_k(); - - void set_clock(); - DECLARE_INPUT_CHANGED_MEMBER(skill_switch) { set_clock(); } - void tbreakup(machine_config &config); - -protected: - virtual void machine_reset() override; - virtual void machine_start() override; }; void tbreakup_state::machine_start() { hh_tms1k_state::machine_start(); - - // zerofill/register for savestates - memset(m_exp_port, 0, sizeof(m_exp_port)); save_item(NAME(m_exp_port)); } @@ -12779,7 +12902,7 @@ INPUT_PORTS_END void tbreakup_state::tbreakup(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1040(config, m_maincpu, 325000); // see set_clock m_maincpu->k().set(FUNC(tbreakup_state::read_k)); m_maincpu->r().set(FUNC(tbreakup_state::write_r)); @@ -12794,12 +12917,12 @@ void tbreakup_state::tbreakup(machine_config &config) m_expander->write_port6_callback().set(FUNC(tbreakup_state::expander_w)); m_expander->write_port7_callback().set(FUNC(tbreakup_state::expander_w)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(2+6+6, 8); m_display->set_segmask(3, 0x7f); config.set_default_layout(layout_tbreakup); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); @@ -12857,13 +12980,15 @@ public: hh_tms1k_state(mconfig, type, tag) { } + void phpball(machine_config &config); + + DECLARE_INPUT_CHANGED_MEMBER(flipper_button) { update_display(); } + +private: void update_display(); void write_r(u16 data); void write_o(u16 data); u8 read_k(); - - DECLARE_INPUT_CHANGED_MEMBER(flipper_button) { update_display(); } - void phpball(machine_config &config); }; // handlers @@ -12919,18 +13044,18 @@ INPUT_PORTS_END void phpball_state::phpball(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1100(config, m_maincpu, 375000); // approximation - RC osc. R=47K, C=47pF m_maincpu->k().set(FUNC(phpball_state::read_k)); m_maincpu->r().set(FUNC(phpball_state::write_r)); m_maincpu->o().set(FUNC(phpball_state::write_o)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(11, 7); m_display->set_segmask(7, 0x7f); config.set_default_layout(layout_phpball); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); @@ -12972,11 +13097,13 @@ public: hh_tms1k_state(mconfig, type, tag) { } + void ssports4(machine_config &config); + +private: void update_display(); void write_r(u16 data); void write_o(u16 data); u8 read_k(); - void ssports4(machine_config &config); }; // handlers @@ -13059,19 +13186,19 @@ INPUT_PORTS_END void ssports4_state::ssports4(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1100(config, m_maincpu, 375000); // approximation - RC osc. R=47K, C=47pF m_maincpu->k().set(FUNC(ssports4_state::read_k)); m_maincpu->r().set(FUNC(ssports4_state::write_r)); m_maincpu->o().set(FUNC(ssports4_state::write_o)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(10, 9); m_display->set_segmask(0x303, 0x7f); m_display->set_bri_levels(0.003, 0.03); // offense leds are brighter config.set_default_layout(layout_ssports4); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); @@ -13114,17 +13241,19 @@ public: hh_tms1k_state(mconfig, type, tag) { } - void update_halt(); + void xl25(machine_config &config); + DECLARE_INPUT_CHANGED_MEMBER(k4_button) { update_halt(); } +protected: + virtual void machine_reset() override; + +private: + void update_halt(); void update_display(); void write_r(u16 data); void write_o(u16 data); u8 read_k(); - void xl25(machine_config &config); - -protected: - virtual void machine_reset() override; }; void xl25_state::machine_reset() @@ -13241,17 +13370,17 @@ INPUT_PORTS_END void xl25_state::xl25(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1000C(config, m_maincpu, 300000); // approximation - RC osc. R=5.6K, C=47pF m_maincpu->k().set(FUNC(xl25_state::read_k)); m_maincpu->r().set(FUNC(xl25_state::write_r)); m_maincpu->o().set(FUNC(xl25_state::write_o)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(10, 3); config.set_default_layout(layout_xl25); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); diff --git a/src/mame/drivers/hh_ucom4.cpp b/src/mame/drivers/hh_ucom4.cpp index fc75f7a5a98..408df17b279 100644 --- a/src/mame/drivers/hh_ucom4.cpp +++ b/src/mame/drivers/hh_ucom4.cpp @@ -122,12 +122,12 @@ protected: optional_ioport_array<6> m_inputs; // max 6 // misc common - u8 m_port[9]; // MCU port A-I write data (optional) - u8 m_int; // MCU INT pin state - u16 m_inp_mux; // multiplexed inputs mask + u8 m_port[9] = { }; // MCU port A-I write data (optional) + u8 m_int = 0; // MCU INT pin state + u16 m_inp_mux = 0; // multiplexed inputs mask - u32 m_grid; // VFD current row data - u32 m_plate; // VFD current column data + u32 m_grid = 0; // VFD current row data + u32 m_plate = 0; // VFD current column data u8 read_inputs(int columns); void refresh_interrupts(void); @@ -152,13 +152,6 @@ protected: void hh_ucom4_state::machine_start() { - // zerofill - memset(m_port, 0, sizeof(m_port)); - m_int = 0; - m_inp_mux = 0; - m_grid = 0; - m_plate = 0; - // register for savestates save_item(NAME(m_port)); save_item(NAME(m_int)); @@ -255,11 +248,13 @@ public: hh_ucom4_state(mconfig, type, tag) { } + void ufombs(machine_config &config); + +private: void update_display(); void grid_w(offs_t offset, u8 data); void plate_w(offs_t offset, u8 data); void speaker_w(u8 data); - void ufombs(machine_config &config); }; // handlers @@ -312,7 +307,7 @@ INPUT_PORTS_END void ufombs_state::ufombs(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware NEC_D552(config, m_maincpu, 400000); // approximation m_maincpu->read_a().set_ioport("IN.0"); m_maincpu->read_b().set_ioport("IN.1"); @@ -324,7 +319,7 @@ void ufombs_state::ufombs(machine_config &config) m_maincpu->write_h().set(FUNC(ufombs_state::grid_w)); m_maincpu->write_i().set(FUNC(ufombs_state::plate_w)); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); screen.set_refresh_hz(60); screen.set_size(243, 1080); @@ -332,7 +327,7 @@ void ufombs_state::ufombs(machine_config &config) PWM_DISPLAY(config, m_display).set_size(9, 10); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); static const double speaker_levels[] = { 0.0, 1.0, -1.0, 0.0 }; @@ -377,11 +372,13 @@ public: hh_ucom4_state(mconfig, type, tag) { } + void ssfball(machine_config &config); + +private: void update_display(); void grid_w(offs_t offset, u8 data); void plate_w(offs_t offset, u8 data); u8 input_b_r(); - void ssfball(machine_config &config); }; // handlers @@ -468,7 +465,7 @@ INPUT_PORTS_END void ssfball_state::ssfball(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware NEC_D553(config, m_maincpu, 400000); // approximation m_maincpu->read_a().set_ioport("IN.3"); m_maincpu->read_b().set(FUNC(ssfball_state::input_b_r)); @@ -480,7 +477,7 @@ void ssfball_state::ssfball(machine_config &config) m_maincpu->write_h().set(FUNC(ssfball_state::plate_w)); m_maincpu->write_i().set(FUNC(ssfball_state::plate_w)); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); screen.set_refresh_hz(60); screen.set_size(1920, 482); @@ -488,7 +485,7 @@ void ssfball_state::ssfball(machine_config &config) PWM_DISPLAY(config, m_display).set_size(9, 16); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); static const double speaker_levels[] = { 0.0, 1.0, -1.0, 0.0 }; @@ -538,11 +535,13 @@ public: hh_ucom4_state(mconfig, type, tag) { } + void bmsoccer(machine_config &config); + +private: void update_display(); void grid_w(offs_t offset, u8 data); void plate_w(offs_t offset, u8 data); u8 input_a_r(); - void bmsoccer(machine_config &config); }; // handlers @@ -615,7 +614,7 @@ INPUT_PORTS_END void bmsoccer_state::bmsoccer(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware NEC_D552(config, m_maincpu, 400000); // approximation m_maincpu->read_a().set(FUNC(bmsoccer_state::input_a_r)); m_maincpu->read_b().set_ioport("IN.2"); @@ -627,7 +626,7 @@ void bmsoccer_state::bmsoccer(machine_config &config) m_maincpu->write_h().set(FUNC(bmsoccer_state::plate_w)); m_maincpu->write_i().set(FUNC(bmsoccer_state::plate_w)); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); screen.set_refresh_hz(60); screen.set_size(271, 1080); @@ -635,7 +634,7 @@ void bmsoccer_state::bmsoccer(machine_config &config) PWM_DISPLAY(config, m_display).set_size(9, 16); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); @@ -671,11 +670,13 @@ public: hh_ucom4_state(mconfig, type, tag) { } + void bmsafari(machine_config &config); + +private: void update_display(); void grid_w(offs_t offset, u8 data); void plate_w(offs_t offset, u8 data); void speaker_w(u8 data); - void bmsafari(machine_config &config); }; // handlers @@ -733,7 +734,7 @@ INPUT_PORTS_END void bmsafari_state::bmsafari(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware NEC_D552(config, m_maincpu, 400000); // approximation m_maincpu->read_a().set_ioport("IN.0"); m_maincpu->read_b().set_ioport("IN.1"); @@ -744,7 +745,7 @@ void bmsafari_state::bmsafari(machine_config &config) m_maincpu->write_h().set(FUNC(bmsafari_state::plate_w)); m_maincpu->write_i().set(FUNC(bmsafari_state::plate_w)); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); screen.set_refresh_hz(60); screen.set_size(248, 1080); @@ -752,7 +753,7 @@ void bmsafari_state::bmsafari(machine_config &config) PWM_DISPLAY(config, m_display).set_size(9, 10); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); @@ -791,11 +792,13 @@ public: hh_ucom4_state(mconfig, type, tag) { } + void splasfgt(machine_config &config); + +private: void update_display(); void grid_w(offs_t offset, u8 data); void plate_w(offs_t offset, u8 data); u8 input_b_r(); - void splasfgt(machine_config &config); }; // handlers @@ -891,7 +894,7 @@ INPUT_PORTS_END void splasfgt_state::splasfgt(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware NEC_D553(config, m_maincpu, 400000); // approximation m_maincpu->read_a().set_ioport("IN.4"); m_maincpu->read_b().set(FUNC(splasfgt_state::input_b_r)); @@ -903,7 +906,7 @@ void splasfgt_state::splasfgt(machine_config &config) m_maincpu->write_h().set(FUNC(splasfgt_state::grid_w)); m_maincpu->write_i().set(FUNC(splasfgt_state::grid_w)); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); screen.set_refresh_hz(60); screen.set_size(1920, 476); @@ -911,7 +914,7 @@ void splasfgt_state::splasfgt(machine_config &config) PWM_DISPLAY(config, m_display).set_size(9, 16); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); static const double speaker_levels[] = { 0.0, 1.0, -1.0, 0.0 }; @@ -953,10 +956,12 @@ public: hh_ucom4_state(mconfig, type, tag) { } + void bcclimbr(machine_config &config); + +private: void update_display(); void grid_w(offs_t offset, u8 data); void plate_w(offs_t offset, u8 data); - void bcclimbr(machine_config &config); }; // handlers @@ -1006,7 +1011,7 @@ INPUT_PORTS_END void bcclimbr_state::bcclimbr(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware NEC_D553(config, m_maincpu, 400_kHz_XTAL); m_maincpu->read_a().set_ioport("IN.0"); m_maincpu->read_b().set_ioport("IN.1"); @@ -1018,7 +1023,7 @@ void bcclimbr_state::bcclimbr(machine_config &config) m_maincpu->write_h().set(FUNC(bcclimbr_state::grid_w)); m_maincpu->write_i().set(FUNC(bcclimbr_state::grid_w)); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); screen.set_refresh_hz(60); screen.set_size(310, 1080); @@ -1026,7 +1031,7 @@ void bcclimbr_state::bcclimbr(machine_config &config) PWM_DISPLAY(config, m_display).set_size(6, 20); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); @@ -1068,11 +1073,13 @@ public: hh_ucom4_state(mconfig, type, tag) { } + void tactix(machine_config &config); + +private: void leds_w(offs_t offset, u8 data); void speaker_w(u8 data); void input_w(offs_t offset, u8 data); u8 input_r(); - void tactix(machine_config &config); }; // handlers @@ -1139,7 +1146,7 @@ INPUT_PORTS_END void tactix_state::tactix(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware NEC_D557L(config, m_maincpu, 200000); // approximation m_maincpu->read_a().set(FUNC(tactix_state::input_r)); m_maincpu->write_c().set(FUNC(tactix_state::input_w)); @@ -1148,11 +1155,11 @@ void tactix_state::tactix(machine_config &config) m_maincpu->write_f().set(FUNC(tactix_state::leds_w)); m_maincpu->write_g().set(FUNC(tactix_state::speaker_w)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(4, 4); config.set_default_layout(layout_tactix); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); @@ -1187,15 +1194,17 @@ public: hh_ucom4_state(mconfig, type, tag) { } + void ctntune(machine_config &config); + // start button powers unit back on DECLARE_INPUT_CHANGED_MEMBER(start_button) { m_maincpu->set_input_line(INPUT_LINE_RESET, CLEAR_LINE); } +private: void update_display(); void _7seg_w(offs_t offset, u8 data); void speaker_w(u8 data); void input_w(offs_t offset, u8 data); u8 input_r(); - void ctntune(machine_config &config); }; // handlers @@ -1279,7 +1288,7 @@ INPUT_PORTS_END void ctntune_state::ctntune(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware NEC_D557L(config, m_maincpu, 200000); // approximation m_maincpu->read_a().set(FUNC(ctntune_state::input_r)); m_maincpu->write_c().set(FUNC(ctntune_state::input_w)); @@ -1288,12 +1297,12 @@ void ctntune_state::ctntune(machine_config &config) m_maincpu->write_f().set(FUNC(ctntune_state::_7seg_w)); m_maincpu->write_g().set(FUNC(ctntune_state::speaker_w)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(1, 7+2); m_display->set_segmask(1, 0x7f); config.set_default_layout(layout_ctntune); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); @@ -1330,10 +1339,12 @@ public: hh_ucom4_state(mconfig, type, tag) { } + void invspace(machine_config &config); + +private: void update_display(); void grid_w(offs_t offset, u8 data); void plate_w(offs_t offset, u8 data); - void invspace(machine_config &config); }; // handlers @@ -1382,7 +1393,7 @@ INPUT_PORTS_END void invspace_state::invspace(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware NEC_D552(config, m_maincpu, 400_kHz_XTAL); m_maincpu->read_a().set_ioport("IN.0"); m_maincpu->read_b().set_ioport("IN.1"); @@ -1394,7 +1405,7 @@ void invspace_state::invspace(machine_config &config) m_maincpu->write_h().set(FUNC(invspace_state::plate_w)); m_maincpu->write_i().set(FUNC(invspace_state::grid_w)); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); screen.set_refresh_hz(60); screen.set_size(289, 1080); @@ -1402,7 +1413,7 @@ void invspace_state::invspace(machine_config &config) PWM_DISPLAY(config, m_display).set_size(9, 19); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); @@ -1442,10 +1453,12 @@ public: hh_ucom4_state(mconfig, type, tag) { } + void efball(machine_config &config); + +private: void update_display(); void grid_w(offs_t offset, u8 data); void plate_w(offs_t offset, u8 data); - void efball(machine_config &config); }; // handlers @@ -1508,7 +1521,7 @@ INPUT_PORTS_END void efball_state::efball(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware NEC_D553(config, m_maincpu, 400_kHz_XTAL); m_maincpu->read_a().set_ioport("IN.0"); m_maincpu->read_b().set_ioport("IN.1"); @@ -1520,11 +1533,11 @@ void efball_state::efball(machine_config &config) m_maincpu->write_h().set(FUNC(efball_state::grid_w)); m_maincpu->write_i().set(FUNC(efball_state::plate_w)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(10, 11); config.set_default_layout(layout_efball); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); @@ -1563,11 +1576,13 @@ public: hh_ucom4_state(mconfig, type, tag) { } + void galaxy2b(machine_config &config); + void galaxy2(machine_config &config); + +private: void update_display(); void grid_w(offs_t offset, u8 data); void plate_w(offs_t offset, u8 data); - void galaxy2b(machine_config &config); - void galaxy2(machine_config &config); }; // handlers @@ -1616,7 +1631,7 @@ INPUT_PORTS_END void galaxy2_state::galaxy2(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware NEC_D553(config, m_maincpu, 400_kHz_XTAL); m_maincpu->read_a().set_ioport("IN.0"); m_maincpu->read_b().set_ioport("IN.1"); @@ -1628,7 +1643,7 @@ void galaxy2_state::galaxy2(machine_config &config) m_maincpu->write_h().set(FUNC(galaxy2_state::plate_w)); m_maincpu->write_i().set(FUNC(galaxy2_state::plate_w)); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); screen.set_refresh_hz(60); screen.set_size(304, 1080); @@ -1636,7 +1651,7 @@ void galaxy2_state::galaxy2(machine_config &config) PWM_DISPLAY(config, m_display).set_size(10, 15); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); @@ -1646,7 +1661,7 @@ void galaxy2_state::galaxy2b(machine_config &config) { galaxy2(config); - /* video hardware */ + // video hardware screen_device *screen = subdevice("screen"); screen->set_size(306, 1080); screen->set_visarea_full(); @@ -1695,10 +1710,12 @@ public: hh_ucom4_state(mconfig, type, tag) { } + void astrocmd(machine_config &config); + +private: void update_display(); void grid_w(offs_t offset, u8 data); void plate_w(offs_t offset, u8 data); - void astrocmd(machine_config &config); }; // handlers @@ -1754,7 +1771,7 @@ INPUT_PORTS_END void astrocmd_state::astrocmd(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware NEC_D553(config, m_maincpu, 400_kHz_XTAL); m_maincpu->read_a().set_ioport("IN.0"); m_maincpu->read_b().set_ioport("IN.1"); @@ -1766,7 +1783,7 @@ void astrocmd_state::astrocmd(machine_config &config) m_maincpu->write_h().set(FUNC(astrocmd_state::plate_w)); m_maincpu->write_i().set(FUNC(astrocmd_state::plate_w)); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); screen.set_refresh_hz(60); screen.set_size(1920, 525); @@ -1774,7 +1791,7 @@ void astrocmd_state::astrocmd(machine_config &config) PWM_DISPLAY(config, m_display).set_size(9, 17); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); @@ -1815,10 +1832,12 @@ public: hh_ucom4_state(mconfig, type, tag) { } + void edracula(machine_config &config); + +private: void update_display(); void grid_w(offs_t offset, u8 data); void plate_w(offs_t offset, u8 data); - void edracula(machine_config &config); }; // handlers @@ -1866,7 +1885,7 @@ INPUT_PORTS_END void edracula_state::edracula(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware NEC_D553(config, m_maincpu, 400_kHz_XTAL); m_maincpu->read_a().set_ioport("IN.0"); m_maincpu->read_b().set_ioport("IN.1"); @@ -1878,7 +1897,7 @@ void edracula_state::edracula(machine_config &config) m_maincpu->write_h().set(FUNC(edracula_state::plate_w)); m_maincpu->write_i().set(FUNC(edracula_state::plate_w)); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); screen.set_refresh_hz(60); screen.set_size(1920, 526); @@ -1886,7 +1905,7 @@ void edracula_state::edracula(machine_config &config) PWM_DISPLAY(config, m_display).set_size(8, 18); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); @@ -1922,11 +1941,13 @@ public: m_lcd(*this, "lcd") { } + void mcompgin(machine_config &config); + +private: required_device m_lcd; void lcd_output_w(offs_t offset, u32 data); void lcd_w(u8 data); - void mcompgin(machine_config &config); }; // handlers @@ -1964,13 +1985,13 @@ INPUT_PORTS_END void mcompgin_state::mcompgin(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware NEC_D650(config, m_maincpu, 400_kHz_XTAL); // TDK FCR400K m_maincpu->read_a().set_ioport("IN.0"); m_maincpu->read_b().set_ioport("IN.1"); m_maincpu->write_e().set(FUNC(mcompgin_state::lcd_w)); - /* video hardware */ + // video hardware HLCD0530(config, m_lcd, 500); // C=0.01uF m_lcd->write_cols().set(FUNC(mcompgin_state::lcd_output_w)); @@ -1978,7 +1999,7 @@ void mcompgin_state::mcompgin(machine_config &config) config.set_default_layout(layout_mcompgin); - /* no sound! */ + // no sound! } // roms @@ -2008,11 +2029,13 @@ public: hh_ucom4_state(mconfig, type, tag) { } + void mvbfree(machine_config &config); + +private: void update_display(); void grid_w(offs_t offset, u8 data); void plate_w(offs_t offset, u8 data); void speaker_w(u8 data); - void mvbfree(machine_config &config); }; // handlers @@ -2070,7 +2093,7 @@ INPUT_PORTS_END void mvbfree_state::mvbfree(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware NEC_D553(config, m_maincpu, 400000); // approximation m_maincpu->read_a().set_ioport("IN.0"); m_maincpu->read_b().set_ioport("IN.1"); @@ -2082,11 +2105,11 @@ void mvbfree_state::mvbfree(machine_config &config) m_maincpu->write_h().set(FUNC(mvbfree_state::grid_w)); m_maincpu->write_i().set(FUNC(mvbfree_state::speaker_w)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(14, 10); config.set_default_layout(layout_mvbfree); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); @@ -2127,11 +2150,13 @@ public: hh_ucom4_state(mconfig, type, tag) { } + void grobot9(machine_config &config); + +private: void lamps_w(offs_t offset, u8 data); void speaker_w(u8 data); void input_w(u8 data); u8 input_r(); - void grobot9(machine_config &config); }; // handlers @@ -2197,7 +2222,7 @@ INPUT_PORTS_END void grobot9_state::grobot9(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware NEC_D557L(config, m_maincpu, 160000); // approximation m_maincpu->read_a().set(FUNC(grobot9_state::input_r)); m_maincpu->write_c().set(FUNC(grobot9_state::input_w)); @@ -2205,11 +2230,11 @@ void grobot9_state::grobot9(machine_config &config) m_maincpu->write_e().set(FUNC(grobot9_state::lamps_w)); m_maincpu->write_f().set(FUNC(grobot9_state::lamps_w)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(1, 9); config.set_default_layout(layout_grobot9); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); @@ -2246,10 +2271,12 @@ public: hh_ucom4_state(mconfig, type, tag) { } + void tccombat(machine_config &config); + +private: void update_display(); void grid_w(offs_t offset, u8 data); void plate_w(offs_t offset, u8 data); - void tccombat(machine_config &config); }; // handlers @@ -2295,7 +2322,7 @@ INPUT_PORTS_END void tccombat_state::tccombat(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware NEC_D552(config, m_maincpu, 400000); // approximation m_maincpu->read_a().set_ioport("IN.0"); m_maincpu->write_c().set(FUNC(tccombat_state::grid_w)); @@ -2306,7 +2333,7 @@ void tccombat_state::tccombat(machine_config &config) m_maincpu->write_h().set(FUNC(tccombat_state::plate_w)); m_maincpu->write_i().set(FUNC(tccombat_state::grid_w)); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); screen.set_refresh_hz(60); screen.set_size(300, 1080); @@ -2314,7 +2341,7 @@ void tccombat_state::tccombat(machine_config &config) PWM_DISPLAY(config, m_display).set_size(9, 20); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); @@ -2356,18 +2383,20 @@ public: hh_ucom4_state(mconfig, type, tag) { } - void update_display(); - void grid_w(offs_t offset, u8 data); - void plate_w(offs_t offset, u8 data); - void port_e_w(u8 data); - u8 input_r(offs_t offset); + void tmtennis(machine_config &config); - void set_clock(); DECLARE_INPUT_CHANGED_MEMBER(difficulty_switch) { set_clock(); } - void tmtennis(machine_config &config); protected: virtual void machine_reset() override; + +private: + void set_clock(); + void update_display(); + void grid_w(offs_t offset, u8 data); + void plate_w(offs_t offset, u8 data); + void port_e_w(u8 data); + u8 input_r(offs_t offset); }; void tmtennis_state::machine_reset() @@ -2463,7 +2492,7 @@ INPUT_PORTS_END void tmtennis_state::tmtennis(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware NEC_D552(config, m_maincpu, 360000); // see set_clock m_maincpu->read_a().set(FUNC(tmtennis_state::input_r)); m_maincpu->read_b().set(FUNC(tmtennis_state::input_r)); @@ -2475,7 +2504,7 @@ void tmtennis_state::tmtennis(machine_config &config) m_maincpu->write_h().set(FUNC(tmtennis_state::grid_w)); m_maincpu->write_i().set(FUNC(tmtennis_state::grid_w)); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); screen.set_refresh_hz(60); screen.set_size(1920, 417); @@ -2484,7 +2513,7 @@ void tmtennis_state::tmtennis(machine_config &config) PWM_DISPLAY(config, m_display).set_size(12, 12); config.set_default_layout(layout_tmtennis); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); @@ -2530,10 +2559,12 @@ public: hh_ucom4_state(mconfig, type, tag) { } + void tmpacman(machine_config &config); + +private: void update_display(); void grid_w(offs_t offset, u8 data); void plate_w(offs_t offset, u8 data); - void tmpacman(machine_config &config); }; // handlers @@ -2583,7 +2614,7 @@ INPUT_PORTS_END void tmpacman_state::tmpacman(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware NEC_D553(config, m_maincpu, 430_kHz_XTAL); m_maincpu->read_a().set_ioport("IN.0"); m_maincpu->read_b().set_ioport("IN.1"); @@ -2595,7 +2626,7 @@ void tmpacman_state::tmpacman(machine_config &config) m_maincpu->write_h().set(FUNC(tmpacman_state::plate_w)); m_maincpu->write_i().set(FUNC(tmpacman_state::plate_w)); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); screen.set_refresh_hz(60); screen.set_size(1920, 508); @@ -2603,7 +2634,7 @@ void tmpacman_state::tmpacman(machine_config &config) PWM_DISPLAY(config, m_display).set_size(8, 19); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); @@ -2645,10 +2676,12 @@ public: hh_ucom4_state(mconfig, type, tag) { } + void tmscramb(machine_config &config); + +private: void update_display(); void grid_w(offs_t offset, u8 data); void plate_w(offs_t offset, u8 data); - void tmscramb(machine_config &config); }; // handlers @@ -2696,7 +2729,7 @@ INPUT_PORTS_END void tmscramb_state::tmscramb(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware NEC_D553(config, m_maincpu, 400_kHz_XTAL); m_maincpu->read_a().set_ioport("IN.0"); m_maincpu->read_b().set_ioport("IN.1"); @@ -2708,7 +2741,7 @@ void tmscramb_state::tmscramb(machine_config &config) m_maincpu->write_h().set(FUNC(tmscramb_state::plate_w)); m_maincpu->write_i().set(FUNC(tmscramb_state::grid_w)); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); screen.set_refresh_hz(60); screen.set_size(1920, 556); @@ -2716,7 +2749,7 @@ void tmscramb_state::tmscramb(machine_config &config) PWM_DISPLAY(config, m_display).set_size(10, 17); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); @@ -2757,10 +2790,12 @@ public: hh_ucom4_state(mconfig, type, tag) { } + void tcaveman(machine_config &config); + +private: void update_display(); void grid_w(offs_t offset, u8 data); void plate_w(offs_t offset, u8 data); - void tcaveman(machine_config &config); }; // handlers @@ -2806,7 +2841,7 @@ INPUT_PORTS_END void tcaveman_state::tcaveman(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware NEC_D553(config, m_maincpu, 400_kHz_XTAL); m_maincpu->read_a().set_ioport("IN.0"); m_maincpu->write_c().set(FUNC(tcaveman_state::grid_w)); @@ -2817,7 +2852,7 @@ void tcaveman_state::tcaveman(machine_config &config) m_maincpu->write_h().set(FUNC(tcaveman_state::plate_w)); m_maincpu->write_i().set(FUNC(tcaveman_state::plate_w)); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); screen.set_refresh_hz(60); screen.set_size(1920, 559); @@ -2825,7 +2860,7 @@ void tcaveman_state::tcaveman(machine_config &config) PWM_DISPLAY(config, m_display).set_size(8, 19); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); @@ -2867,9 +2902,11 @@ public: hh_ucom4_state(mconfig, type, tag) { } + void alnchase(machine_config &config); + +private: void output_w(offs_t offset, u8 data); u8 input_r(); - void alnchase(machine_config &config); }; // handlers @@ -2948,7 +2985,7 @@ INPUT_PORTS_END void alnchase_state::alnchase(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware NEC_D553(config, m_maincpu, 400_kHz_XTAL); m_maincpu->read_a().set(FUNC(alnchase_state::input_r)); m_maincpu->read_b().set_ioport("IN.2"); @@ -2960,7 +2997,7 @@ void alnchase_state::alnchase(machine_config &config) m_maincpu->write_h().set(FUNC(alnchase_state::output_w)); m_maincpu->write_i().set(FUNC(alnchase_state::output_w)); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_SVG)); screen.set_refresh_hz(60); screen.set_size(365, 1080); @@ -2968,7 +3005,7 @@ void alnchase_state::alnchase(machine_config &config) PWM_DISPLAY(config, m_display).set_size(9, 17); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker); m_speaker->add_route(ALL_OUTPUTS, "mono", 0.25); diff --git a/src/mame/drivers/tispeak.cpp b/src/mame/drivers/tispeak.cpp index 0ef99c621ba..7d8f11b36b2 100644 --- a/src/mame/drivers/tispeak.cpp +++ b/src/mame/drivers/tispeak.cpp @@ -520,7 +520,6 @@ void tispeak_state::machine_start() hh_tms1k_state::machine_start(); m_ol_out.resolve(); - init_cartridge(); } @@ -1292,7 +1291,7 @@ INPUT_PORTS_END void tispeak_state::tms5110_route(machine_config &config) { - /* sound hardware */ + // sound hardware m_tms5100->m0().set(m_tms6100, FUNC(tms6100_device::m0_w)); m_tms5100->m1().set(m_tms6100, FUNC(tms6100_device::m1_w)); m_tms5100->addr().set(m_tms6100, FUNC(tms6100_device::add_w)); @@ -1303,7 +1302,7 @@ void tispeak_state::tms5110_route(machine_config &config) void tispeak_state::snmath(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS0270(config, m_maincpu, MASTER_CLOCK/2); m_maincpu->k().set(FUNC(tispeak_state::snspell_read_k)); m_maincpu->o().set(FUNC(tispeak_state::snmath_write_o)); @@ -1313,12 +1312,12 @@ void tispeak_state::snmath(machine_config &config) m_maincpu->write_ctl().set("tms5100", FUNC(tms5110_device::ctl_w)); m_maincpu->write_pdc().set("tms5100", FUNC(tms5110_device::pdc_w)); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(16, 16); m_display->set_segmask(0x21ff, 0x3fff); config.set_default_layout(layout_snmath); - /* sound hardware */ + // sound hardware TMS6100(config, m_tms6100, MASTER_CLOCK/4); SPEAKER(config, "mono").front_center(); @@ -1331,12 +1330,12 @@ void tispeak_state::sns_cd2801(machine_config &config) { snmath(config); - /* basic machine hardware */ + // basic machine hardware m_maincpu->o().set(FUNC(tispeak_state::snspell_write_o)); config.set_default_layout(layout_snspell); - /* cartridge */ + // cartridge GENERIC_CARTSLOT(config, m_cart, generic_plain_slot, "snspell", "vsm"); m_cart->set_device_load(FUNC(tispeak_state::cart_load)); @@ -1347,7 +1346,7 @@ void tispeak_state::snspellit(machine_config &config) { sns_cd2801(config); - /* basic machine hardware */ + // basic machine hardware config.set_default_layout(layout_snmath); } @@ -1355,7 +1354,7 @@ void tispeak_state::sns_tmc0281(machine_config &config) { sns_cd2801(config); - /* sound hardware */ + // sound hardware TMC0281(config.replace(), m_tms5100, MASTER_CLOCK); tms5110_route(config); } @@ -1364,7 +1363,7 @@ void tispeak_state::snspellsp(machine_config &config) { sns_tmc0281(config); - /* basic machine hardware */ + // basic machine hardware config.set_default_layout(layout_snspellsp); } @@ -1372,7 +1371,7 @@ void tispeak_state::sns_tmc0281d(machine_config &config) { sns_cd2801(config); - /* sound hardware */ + // sound hardware TMC0281D(config.replace(), m_tms5100, MASTER_CLOCK); tms5110_route(config); } @@ -1382,12 +1381,12 @@ void tispeak_state::snread(machine_config &config) { snmath(config); - /* basic machine hardware */ + // basic machine hardware m_maincpu->o().set(FUNC(tispeak_state::snspell_write_o)); config.set_default_layout(layout_snread); - /* cartridge */ + // cartridge GENERIC_CARTSLOT(config, m_cart, generic_plain_slot, "snread", "vsm"); m_cart->set_device_load(FUNC(tispeak_state::cart_load)); @@ -1399,13 +1398,13 @@ void tispeak_state::lantutor(machine_config &config) { snmath(config); - /* basic machine hardware */ + // basic machine hardware m_maincpu->o().set(FUNC(tispeak_state::snspell_write_o)); m_maincpu->r().set(FUNC(tispeak_state::lantutor_write_r)); config.set_default_layout(layout_snread); - /* cartridge */ + // cartridge GENERIC_CARTSLOT(config, m_cart, generic_plain_slot, "lantutor", "vsm,bin"); m_cart->set_must_be_loaded(true); m_cart->set_device_load(FUNC(tispeak_state::cart_load)); @@ -1416,22 +1415,22 @@ void tispeak_state::lantutor(machine_config &config) void tispeak_state::snspellc(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1100(config, m_maincpu, MASTER_CLOCK/2); m_maincpu->k().set(FUNC(tispeak_state::snspellc_read_k)); m_maincpu->o().set(FUNC(tispeak_state::snspellc_write_o)); m_maincpu->r().set(FUNC(tispeak_state::snspellc_write_r)); - /* no visual feedback! */ + // no visual feedback! - /* sound hardware */ + // sound hardware TMS6100(config, m_tms6100, MASTER_CLOCK/4); SPEAKER(config, "mono").front_center(); TMC0281D(config, m_tms5100, MASTER_CLOCK); tms5110_route(config); - /* cartridge */ + // cartridge GENERIC_CARTSLOT(config, m_cart, generic_plain_slot, "snspell", "vsm"); m_cart->set_device_load(FUNC(tispeak_state::cart_load)); @@ -1442,7 +1441,7 @@ void tispeak_state::snspellcuk(machine_config &config) { snspellc(config); - /* sound hardware */ + // sound hardware CD2801(config.replace(), m_tms5100, MASTER_CLOCK); // CD2801A! tms5110_route(config); } @@ -1450,7 +1449,7 @@ void tispeak_state::snspellcuk(machine_config &config) void tispeak_state::vocaid(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1100(config, m_maincpu, MASTER_CLOCK/2); m_maincpu->k().set(FUNC(tispeak_state::tntell_read_k)); m_maincpu->o().set(FUNC(tispeak_state::snspellc_write_o)); @@ -1459,7 +1458,7 @@ void tispeak_state::vocaid(machine_config &config) TIMER(config, "ol_timer").configure_periodic(FUNC(tispeak_state::tntell_get_overlay), attotime::from_msec(50)); config.set_default_layout(layout_tntell); - /* sound hardware */ + // sound hardware TMS6100(config, m_tms6100, MASTER_CLOCK/4); SPEAKER(config, "mono").front_center(); @@ -1471,7 +1470,7 @@ void tispeak_state::tntell(machine_config &config) { vocaid(config); - /* cartridge */ + // cartridge GENERIC_CARTSLOT(config, m_cart, generic_plain_slot, "tntell", "vsm"); m_cart->set_device_load(FUNC(tispeak_state::cart_load)); @@ -1481,7 +1480,7 @@ void tispeak_state::tntell(machine_config &config) void tispeak_state::k28m2(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS1400(config, m_maincpu, MASTER_CLOCK/2); m_maincpu->k().set(FUNC(tispeak_state::k28_read_k)); m_maincpu->o().set(FUNC(tispeak_state::k28_write_o)); @@ -1489,14 +1488,14 @@ void tispeak_state::k28m2(machine_config &config) config.set_default_layout(layout_k28m2); - /* sound hardware */ + // sound hardware TMS6100(config, m_tms6100, MASTER_CLOCK/4); SPEAKER(config, "mono").front_center(); TMS5110A(config, m_tms5100, MASTER_CLOCK); tms5110_route(config); - /* cartridge */ + // cartridge GENERIC_CARTSLOT(config, m_cart, generic_plain_slot, "k28m2", "vsm"); m_cart->set_device_load(FUNC(tispeak_state::cart_load)); diff --git a/src/mame/drivers/tispellb.cpp b/src/mame/drivers/tispellb.cpp index 7ac6ac124d5..ae8ecd7ab81 100644 --- a/src/mame/drivers/tispellb.cpp +++ b/src/mame/drivers/tispellb.cpp @@ -86,9 +86,9 @@ private: optional_device m_subcpu; optional_device m_tms6100; - u8 m_rev1_ctl; - u16 m_sub_o; - u16 m_sub_r; + u8 m_rev1_ctl = 0; + u16 m_sub_o = 0; + u16 m_sub_r = 0; virtual void power_off() override; void power_subcpu(); @@ -114,11 +114,6 @@ void tispellb_state::machine_start() { hh_tms1k_state::machine_start(); - // zerofill - m_rev1_ctl = 0; - m_sub_o = 0; - m_sub_r = 0; - // register for savestates save_item(NAME(m_rev1_ctl)); save_item(NAME(m_sub_o)); @@ -340,7 +335,7 @@ INPUT_PORTS_END void tispellb_state::rev1(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS0270(config, m_maincpu, 350000); // approximation m_maincpu->k().set(FUNC(tispellb_state::main_read_k)); m_maincpu->o().set(FUNC(tispellb_state::main_write_o)); @@ -355,18 +350,18 @@ void tispellb_state::rev1(machine_config &config) config.set_perfect_quantum(m_maincpu); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(16, 16); m_display->set_segmask(0xff, 0x3fff); config.set_default_layout(layout_spellb); - /* no sound! */ + // no sound! } void tispellb_state::rev2(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware TMS0270(config, m_maincpu, 350000); // approximation m_maincpu->k().set(FUNC(tispellb_state::main_read_k)); m_maincpu->o().set(FUNC(tispellb_state::rev2_write_o)); @@ -377,12 +372,12 @@ void tispellb_state::rev2(machine_config &config) TMS6100(config, m_tms6100, 350000); m_tms6100->enable_4bit_mode(true); - /* video hardware */ + // video hardware PWM_DISPLAY(config, m_display).set_size(16, 16); m_display->set_segmask(0xff, 0x3fff); config.set_default_layout(layout_spellb); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); } diff --git a/src/mame/includes/hh_tms1k.h b/src/mame/includes/hh_tms1k.h index 43e3c0d2aa0..3435455d5b7 100644 --- a/src/mame/includes/hh_tms1k.h +++ b/src/mame/includes/hh_tms1k.h @@ -35,6 +35,16 @@ public: m_out_power(*this, "power") { } + virtual DECLARE_INPUT_CHANGED_MEMBER(reset_button); + virtual DECLARE_INPUT_CHANGED_MEMBER(power_button); + + template DECLARE_INPUT_CHANGED_MEMBER(switch_next) { if (newval) switch_change(Sel, param, true); } + template DECLARE_INPUT_CHANGED_MEMBER(switch_prev) { if (newval) switch_change(Sel, param, false); } + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + // devices required_device m_maincpu; optional_device m_display; @@ -53,19 +63,10 @@ public: u8 read_inputs(int columns); u8 read_rotated_inputs(int columns, u8 rowmask = 0xf); - virtual DECLARE_INPUT_CHANGED_MEMBER(reset_button); - virtual DECLARE_INPUT_CHANGED_MEMBER(power_button); virtual DECLARE_WRITE_LINE_MEMBER(auto_power_off); virtual void power_off(); void set_power(bool state); - void switch_change(int sel, u32 mask, bool next); - template DECLARE_INPUT_CHANGED_MEMBER(switch_next) { if (newval) switch_change(Sel, param, true); } - template DECLARE_INPUT_CHANGED_MEMBER(switch_prev) { if (newval) switch_change(Sel, param, false); } - -protected: - virtual void machine_start() override; - virtual void machine_reset() override; }; diff --git a/src/mame/layout/vidchal.lay b/src/mame/layout/vidchal.lay index 8bb5b1b1e26..80f7bf6c574 100644 --- a/src/mame/layout/vidchal.lay +++ b/src/mame/layout/vidchal.lay @@ -4,7 +4,7 @@ license:CC0 --> - + @@ -16,7 +16,7 @@ license:CC0 - + -- cgit v1.2.3