diff options
author | Vas Crabb <vas@vastheman.com> | 2018-02-19 20:34:33 +1100 |
---|---|---|
committer | Vas Crabb <vas@vastheman.com> | 2018-02-19 20:34:33 +1100 |
commit | 8b1bc128e5568a713bc280d78623fcb3f7805b2a (patch) | |
tree | bc20f49cedae1f436469e6442cb3240b3882f37f /src/mame/includes/starshp1.h | |
parent | 1d31c19472f4c63955dcfba1f7e393bbe553afda (diff) |
backport lots of cleanup from WIP branch (nw)
Diffstat (limited to 'src/mame/includes/starshp1.h')
-rw-r--r-- | src/mame/includes/starshp1.h | 74 |
1 files changed, 43 insertions, 31 deletions
diff --git a/src/mame/includes/starshp1.h b/src/mame/includes/starshp1.h index 2006c8ba674..6f4784d2807 100644 --- a/src/mame/includes/starshp1.h +++ b/src/mame/includes/starshp1.h @@ -25,6 +25,10 @@ * Horizontal Visible Area 384 (0x180) 768 (0x300) * Horizontal Blanking Time 128 (0x080) 256 (0x100) */ +#ifndef MAME_INCLUDES_STARSHP1_H +#define MAME_INCLUDES_STARSHP1_H + +#pragma once #include "sound/discrete.h" #include "screen.h" @@ -44,8 +48,8 @@ class starshp1_state : public driver_device { public: - starshp1_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), + starshp1_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), m_playfield_ram(*this, "playfield_ram"), m_hpos_ram(*this, "hpos_ram"), m_vpos_ram(*this, "vpos_ram"), @@ -54,32 +58,14 @@ public: m_discrete(*this, "discrete"), m_gfxdecode(*this, "gfxdecode"), m_screen(*this, "screen"), - m_palette(*this, "palette") { } + m_palette(*this, "palette") + { } - int m_analog_in_select; - int m_attract; - required_shared_ptr<uint8_t> m_playfield_ram; - required_shared_ptr<uint8_t> m_hpos_ram; - required_shared_ptr<uint8_t> m_vpos_ram; - required_shared_ptr<uint8_t> m_obj_ram; - int m_ship_explode; - int m_ship_picture; - int m_ship_hoffset; - int m_ship_voffset; - int m_ship_size; - int m_circle_hpos; - int m_circle_vpos; - int m_circle_size; - int m_circle_mod; - int m_circle_kill; - int m_phasor; - int m_collision_latch; - int m_starfield_kill; - int m_mux; - int m_inverse; - std::unique_ptr<uint16_t[]> m_LSFR; - bitmap_ind16 m_helper; - tilemap_t *m_bg_tilemap; + DECLARE_CUSTOM_INPUT_MEMBER(starshp1_analog_r); + DECLARE_CUSTOM_INPUT_MEMBER(collision_latch_r); + void starshp1(machine_config &config); + +protected: DECLARE_WRITE8_MEMBER(starshp1_collision_reset_w); DECLARE_WRITE8_MEMBER(starshp1_analog_in_w); DECLARE_WRITE_LINE_MEMBER(ship_explode_w); @@ -93,8 +79,6 @@ public: DECLARE_WRITE8_MEMBER(starshp1_ssadd_w); DECLARE_WRITE8_MEMBER(starshp1_sspic_w); DECLARE_WRITE8_MEMBER(starshp1_playfield_w); - DECLARE_CUSTOM_INPUT_MEMBER(starshp1_analog_r); - DECLARE_CUSTOM_INPUT_MEMBER(collision_latch_r); DECLARE_WRITE_LINE_MEMBER(attract_w); DECLARE_WRITE_LINE_MEMBER(phasor_w); DECLARE_WRITE8_MEMBER(starshp1_analog_out_w); @@ -119,13 +103,39 @@ public: int spaceship_collision(bitmap_ind16 &bitmap, const rectangle &rect); int point_in_circle(int x, int y, int center_x, int center_y, int r); int circle_collision(const rectangle &rect); + void starshp1_map(address_map &map); + +private: + int m_analog_in_select; + int m_attract; + required_shared_ptr<uint8_t> m_playfield_ram; + required_shared_ptr<uint8_t> m_hpos_ram; + required_shared_ptr<uint8_t> m_vpos_ram; + required_shared_ptr<uint8_t> m_obj_ram; + int m_ship_explode; + int m_ship_picture; + int m_ship_hoffset; + int m_ship_voffset; + int m_ship_size; + int m_circle_hpos; + int m_circle_vpos; + int m_circle_size; + int m_circle_mod; + int m_circle_kill; + int m_phasor; + int m_collision_latch; + int m_starfield_kill; + int m_mux; + int m_inverse; + std::unique_ptr<uint16_t[]> m_LSFR; + bitmap_ind16 m_helper; + tilemap_t *m_bg_tilemap; + required_device<cpu_device> m_maincpu; required_device<discrete_device> m_discrete; required_device<gfxdecode_device> m_gfxdecode; required_device<screen_device> m_screen; required_device<palette_device> m_palette; - void starshp1(machine_config &config); - void starshp1_map(address_map &map); }; /*----------- defined in audio/starshp1.c -----------*/ @@ -143,3 +153,5 @@ DISCRETE_SOUND_EXTERN( starshp1 ); #define STARSHP1_KICKER NODE_08 #define STARSHP1_PHASOR_ON NODE_09 #define STARSHP1_ATTRACT NODE_10 + +#endif // MAME_INCLUDES_STARSHP1_H |