summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/includes
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/includes')
-rw-r--r--src/mame/includes/megadriv.h69
-rw-r--r--src/mame/includes/megadriv_acbl.h19
-rw-r--r--src/mame/includes/megadriv_rad.h48
3 files changed, 102 insertions, 34 deletions
diff --git a/src/mame/includes/megadriv.h b/src/mame/includes/megadriv.h
index c8db99abb95..0cd19ff39bc 100644
--- a/src/mame/includes/megadriv.h
+++ b/src/mame/includes/megadriv.h
@@ -52,6 +52,7 @@ public:
m_scan_timer(*this, "md_scan_timer"),
m_vdp(*this,"gen_vdp"),
m_megadrive_ram(*this,"megadrive_ram"),
+ m_screen(*this,"megadriv"),
m_io_reset(*this, "RESET"),
m_megadrive_io_read_data_port_ptr(*this),
m_megadrive_io_write_data_port_ptr(*this)
@@ -63,6 +64,7 @@ public:
optional_device<timer_device> m_scan_timer;
required_device<sega315_5313_device> m_vdp;
optional_shared_ptr<uint16_t> m_megadrive_ram;
+ optional_device<screen_device> m_screen;
optional_ioport m_io_reset;
ioport_port *m_io_pad_3b[4];
@@ -129,8 +131,7 @@ public:
void megadriv_stop_scanline_timer();
- DECLARE_MACHINE_START( megadriv );
- DECLARE_MACHINE_RESET( megadriv );
+
DECLARE_VIDEO_START( megadriv );
uint32_t screen_update_megadriv(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
DECLARE_WRITE_LINE_MEMBER(screen_vblank_megadriv);
@@ -143,11 +144,16 @@ public:
void md_pal(machine_config &config);
void md2_pal(machine_config &config);
void md_bootleg(machine_config &config);
+
void dcat16_megadriv_base(machine_config &config);
void dcat16_megadriv_map(address_map &map);
void megadriv_map(address_map &map);
void megadriv_z80_io_map(address_map &map);
void megadriv_z80_map(address_map &map);
+
+protected:
+ virtual void machine_start() override;
+ virtual void machine_reset() override;
};
class md_cons_state : public md_base_state
@@ -178,11 +184,6 @@ public:
uint8_t mess_md_io_read_data_port(offs_t offset);
void mess_md_io_write_data_port(offs_t offset, uint16_t data);
- DECLARE_MACHINE_START( md_common ); // setup ioport_port
- DECLARE_MACHINE_START( ms_megadriv ); // setup ioport_port + install cartslot handlers
- DECLARE_MACHINE_START( ms_megacd ); // setup ioport_port + dma delay for cd
- DECLARE_MACHINE_RESET( ms_megadriv );
-
DECLARE_WRITE_LINE_MEMBER(screen_vblank_console);
DECLARE_DEVICE_IMAGE_LOAD_MEMBER( _32x_cart );
@@ -195,24 +196,56 @@ public:
void install_tmss();
uint16_t tmss_r(offs_t offset);
void tmss_swap_w(uint16_t data);
- void genesis_32x_scd(machine_config &config);
- void mdj_32x_scd(machine_config &config);
- void ms_megadpal(machine_config &config);
void dcat16_megadriv_base(machine_config &config);
void dcat16_megadriv(machine_config &config);
- void md_32x_scd(machine_config &config);
+
+ void md_32x(machine_config &config);
+ void genesis_32x(machine_config &config);
void mdj_32x(machine_config &config);
+
+protected:
+ virtual void machine_start() override;
+ virtual void machine_reset() override;
+};
+
+class md_cons_slot_state : public md_cons_state
+{
+public:
+ md_cons_slot_state(const machine_config &mconfig, device_type type, const char *tag) :
+ md_cons_state(mconfig, type, tag)
+ { }
+
+ void ms_megadpal(machine_config &config);
void ms_megadriv(machine_config &config);
void ms_megadriv2(machine_config &config);
- void mdj_scd(machine_config &config);
- void md2j_scd(machine_config &config);
- void md_32x(machine_config &config);
- void genesis_32x(machine_config &config);
- void md_scd(machine_config &config);
- void md2_scd(machine_config &config);
+
+ void genesis_tmss(machine_config &config);
+
+
+protected:
+ virtual void machine_start() override;
+};
+
+class md_cons_cd_state : public md_cons_state
+{
+public:
+ md_cons_cd_state(const machine_config &mconfig, device_type type, const char *tag) :
+ md_cons_state(mconfig, type, tag)
+ { }
+
void genesis_scd(machine_config &config);
void genesis2_scd(machine_config &config);
- void genesis_tmss(machine_config &config);
+ void md_scd(machine_config &config);
+ void md2_scd(machine_config &config);
+ void mdj_scd(machine_config &config);
+
+ void mdj_32x_scd(machine_config &config);
+ void md2j_scd(machine_config &config);
+ void genesis_32x_scd(machine_config &config);
+ void md_32x_scd(machine_config &config);
+
+protected:
+ virtual void machine_start() override;
};
#endif // MAME_INCLUDES_MEGADRIV_H
diff --git a/src/mame/includes/megadriv_acbl.h b/src/mame/includes/megadriv_acbl.h
index 990e49e4989..011758a563f 100644
--- a/src/mame/includes/megadriv_acbl.h
+++ b/src/mame/includes/megadriv_acbl.h
@@ -11,7 +11,6 @@ public:
: md_base_state(mconfig, type, tag) { m_protcount = 0;}
void megadrvb(machine_config &config);
- void megadrvb_6b(machine_config &config);
void md_bootleg(machine_config &config);
void puckpkmn(machine_config &config);
void jzth(machine_config &config);
@@ -47,9 +46,6 @@ private:
uint16_t puckpkmna_70001c_r();
uint16_t puckpkmna_4b2476_r();
- DECLARE_MACHINE_START(md_bootleg) { MACHINE_START_CALL_MEMBER(megadriv); m_vdp->stop_timers(); }
- DECLARE_MACHINE_START(md_6button);
-
void jzth_map(address_map &map);
void md_bootleg_map(address_map &map);
void puckpkmn_map(address_map &map);
@@ -61,4 +57,19 @@ private:
int m_protcount;
};
+class md_boot_6button_state : public md_boot_state
+{
+public:
+ md_boot_6button_state(const machine_config& mconfig, device_type type, const char* tag)
+ : md_boot_state(mconfig, type, tag)
+ {
+ }
+
+ void megadrvb_6b(machine_config &config);
+
+protected:
+ virtual void machine_start() override;
+
+};
+
#endif // MAME_INCLUDES_MEGADRIV_ACBL_H
diff --git a/src/mame/includes/megadriv_rad.h b/src/mame/includes/megadriv_rad.h
index 9dd0e0860f7..f931faea31b 100644
--- a/src/mame/includes/megadriv_rad.h
+++ b/src/mame/includes/megadriv_rad.h
@@ -13,25 +13,49 @@ public:
m_rom(*this, "maincpu")
{}
- void init_megadriv_radica_6button_pal();
- void init_megadriv_radica_6button_ntsc();
-
- DECLARE_MACHINE_START(megadriv_radica_6button);
- DECLARE_MACHINE_START(megadriv_radica_3button);
- DECLARE_MACHINE_RESET(megadriv_radica);
uint16_t read(offs_t offset);
uint16_t read_a13(offs_t offset);
- void megadriv_radica_6button_ntsc(machine_config &config);
- void megadriv_radica_6button_pal(machine_config &config);
- void megadriv_radica_3button_ntsc(machine_config &config);
- void megadriv_radica_3button_pal(machine_config &config);
-
void megadriv_radica_map(address_map &map);
-private:
+
+protected:
int m_bank;
+
+private:
required_region_ptr<uint16_t> m_rom;
};
+class megadriv_radica_3button_state : public megadriv_radica_state
+{
+public:
+ megadriv_radica_3button_state(const machine_config& mconfig, device_type type, const char* tag)
+ : megadriv_radica_state(mconfig, type, tag)
+ {}
+public:
+ void megadriv_radica_3button_ntsc(machine_config &config);
+ void megadriv_radica_3button_pal(machine_config &config);
+
+protected:
+ virtual void machine_start() override;
+ virtual void machine_reset() override;
+};
+
+class megadriv_radica_6button_state : public megadriv_radica_3button_state
+{
+public:
+ void megadriv_radica_6button_ntsc(machine_config &config);
+ void megadriv_radica_6button_pal(machine_config &config);
+
+ void init_megadriv_radica_6button_pal();
+ void init_megadriv_radica_6button_ntsc();
+
+public:
+ megadriv_radica_6button_state(const machine_config& mconfig, device_type type, const char* tag)
+ : megadriv_radica_3button_state(mconfig, type, tag)
+ {}
+ virtual void machine_start() override;
+};
+
+
#endif // MAME_INCLUDES_MEGADRIV_RAD_H