summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/includes/mcr3.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/includes/mcr3.h')
-rw-r--r--src/mame/includes/mcr3.h118
1 files changed, 74 insertions, 44 deletions
diff --git a/src/mame/includes/mcr3.h b/src/mame/includes/mcr3.h
index 14a3129c9c6..5916e77fb59 100644
--- a/src/mame/includes/mcr3.h
+++ b/src/mame/includes/mcr3.h
@@ -23,78 +23,59 @@ public:
mcr3_state(const machine_config &mconfig, device_type type, const char *tag)
: mcr_state(mconfig, type, tag)
, m_spyhunt_alpharam(*this, "spyhunt_alpha")
- , m_maxrpm_adc(*this, "adc")
- , m_lamplatch(*this, "lamplatch")
, m_screen(*this, "screen")
, m_lamps(*this, "lamp%u", 0U)
{ }
- DECLARE_WRITE8_MEMBER(mcr3_videoram_w);
- DECLARE_WRITE8_MEMBER(spyhunt_videoram_w);
- DECLARE_WRITE8_MEMBER(spyhunt_alpharam_w);
- DECLARE_WRITE8_MEMBER(spyhunt_scroll_value_w);
- DECLARE_WRITE8_MEMBER(mcrmono_control_port_w);
- DECLARE_READ8_MEMBER(demoderm_ip1_r);
- DECLARE_READ8_MEMBER(demoderm_ip2_r);
- DECLARE_WRITE8_MEMBER(demoderm_op6_w);
- DECLARE_READ8_MEMBER(maxrpm_ip1_r);
- DECLARE_READ8_MEMBER(maxrpm_ip2_r);
- DECLARE_WRITE8_MEMBER(maxrpm_op5_w);
- DECLARE_WRITE8_MEMBER(maxrpm_op6_w);
- DECLARE_READ8_MEMBER(rampage_ip4_r);
- DECLARE_WRITE8_MEMBER(rampage_op6_w);
- DECLARE_READ8_MEMBER(powerdrv_ip2_r);
- DECLARE_WRITE8_MEMBER(powerdrv_op5_w);
- DECLARE_WRITE8_MEMBER(powerdrv_op6_w);
- DECLARE_READ8_MEMBER(stargrds_ip0_r);
- DECLARE_WRITE8_MEMBER(stargrds_op5_w);
- DECLARE_WRITE8_MEMBER(stargrds_op6_w);
- DECLARE_READ8_MEMBER(spyhunt_ip1_r);
- DECLARE_READ8_MEMBER(spyhunt_ip2_r);
- DECLARE_WRITE8_MEMBER(spyhunt_op4_w);
- DECLARE_READ8_MEMBER(turbotag_ip2_r);
- DECLARE_READ8_MEMBER(turbotag_kludge_r);
+ void mcrmono(machine_config &config);
+ void mono_tcs(machine_config &config);
+ void mcrscroll(machine_config &config);
+ void mono_sg(machine_config &config);
+
void init_crater();
void init_demoderm();
- void init_turbotag();
void init_powerdrv();
void init_stargrds();
- void init_maxrpm();
void init_rampage();
- void init_spyhunt();
void init_sarge();
+
+protected:
+ void mcr3_videoram_w(offs_t offset, uint8_t data);
+ void spyhunt_videoram_w(offs_t offset, uint8_t data);
+ void spyhunt_alpharam_w(offs_t offset, uint8_t data);
+ void spyhunt_scroll_value_w(offs_t offset, uint8_t data);
+ void mcrmono_control_port_w(uint8_t data);
+ uint8_t demoderm_ip1_r();
+ uint8_t demoderm_ip2_r();
+ void demoderm_op6_w(uint8_t data);
+ uint8_t rampage_ip4_r();
+ void rampage_op6_w(uint8_t data);
+ uint8_t powerdrv_ip2_r();
+ void powerdrv_op5_w(uint8_t data);
+ void powerdrv_op6_w(uint8_t data);
+ uint8_t stargrds_ip0_r();
+ void stargrds_op5_w(uint8_t data);
+ void stargrds_op6_w(uint8_t data);
+
DECLARE_VIDEO_START(spyhunt);
void spyhunt_palette(palette_device &palette) const;
uint32_t screen_update_mcr3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
uint32_t screen_update_spyhunt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- void mcrmono(machine_config &config);
- void maxrpm(machine_config &config);
- void mcrsc_csd(machine_config &config);
- void mono_tcs(machine_config &config);
- void mcrscroll(machine_config &config);
- void mono_sg(machine_config &config);
void mcrmono_map(address_map &map);
void mcrmono_portmap(address_map &map);
void spyhunt_map(address_map &map);
void spyhunt_portmap(address_map &map);
-protected:
+
virtual void machine_start() override { m_lamps.resolve(); }
virtual void video_start() override;
-private:
optional_shared_ptr<uint8_t> m_spyhunt_alpharam;
- optional_device<adc0844_device> m_maxrpm_adc;
- optional_device<cd4099_device> m_lamplatch;
required_device<screen_device> m_screen;
output_finder<3> m_lamps;
uint8_t m_latched_input;
- uint8_t m_maxrpm_adc_control;
- uint8_t m_maxrpm_last_shift;
- int8_t m_maxrpm_p1_shift;
- int8_t m_maxrpm_p2_shift;
uint8_t m_spyhunt_sprite_color_mask;
int16_t m_spyhunt_scroll_offset;
int16_t m_spyhunt_scrollx;
@@ -109,4 +90,53 @@ private:
void mcr_common_init();
};
+class maxrpm_state : public mcr3_state
+{
+public:
+ maxrpm_state(const machine_config &mconfig, device_type type, const char *tag)
+ : mcr3_state(mconfig, type, tag)
+ , m_maxrpm_adc(*this, "adc")
+ { }
+
+ void maxrpm(machine_config &config);
+
+ void init_maxrpm();
+
+private:
+ uint8_t maxrpm_ip1_r();
+ uint8_t maxrpm_ip2_r();
+ void maxrpm_op5_w(uint8_t data);
+ void maxrpm_op6_w(uint8_t data);
+
+ required_device<adc0844_device> m_maxrpm_adc;
+
+ uint8_t m_maxrpm_adc_control;
+ uint8_t m_maxrpm_last_shift;
+ int8_t m_maxrpm_p1_shift;
+ int8_t m_maxrpm_p2_shift;
+};
+
+class mcrsc_csd_state : public mcr3_state
+{
+public:
+ mcrsc_csd_state(const machine_config &mconfig, device_type type, const char *tag)
+ : mcr3_state(mconfig, type, tag)
+ , m_lamplatch(*this, "lamplatch")
+ { }
+
+ void mcrsc_csd(machine_config &config);
+
+ void init_spyhunt();
+ void init_turbotag();
+
+private:
+ uint8_t spyhunt_ip1_r();
+ uint8_t spyhunt_ip2_r();
+ void spyhunt_op4_w(uint8_t data);
+ uint8_t turbotag_ip2_r();
+ uint8_t turbotag_kludge_r();
+
+ optional_device<cd4099_device> m_lamplatch;
+};
+
#endif // MAME_INCLUDES_MCR3_H