summaryrefslogtreecommitdiffstats
path: root/src/mame/includes/cvs.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/includes/cvs.h')
-rw-r--r--src/mame/includes/cvs.h146
1 files changed, 75 insertions, 71 deletions
diff --git a/src/mame/includes/cvs.h b/src/mame/includes/cvs.h
index b36f0b89159..2fe961b5603 100644
--- a/src/mame/includes/cvs.h
+++ b/src/mame/includes/cvs.h
@@ -25,76 +25,28 @@ class cvs_state : public driver_device
{
public:
cvs_state(const machine_config &mconfig, device_type type, const char *tag)
- : driver_device(mconfig, type, tag),
- m_video_ram(*this, "video_ram"),
- m_bullet_ram(*this, "bullet_ram"),
- m_cvs_4_bit_dac_data(*this, "4bit_dac"),
- m_tms5110_ctl_data(*this, "tms5110_ctl"),
- m_dac3_state(*this, "dac3_state"),
- m_maincpu(*this, "maincpu"),
- m_audiocpu(*this, "audiocpu"),
- m_speechcpu(*this, "speechcpu"),
- m_dac2(*this, "dac2"),
- m_dac3(*this, "dac3"),
- m_tms5110(*this, "tms"),
- m_s2636_0(*this, "s2636_0"),
- m_s2636_1(*this, "s2636_1"),
- m_s2636_2(*this, "s2636_2"),
- m_gfxdecode(*this, "gfxdecode"),
- m_screen(*this, "screen"),
- m_palette(*this, "palette"),
- m_soundlatch(*this, "soundlatch")
- {
- }
+ : driver_device(mconfig, type, tag)
+ , m_video_ram(*this, "video_ram")
+ , m_bullet_ram(*this, "bullet_ram")
+ , m_cvs_4_bit_dac_data(*this, "4bit_dac")
+ , m_tms5110_ctl_data(*this, "tms5110_ctl")
+ , m_dac3_state(*this, "dac3_state")
+ , m_maincpu(*this, "maincpu")
+ , m_audiocpu(*this, "audiocpu")
+ , m_speechcpu(*this, "speechcpu")
+ , m_dac2(*this, "dac2")
+ , m_dac3(*this, "dac3")
+ , m_tms5110(*this, "tms")
+ , m_s2636_0(*this, "s2636_0")
+ , m_s2636_1(*this, "s2636_1")
+ , m_s2636_2(*this, "s2636_2")
+ , m_gfxdecode(*this, "gfxdecode")
+ , m_screen(*this, "screen")
+ , m_palette(*this, "palette")
+ , m_soundlatch(*this, "soundlatch")
+ , m_lamp(*this, "lamp%u", 0U)
+ { }
- /* memory pointers */
- required_shared_ptr<uint8_t> m_video_ram;
- required_shared_ptr<uint8_t> m_bullet_ram;
- optional_shared_ptr<uint8_t> m_cvs_4_bit_dac_data;
- optional_shared_ptr<uint8_t> m_tms5110_ctl_data;
- optional_shared_ptr<uint8_t> m_dac3_state;
-
- /* video-related */
- struct cvs_star m_stars[CVS_MAX_STARS];
- bitmap_ind16 m_collision_background;
- bitmap_ind16 m_background_bitmap;
- bitmap_ind16 m_scrolled_collision_background;
- int m_collision_register;
- int m_total_stars;
- int m_stars_on;
- uint8_t m_scroll_reg;
- int m_stars_scroll;
-
- /* misc */
- int m_s2650_flag;
- emu_timer *m_cvs_393hz_timer;
- uint8_t m_cvs_393hz_clock;
-
- uint8_t m_character_banking_mode;
- uint16_t m_character_ram_page_start;
- uint16_t m_speech_rom_bit_address;
-
- /* devices */
- required_device<cpu_device> m_maincpu;
- optional_device<cpu_device> m_audiocpu;
- optional_device<cpu_device> m_speechcpu;
- optional_device<dac_byte_interface> m_dac2;
- optional_device<dac_bit_interface> m_dac3;
- optional_device<tms5110_device> m_tms5110;
- optional_device<s2636_device> m_s2636_0;
- optional_device<s2636_device> m_s2636_1;
- optional_device<s2636_device> m_s2636_2;
- required_device<gfxdecode_device> m_gfxdecode;
- required_device<screen_device> m_screen;
- required_device<palette_device> m_palette;
- optional_device<generic_latch_8_device> m_soundlatch;
-
- /* memory */
- uint8_t m_color_ram[0x400];
- uint8_t m_palette_ram[0x10];
- uint8_t m_character_ram[3 * 0x800]; /* only half is used, but
- by allocating twice the amount,
- we can use the same gfx_layout */
DECLARE_READ_LINE_MEMBER(speech_rom_read_bit);
DECLARE_WRITE_LINE_MEMBER(write_s2650_flag);
DECLARE_WRITE_LINE_MEMBER(cvs_slave_cpu_interrupt);
@@ -127,8 +79,6 @@ public:
void init_hero();
void init_superbik();
void init_hunchbaka();
- DECLARE_MACHINE_START(cvs);
- DECLARE_MACHINE_RESET(cvs);
DECLARE_VIDEO_START(cvs);
DECLARE_PALETTE_INIT(cvs);
uint32_t screen_update_cvs(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
@@ -145,4 +95,58 @@ public:
void cvs_main_cpu_io_map(address_map &map);
void cvs_main_cpu_map(address_map &map);
void cvs_speech_cpu_map(address_map &map);
+
+protected:
+ virtual void machine_start() override;
+ virtual void machine_reset() override;
+
+ /* memory pointers */
+ required_shared_ptr<uint8_t> m_video_ram;
+ required_shared_ptr<uint8_t> m_bullet_ram;
+ optional_shared_ptr<uint8_t> m_cvs_4_bit_dac_data;
+ optional_shared_ptr<uint8_t> m_tms5110_ctl_data;
+ optional_shared_ptr<uint8_t> m_dac3_state;
+
+ /* video-related */
+ struct cvs_star m_stars[CVS_MAX_STARS];
+ bitmap_ind16 m_collision_background;
+ bitmap_ind16 m_background_bitmap;
+ bitmap_ind16 m_scrolled_collision_background;
+ int m_collision_register;
+ int m_total_stars;
+ int m_stars_on;
+ uint8_t m_scroll_reg;
+ int m_stars_scroll;
+
+ /* misc */
+ int m_s2650_flag;
+ emu_timer *m_cvs_393hz_timer;
+ uint8_t m_cvs_393hz_clock;
+
+ uint8_t m_character_banking_mode;
+ uint16_t m_character_ram_page_start;
+ uint16_t m_speech_rom_bit_address;
+
+ /* devices */
+ required_device<cpu_device> m_maincpu;
+ optional_device<cpu_device> m_audiocpu;
+ optional_device<cpu_device> m_speechcpu;
+ optional_device<dac_byte_interface> m_dac2;
+ optional_device<dac_bit_interface> m_dac3;
+ optional_device<tms5110_device> m_tms5110;
+ optional_device<s2636_device> m_s2636_0;
+ optional_device<s2636_device> m_s2636_1;
+ optional_device<s2636_device> m_s2636_2;
+ required_device<gfxdecode_device> m_gfxdecode;
+ required_device<screen_device> m_screen;
+ required_device<palette_device> m_palette;
+ optional_device<generic_latch_8_device> m_soundlatch;
+ output_finder<3> m_lamp;
+
+ /* memory */
+ uint8_t m_color_ram[0x400];
+ uint8_t m_palette_ram[0x10];
+ uint8_t m_character_ram[3 * 0x800]; /* only half is used, but
+ by allocating twice the amount,
+ we can use the same gfx_layout */
};