diff options
Diffstat (limited to 'src/mame/includes/bzone.h')
-rw-r--r-- | src/mame/includes/bzone.h | 65 |
1 files changed, 47 insertions, 18 deletions
diff --git a/src/mame/includes/bzone.h b/src/mame/includes/bzone.h index 1d5aecea14d..b4b71c84988 100644 --- a/src/mame/includes/bzone.h +++ b/src/mame/includes/bzone.h @@ -5,6 +5,10 @@ Atari Battle Zone hardware *************************************************************************/ +#ifndef MAME_INCLUDES_BZONE_H +#define MAME_INCLUDES_BZONE_H + +#pragma once #include "audio/redbaron.h" #include "machine/mathbox.h" @@ -16,36 +20,61 @@ class bzone_state : public driver_device { public: - bzone_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), + bzone_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), m_mathbox(*this, "mathbox"), - m_discrete(*this, "discrete"), - m_redbaronsound(*this, "custom") - { } + m_discrete(*this, "discrete") + { } - required_device<cpu_device> m_maincpu; - required_device<mathbox_device> m_mathbox; - optional_device<discrete_device> m_discrete; - optional_device<redbaron_sound_device> m_redbaronsound; + DECLARE_CUSTOM_INPUT_MEMBER(clock_r); + DECLARE_DRIVER_INIT(bradley); + void bzone(machine_config &config); - uint8_t m_analog_data; - uint8_t m_rb_input_select; +protected: DECLARE_WRITE8_MEMBER(bzone_coin_counter_w); DECLARE_READ8_MEMBER(analog_data_r); DECLARE_WRITE8_MEMBER(analog_select_w); - DECLARE_CUSTOM_INPUT_MEMBER(clock_r); - DECLARE_READ8_MEMBER(redbaron_joy_r); - DECLARE_WRITE8_MEMBER(redbaron_joysound_w); - DECLARE_DRIVER_INIT(bradley); virtual void machine_start() override; - DECLARE_MACHINE_START(redbaron); INTERRUPT_GEN_MEMBER(bzone_interrupt); DECLARE_WRITE8_MEMBER(bzone_sounds_w); + void bzone_base(machine_config &config); - void redbaron(machine_config &config); - void bzone(machine_config &config); void bzone_audio(machine_config &config); void bzone_map(address_map &map); + +private: + required_device<cpu_device> m_maincpu; + required_device<mathbox_device> m_mathbox; + optional_device<discrete_device> m_discrete; + + uint8_t m_analog_data; +}; + + +class redbaron_state : public bzone_state +{ +public: + redbaron_state(const machine_config &mconfig, device_type type, const char *tag) : + bzone_state(mconfig, type, tag), + m_redbaronsound(*this, "custom"), + m_fake_ports(*this, "FAKE%u", 1U) + { } + + void redbaron(machine_config &config); + +protected: + DECLARE_READ8_MEMBER(redbaron_joy_r); + DECLARE_WRITE8_MEMBER(redbaron_joysound_w); + + virtual void machine_start() override; + void redbaron_map(address_map &map); + +private: + required_device<redbaron_sound_device> m_redbaronsound; + required_ioport_array<2> m_fake_ports; + uint8_t m_rb_input_select; }; + +#endif // MAME_INCLUDES_BZONE_H |