summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author mooglyguy <therealmogminer@gmail.com>2018-05-16 20:10:22 +0200
committer mooglyguy <therealmogminer@gmail.com>2018-05-28 09:32:16 +0200
commitad82e8b4dc7e33eaf38c6e3d8a4ca5e27b0a07aa (patch)
treef7b8a25c5e41ffb4ff193ec64cab048c46863436
parent6ef044df51685957a0e5af2501ff5b1a030028c7 (diff)
Assorted cleanup involving driver_init on a handful of drivers, nw
-rw-r--r--src/mame/drivers/1942.cpp82
-rw-r--r--src/mame/drivers/2mindril.cpp2
-rw-r--r--src/mame/drivers/3do.cpp2
-rw-r--r--src/mame/drivers/40love.cpp48
-rw-r--r--src/mame/drivers/4enraya.cpp22
-rw-r--r--src/mame/drivers/4roses.cpp48
-rw-r--r--src/mame/drivers/taito_f3.cpp8
-rw-r--r--src/mame/includes/1942.h113
-rw-r--r--src/mame/includes/3do.h8
-rw-r--r--src/mame/includes/40love.h133
-rw-r--r--src/mame/includes/4enraya.h49
-rw-r--r--src/mame/includes/taito_f3.h7
-rw-r--r--src/mame/machine/3do.cpp2
-rw-r--r--src/mame/video/1942.cpp50
-rw-r--r--src/mame/video/taito_f3.cpp2
15 files changed, 291 insertions, 285 deletions
diff --git a/src/mame/drivers/1942.cpp b/src/mame/drivers/1942.cpp
index c9726cb027d..2a2bf22ac6a 100644
--- a/src/mame/drivers/1942.cpp
+++ b/src/mame/drivers/1942.cpp
@@ -161,12 +161,12 @@ static NETLIST_START(nl_1942)
NETLIST_END()
-WRITE8_MEMBER(_1942_state::c1942_bankswitch_w)
+WRITE8_MEMBER(_1942_state::_1942_bankswitch_w)
{
membank("bank1")->set_entry(data & 0x03);
}
-TIMER_DEVICE_CALLBACK_MEMBER(_1942_state::c1942_scanline)
+TIMER_DEVICE_CALLBACK_MEMBER(_1942_state::_1942_scanline)
{
int scanline = param;
@@ -180,7 +180,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(_1942_state::c1942_scanline)
-void _1942_state::c1942_map(address_map &map)
+void _1942_state::_1942_map(address_map &map)
{
map(0x0000, 0x7fff).rom();
map(0x8000, 0xbfff).bankr("bank1");
@@ -190,22 +190,22 @@ void _1942_state::c1942_map(address_map &map)
map(0xc003, 0xc003).portr("DSWA");
map(0xc004, 0xc004).portr("DSWB");
map(0xc800, 0xc800).w(m_soundlatch, FUNC(generic_latch_8_device::write));
- map(0xc802, 0xc803).w(this, FUNC(_1942_state::c1942_scroll_w));
- map(0xc804, 0xc804).w(this, FUNC(_1942_state::c1942_c804_w));
- map(0xc805, 0xc805).w(this, FUNC(_1942_state::c1942_palette_bank_w));
- map(0xc806, 0xc806).w(this, FUNC(_1942_state::c1942_bankswitch_w));
+ map(0xc802, 0xc803).w(this, FUNC(_1942_state::_1942_scroll_w));
+ map(0xc804, 0xc804).w(this, FUNC(_1942_state::_1942_c804_w));
+ map(0xc805, 0xc805).w(this, FUNC(_1942_state::_1942_palette_bank_w));
+ map(0xc806, 0xc806).w(this, FUNC(_1942_state::_1942_bankswitch_w));
map(0xcc00, 0xcc7f).ram().share("spriteram");
- map(0xd000, 0xd7ff).ram().w(this, FUNC(_1942_state::c1942_fgvideoram_w)).share("fg_videoram");
- map(0xd800, 0xdbff).ram().w(this, FUNC(_1942_state::c1942_bgvideoram_w)).share("bg_videoram");
+ map(0xd000, 0xd7ff).ram().w(this, FUNC(_1942_state::_1942_fgvideoram_w)).share("fg_videoram");
+ map(0xd800, 0xdbff).ram().w(this, FUNC(_1942_state::_1942_bgvideoram_w)).share("bg_videoram");
map(0xe000, 0xefff).ram();
}
-WRITE8_MEMBER(_1942_state::c1942p_f600_w)
+WRITE8_MEMBER(_1942p_state::_1942p_f600_w)
{
-// printf("c1942p_f600_w %02x\n", data);
+// printf("_1942p_f600_w %02x\n", data);
}
-WRITE8_MEMBER(_1942_state::c1942p_palette_w)
+WRITE8_MEMBER(_1942p_state::_1942p_palette_w)
{
m_protopal[offset] = data;
@@ -216,27 +216,27 @@ WRITE8_MEMBER(_1942_state::c1942p_palette_w)
m_palette->set_indirect_color(offset, rgb_t(r<<5,g<<5,b<<6));
}
-void _1942_state::c1942p_map(address_map &map)
+void _1942p_state::_1942p_map(address_map &map)
{
map(0x0000, 0x7fff).rom();
map(0x8000, 0xbfff).bankr("bank1");
- map(0xd000, 0xd7ff).ram().w(this, FUNC(_1942_state::c1942_fgvideoram_w)).share("fg_videoram");
- map(0xd800, 0xdbff).ram().w(this, FUNC(_1942_state::c1942_bgvideoram_w)).share("bg_videoram");
+ map(0xd000, 0xd7ff).ram().w(this, FUNC(_1942_state::_1942_fgvideoram_w)).share("fg_videoram");
+ map(0xd800, 0xdbff).ram().w(this, FUNC(_1942_state::_1942_bgvideoram_w)).share("bg_videoram");
map(0xe000, 0xefff).ram();
map(0xce00, 0xcfff).ram().share("spriteram");
- map(0xdc02, 0xdc03).w(this, FUNC(_1942_state::c1942_scroll_w));
- map(0xc804, 0xc804).w(this, FUNC(_1942_state::c1942_c804_w));
- map(0xc805, 0xc805).w(this, FUNC(_1942_state::c1942_palette_bank_w));
+ map(0xdc02, 0xdc03).w(this, FUNC(_1942_state::_1942_scroll_w));
+ map(0xc804, 0xc804).w(this, FUNC(_1942_state::_1942_c804_w));
+ map(0xc805, 0xc805).w(this, FUNC(_1942_state::_1942_palette_bank_w));
- map(0xf000, 0xf3ff).ram().w(this, FUNC(_1942_state::c1942p_palette_w)).share("protopal");
+ map(0xf000, 0xf3ff).ram().w(this, FUNC(_1942p_state::_1942p_palette_w)).share("protopal");
- map(0xf400, 0xf400).w(this, FUNC(_1942_state::c1942_bankswitch_w));
+ map(0xf400, 0xf400).w(this, FUNC(_1942_state::_1942_bankswitch_w));
map(0xf500, 0xf500).w(m_soundlatch, FUNC(generic_latch_8_device::write));
- map(0xf600, 0xf600).w(this, FUNC(_1942_state::c1942p_f600_w));
+ map(0xf600, 0xf600).w(this, FUNC(_1942p_state::_1942p_f600_w));
map(0xf700, 0xf700).portr("DSWA");
map(0xf701, 0xf701).portr("SYSTEM");
@@ -246,14 +246,14 @@ void _1942_state::c1942p_map(address_map &map)
}
-void _1942_state::c1942p_sound_map(address_map &map)
+void _1942p_state::_1942p_sound_map(address_map &map)
{
map(0x0000, 0x3fff).rom();
map(0x4000, 0x47ff).ram();
map(0xc000, 0xc000).r(m_soundlatch, FUNC(generic_latch_8_device::read));
}
-void _1942_state::c1942p_sound_io(address_map &map)
+void _1942p_state::_1942p_sound_io(address_map &map)
{
map.global_mask(0xff);
map(0x0000, 0x0000).nopw();
@@ -563,8 +563,8 @@ MACHINE_CONFIG_START(_1942_state::_1942)
/* basic machine hardware */
MCFG_DEVICE_ADD("maincpu", Z80, MAIN_CPU_CLOCK) /* 4 MHz ??? */
- MCFG_DEVICE_PROGRAM_MAP(c1942_map)
- MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", _1942_state, c1942_scanline, "screen", 0, 1)
+ MCFG_DEVICE_PROGRAM_MAP(_1942_map)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", _1942_state, _1942_scanline, "screen", 0, 1)
MCFG_DEVICE_ADD("audiocpu", Z80, SOUND_CPU_CLOCK) /* 3 MHz ??? */
MCFG_DEVICE_PROGRAM_MAP(sound_map)
@@ -583,7 +583,7 @@ MACHINE_CONFIG_START(_1942_state::_1942)
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
MCFG_SCREEN_SIZE(32*8, 32*8)
MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
- MCFG_SCREEN_UPDATE_DRIVER(_1942_state, screen_update_1942)
+ MCFG_SCREEN_UPDATE_DRIVER(_1942_state, screen_update)
MCFG_SCREEN_PALETTE("palette")
/* sound hardware */
@@ -627,16 +627,16 @@ MACHINE_CONFIG_START(_1942_state::_1942)
MACHINE_CONFIG_END
-MACHINE_CONFIG_START(_1942_state::_1942p)
+MACHINE_CONFIG_START(_1942p_state::_1942p)
/* basic machine hardware */
MCFG_DEVICE_ADD("maincpu", Z80, MAIN_CPU_CLOCK_1942P) /* 4 MHz - verified on PCB */
- MCFG_DEVICE_PROGRAM_MAP(c1942p_map)
+ MCFG_DEVICE_PROGRAM_MAP(_1942p_map)
MCFG_DEVICE_VBLANK_INT_DRIVER("screen", _1942_state, irq0_line_hold) // note, powerups won't move down the screen with the original '1942' logic.
MCFG_DEVICE_ADD("audiocpu", Z80, SOUND_CPU_CLOCK_1942P) /* 4 MHz - verified on PCB */
- MCFG_DEVICE_PROGRAM_MAP(c1942p_sound_map)
- MCFG_DEVICE_IO_MAP(c1942p_sound_io)
+ MCFG_DEVICE_PROGRAM_MAP(_1942p_sound_map)
+ MCFG_DEVICE_IO_MAP(_1942p_sound_io)
MCFG_DEVICE_PERIODIC_INT_DRIVER(_1942_state, irq0_line_hold, 4*60)
@@ -644,16 +644,14 @@ MACHINE_CONFIG_START(_1942_state::_1942p)
MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_1942p)
MCFG_PALETTE_ADD("palette", 0x500)
MCFG_PALETTE_INDIRECT_ENTRIES(0x400)
- MCFG_PALETTE_INIT_OWNER(_1942_state, 1942p)
-
- MCFG_VIDEO_START_OVERRIDE(_1942_state,c1942p)
+ MCFG_PALETTE_INIT_OWNER(_1942p_state, 1942p)
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
MCFG_SCREEN_SIZE(32*8, 32*8)
MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
- MCFG_SCREEN_UPDATE_DRIVER(_1942_state, screen_update_1942p)
+ MCFG_SCREEN_UPDATE_DRIVER(_1942p_state, screen_update)
MCFG_SCREEN_PALETTE("palette")
@@ -951,17 +949,17 @@ ROM_START( 1942p )
ROM_END
-void _1942_state::init_1942()
+void _1942_state::driver_init()
{
uint8_t *ROM = memregion("maincpu")->base();
membank("bank1")->configure_entries(0, 4, &ROM[0x10000], 0x4000);
}
-GAME( 1984, 1942, 0, _1942, 1942, _1942_state, init_1942, ROT270, "Capcom", "1942 (Revision B)", MACHINE_SUPPORTS_SAVE )
-GAME( 1984, 1942a, 1942, _1942, 1942, _1942_state, init_1942, ROT270, "Capcom", "1942 (Revision A)", MACHINE_SUPPORTS_SAVE )
-GAME( 1984, 1942abl, 1942, _1942, 1942, _1942_state, init_1942, ROT270, "bootleg", "1942 (Revision A, bootleg)", MACHINE_SUPPORTS_SAVE ) // data is the same as 1942a set, different rom format
-GAME( 1991, 1942h, 1942, _1942, 1942, _1942_state, init_1942, ROT270, "hack (Two Bit Score)", "Supercharger 1942", MACHINE_SUPPORTS_SAVE )
-GAME( 1984, 1942b, 1942, _1942, 1942, _1942_state, init_1942, ROT270, "Capcom", "1942 (First Version)", MACHINE_SUPPORTS_SAVE )
-GAME( 1985, 1942w, 1942, _1942, 1942, _1942_state, init_1942, ROT270, "Capcom (Williams Electronics license)", "1942 (Williams Electronics license)", MACHINE_SUPPORTS_SAVE ) /* Based on 1942 (Revision B) */
-GAME( 1984, 1942p, 1942, _1942p,1942p,_1942_state, init_1942, ROT270, "bootleg", "1942 (Tecfri PCB, bootleg?)", MACHINE_SUPPORTS_SAVE )
+GAME( 1984, 1942, 0, _1942, 1942, _1942_state, driver_init, ROT270, "Capcom", "1942 (Revision B)", MACHINE_SUPPORTS_SAVE )
+GAME( 1984, 1942a, 1942, _1942, 1942, _1942_state, driver_init, ROT270, "Capcom", "1942 (Revision A)", MACHINE_SUPPORTS_SAVE )
+GAME( 1984, 1942abl, 1942, _1942, 1942, _1942_state, driver_init, ROT270, "bootleg", "1942 (Revision A, bootleg)", MACHINE_SUPPORTS_SAVE ) // data is the same as 1942a set, different rom format
+GAME( 1991, 1942h, 1942, _1942, 1942, _1942_state, driver_init, ROT270, "hack (Two Bit Score)", "Supercharger 1942", MACHINE_SUPPORTS_SAVE )
+GAME( 1984, 1942b, 1942, _1942, 1942, _1942_state, driver_init, ROT270, "Capcom", "1942 (First Version)", MACHINE_SUPPORTS_SAVE )
+GAME( 1985, 1942w, 1942, _1942, 1942, _1942_state, driver_init, ROT270, "Capcom (Williams Electronics license)", "1942 (Williams Electronics license)", MACHINE_SUPPORTS_SAVE ) /* Based on 1942 (Revision B) */
+GAME( 1984, 1942p, 1942, _1942p, 1942p, _1942p_state, driver_init, ROT270, "bootleg", "1942 (Tecfri PCB, bootleg?)", MACHINE_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/2mindril.cpp b/src/mame/drivers/2mindril.cpp
index a5496117458..9ba004e5938 100644
--- a/src/mame/drivers/2mindril.cpp
+++ b/src/mame/drivers/2mindril.cpp
@@ -382,8 +382,6 @@ MACHINE_CONFIG_START(_2mindril_state::drill)
MCFG_PALETTE_ADD("palette", 0x2000)
MCFG_PALETTE_FORMAT(RRRRGGGGBBBBRGBx)
- MCFG_VIDEO_START_OVERRIDE(_2mindril_state,f3)
-
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
diff --git a/src/mame/drivers/3do.cpp b/src/mame/drivers/3do.cpp
index 74e15f4bf0e..b7ba59548f1 100644
--- a/src/mame/drivers/3do.cpp
+++ b/src/mame/drivers/3do.cpp
@@ -165,8 +165,6 @@ MACHINE_CONFIG_START(_3do_state::_3do)
MCFG_TIMER_DRIVER_ADD_PERIODIC("timer_x16", _3do_state, timer_x16_cb, attotime::from_hz(12000)) // TODO: timing
- MCFG_VIDEO_START_OVERRIDE(_3do_state, _3do )
-
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_RAW_PARAMS( X2_CLOCK_NTSC / 2, 1592, 254, 1534, 263, 22, 262 )
MCFG_SCREEN_UPDATE_DRIVER(_3do_state, screen_update__3do)
diff --git a/src/mame/drivers/40love.cpp b/src/mame/drivers/40love.cpp
index f59a4b1edc9..c4f347ea1b4 100644
--- a/src/mame/drivers/40love.cpp
+++ b/src/mame/drivers/40love.cpp
@@ -306,7 +306,7 @@ READ8_MEMBER(fortyl_state::pix2_r)
/***************************************************************************/
-void fortyl_state::init_undoukai()
+void fortyl_state::driver_init()
{
uint8_t *ROM = memregion("maincpu")->base();
membank("bank1")->configure_entries(0, 2, &ROM[0x10000], 0x2000);
@@ -317,29 +317,6 @@ void fortyl_state::init_undoukai()
m_pix_color[3] = 0x1ec;
}
-void fortyl_state::init_40love()
-{
- uint8_t *ROM = memregion("maincpu")->base();
- membank("bank1")->configure_entries(0, 2, &ROM[0x10000], 0x2000);
-
- #if 0
- /* character ROM hack
- to show a white line on the opponent side */
-
- uint8_t *ROM = memregion("gfx2")->base();
- int adr = 0x10 * 0x022b;
- ROM[adr + 0x000a] = 0x00;
- ROM[adr + 0x000b] = 0x00;
- ROM[adr + 0x400a] = 0x00;
- ROM[adr + 0x400b] = 0x00;
- #endif
-
- m_pix_color[0] = 0x000;
- m_pix_color[1] = 0x1e3;
- m_pix_color[2] = 0x16c;
- m_pix_color[3] = 0x1ec;
-}
-
/***************************************************************************/
READ8_MEMBER(fortyl_state::snd_flag_r)
@@ -664,7 +641,7 @@ GFXDECODE_END
/*******************************************************************************/
-MACHINE_START_MEMBER(fortyl_state,40love)
+void fortyl_state::machine_start()
{
/* video */
save_item(NAME(m_pix1));
@@ -680,10 +657,8 @@ MACHINE_START_MEMBER(fortyl_state,40love)
}
-MACHINE_RESET_MEMBER(fortyl_state,common)
+void fortyl_state::machine_reset()
{
- //MACHINE_RESET_CALL_MEMBER(ta7630);
-
/* video */
m_pix1 = 0;
m_pix2[0] = 0;
@@ -697,11 +672,6 @@ MACHINE_RESET_MEMBER(fortyl_state,common)
m_snd_ctrl3 = 0;
}
-MACHINE_RESET_MEMBER(fortyl_state,40love)
-{
- MACHINE_RESET_CALL_MEMBER(common);
-}
-
MACHINE_CONFIG_START(fortyl_state::_40love)
/* basic machine hardware */
@@ -724,8 +694,6 @@ MACHINE_CONFIG_START(fortyl_state::_40love)
MCFG_DEVICE_ADD("bmcu", TAITO68705_MCU, 18432000/6) /* OK */
MCFG_QUANTUM_TIME(attotime::from_hz(6000)) /* high interleave to ensure proper synchronization of CPUs */
- MCFG_MACHINE_START_OVERRIDE(fortyl_state,40love)
- MCFG_MACHINE_RESET_OVERRIDE(fortyl_state,40love)
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -790,8 +758,6 @@ MACHINE_CONFIG_START(fortyl_state::undoukai)
MCFG_DEVICE_ADD("bmcu", TAITO68705_MCU, 18432000/6)
MCFG_QUANTUM_TIME(attotime::from_hz(6000))
- MCFG_MACHINE_START_OVERRIDE(fortyl_state,40love)
- MCFG_MACHINE_RESET_OVERRIDE(fortyl_state,40love) /* init machine */
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -986,7 +952,7 @@ ROM_START( undoukai )
ROM_LOAD( "a17-18.23v", 0x0c00, 0x0400, CRC(3023a1da) SHA1(08ce4c6e99d04b358d66f0588852311d07183619) ) /* ??? */
ROM_END
-GAME( 1984, 40love, 0, _40love, 40love, fortyl_state, init_40love, ROT0, "Taito Corporation", "Forty-Love (World)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_GRAPHICS )
-GAME( 1984, 40lovej, 40love, _40love, 40love, fortyl_state, init_40love, ROT0, "Taito Corporation", "Forty-Love (Japan)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_GRAPHICS ) // several ROMs needs double checking
-GAME( 1984, fieldday, 0, undoukai, undoukai, fortyl_state, init_undoukai, ROT0, "Taito Corporation", "Field Day", MACHINE_SUPPORTS_SAVE )
-GAME( 1984, undoukai, fieldday, undoukai, undoukai, fortyl_state, init_undoukai, ROT0, "Taito Corporation", "The Undoukai (Japan)", MACHINE_SUPPORTS_SAVE )
+GAME( 1984, 40love, 0, _40love, 40love, fortyl_state, driver_init, ROT0, "Taito Corporation", "Forty-Love (World)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_GRAPHICS )
+GAME( 1984, 40lovej, 40love, _40love, 40love, fortyl_state, driver_init, ROT0, "Taito Corporation", "Forty-Love (Japan)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_GRAPHICS ) // several ROMs needs double checking
+GAME( 1984, fieldday, 0, undoukai, undoukai, fortyl_state, driver_init, ROT0, "Taito Corporation", "Field Day", MACHINE_SUPPORTS_SAVE )
+GAME( 1984, undoukai, fieldday, undoukai, undoukai, fortyl_state, driver_init, ROT0, "Taito Corporation", "The Undoukai (Japan)", MACHINE_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/4enraya.cpp b/src/mame/drivers/4enraya.cpp
index 13786a6c6b9..609e23271b3 100644
--- a/src/mame/drivers/4enraya.cpp
+++ b/src/mame/drivers/4enraya.cpp
@@ -266,7 +266,7 @@ void _4enraya_state::main_portmap(address_map &map)
}
-void _4enraya_state::unkpacg_main_map(address_map &map)
+void unk_gambl_state::unkpacg_main_map(address_map &map)
{
map(0x0000, 0x1fff).rom();
map(0x6000, 0x67ff).ram().share("nvram");
@@ -274,7 +274,7 @@ void _4enraya_state::unkpacg_main_map(address_map &map)
map(0x8000, 0x9fff).rom();
}
-void _4enraya_state::unkpacg_main_portmap(address_map &map)
+void unk_gambl_state::unkpacg_main_portmap(address_map &map)
{
map.global_mask(0xff);
map(0x00, 0x00).portr("DSW1");
@@ -498,7 +498,7 @@ MACHINE_CONFIG_START(_4enraya_state::_4enraya )
MACHINE_CONFIG_END
-MACHINE_CONFIG_START(_4enraya_state::unkpacg)
+MACHINE_CONFIG_START(unk_gambl_state::unkpacg)
_4enraya(config);
/* basic machine hardware */
@@ -636,8 +636,10 @@ ROM_END
* Driver Init *
***********************************/
-void _4enraya_state::init_unkpacg()
+void unk_gambl_state::driver_init()
{
+ _4enraya_state::driver_init();
+
// descramble rom
uint8_t *rom = memregion("maincpu")->base();
for (int i = 0x8000; i < 0xa000; i++)
@@ -649,9 +651,9 @@ void _4enraya_state::init_unkpacg()
* Game Drivers *
***********************************/
-/* YEAR NAME PARENT MACHINE INPUT CLASS INIT ROT COMPANY FULLNAME FLAGS */
-GAME( 1990, 4enraya, 0, _4enraya, 4enraya, _4enraya_state, empty_init, ROT0, "IDSA", "4 En Raya (set 1)", MACHINE_SUPPORTS_SAVE )
-GAME( 1990, 4enrayaa, 4enraya, _4enraya, 4enraya, _4enraya_state, empty_init, ROT0, "IDSA", "4 En Raya (set 2)", MACHINE_SUPPORTS_SAVE )
-GAME( 199?, unkpacg, 0, unkpacg, unkpacg, _4enraya_state, init_unkpacg, ROT0, "<unknown>", "unknown 'Pac-Man' gambling game", MACHINE_SUPPORTS_SAVE )
-GAME( 199?, unksig, 0, unkpacg, unkfr, _4enraya_state, init_unkpacg, ROT0, "<unknown>", "unknown 'Space Invaders' gambling game (set 1)", MACHINE_SUPPORTS_SAVE )
-GAME( 199?, unksiga, unksig, unkpacg, unkfr, _4enraya_state, init_unkpacg, ROT0, "<unknown>", "unknown 'Space Invaders' gambling game (set 2)", MACHINE_SUPPORTS_SAVE )
+/* YEAR NAME PARENT MACHINE INPUT CLASS INIT ROT COMPANY FULLNAME FLAGS */
+GAME( 1990, 4enraya, 0, _4enraya, 4enraya, _4enraya_state, empty_init, ROT0, "IDSA", "4 En Raya (set 1)", MACHINE_SUPPORTS_SAVE )
+GAME( 1990, 4enrayaa, 4enraya, _4enraya, 4enraya, _4enraya_state, empty_init, ROT0, "IDSA", "4 En Raya (set 2)", MACHINE_SUPPORTS_SAVE )
+GAME( 199?, unkpacg, 0, unkpacg, unkpacg, unk_gambl_state, empty_init, ROT0, "<unknown>", "unknown 'Pac-Man' gambling game", MACHINE_SUPPORTS_SAVE )
+GAME( 199?, unksig, 0, unkpacg, unkfr, unk_gambl_state, empty_init, ROT0, "<unknown>", "unknown 'Space Invaders' gambling game (set 1)", MACHINE_SUPPORTS_SAVE )
+GAME( 199?, unksiga, unksig, unkpacg, unkfr, unk_gambl_state, empty_init, ROT0, "<unknown>", "unknown 'Space Invaders' gambling game (set 2)", MACHINE_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/4roses.cpp b/src/mame/drivers/4roses.cpp
index 98feee3d6f3..83c5601084c 100644
--- a/src/mame/drivers/4roses.cpp
+++ b/src/mame/drivers/4roses.cpp
@@ -195,23 +195,37 @@ public:
{
}
- void init_4roses();
- void init_rugby();
+ void driver_init() override;
void _4roses(machine_config &config);
- void rugby(machine_config &config);
+
+protected:
+ required_device<cpu_device> m_maincpu;
+
private:
DECLARE_READ8_MEMBER(_4roses_opcode_r);
- DECLARE_READ8_MEMBER(rugby_opcode_r);
void _4roses_map(address_map &map);
void _4roses_opcodes_map(address_map &map);
+};
+
+class rugby_state : public _4roses_state
+{
+public:
+ rugby_state(const machine_config &mconfig, device_type type, const char *tag)
+ : _4roses_state(mconfig, type, tag)
+ {
+ }
+
+ void driver_init() override;
+ void rugby(machine_config &config);
+
+private:
+ DECLARE_READ8_MEMBER(rugby_opcode_r);
+
void rugby_map(address_map &map);
void rugby_opcodes_map(address_map &map);
-
- required_device<cpu_device> m_maincpu;
};
-
/**********************
* Read/Write Handlers *
**********************/
@@ -274,7 +288,7 @@ void _4roses_state::_4roses_opcodes_map(address_map &map)
map(0x8000, 0xffff).rom().region("maincpu", 0x8000);
}
-void _4roses_state::rugby_map(address_map &map)
+void rugby_state::rugby_map(address_map &map)
{
map(0x0000, 0x07ff).ram(); // AM_SHARE("nvram")
map(0x0c00, 0x0c00).r("ay8910", FUNC(ay8910_device::data_r));
@@ -286,7 +300,7 @@ void _4roses_state::rugby_map(address_map &map)
map(0x7000, 0x7fff).ram().w(this, FUNC(_4roses_state::funworld_colorram_w)).share("colorram");
}
-READ8_MEMBER(_4roses_state::rugby_opcode_r)
+READ8_MEMBER(rugby_state::rugby_opcode_r)
{
uint8_t data = m_maincpu->space(AS_PROGRAM).read_byte(offset);
if ((offset >> 12) == 4)
@@ -294,9 +308,9 @@ READ8_MEMBER(_4roses_state::rugby_opcode_r)
return data;
}
-void _4roses_state::rugby_opcodes_map(address_map &map)
+void rugby_state::rugby_opcodes_map(address_map &map)
{
- map(0x0000, 0x7fff).r(this, FUNC(_4roses_state::rugby_opcode_r));
+ map(0x0000, 0x7fff).r(this, FUNC(rugby_state::rugby_opcode_r));
map(0x8000, 0xffff).rom().region("maincpu", 0x8000);
}
@@ -476,7 +490,7 @@ MACHINE_CONFIG_START(_4roses_state::_4roses)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 2.5)
MACHINE_CONFIG_END
-MACHINE_CONFIG_START(_4roses_state::rugby)
+MACHINE_CONFIG_START(rugby_state::rugby)
_4roses(config);
MCFG_DEVICE_MODIFY("maincpu")
MCFG_DEVICE_PROGRAM_MAP(rugby_map)
@@ -553,14 +567,14 @@ ROM_END
* Driver Initialization *
**************************/
-void _4roses_state::init_4roses()
+void _4roses_state::driver_init()
{
uint8_t *rom = memregion("maincpu")->base();
for (offs_t addr = 0x8000; addr < 0x10000; addr++)
rom[addr] = bitswap<8>(rom[addr] ^ 0xca, 6, 5, 4, 3, 2, 1, 0, 7);
}
-void _4roses_state::init_rugby()
+void rugby_state::driver_init()
{
uint8_t *rom = memregion("maincpu")->base();
for (offs_t addr = 0x8000; addr < 0x10000; addr++)
@@ -573,6 +587,6 @@ void _4roses_state::init_rugby()
*************************/
/* YEAR NAME PARENT MACHINE INPUT CLASS INIT ROT COMPANY FULLNAME FLAGS */
-GAME( 1999, 4roses, 0, _4roses, 4roses, _4roses_state, init_4roses, ROT0, "<unknown>", "Four Roses (encrypted, set 1)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_WRONG_COLORS | MACHINE_UNEMULATED_PROTECTION | MACHINE_NO_SOUND | MACHINE_NOT_WORKING )
-GAME( 1999, 4rosesa, 4roses, _4roses, 4roses, _4roses_state, init_4roses, ROT0, "<unknown>", "Four Roses (encrypted, set 2)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_WRONG_COLORS | MACHINE_UNEMULATED_PROTECTION | MACHINE_NO_SOUND | MACHINE_NOT_WORKING )
-GAME( 1999, rugby, 0, rugby, 4roses, _4roses_state, init_rugby, ROT0, "C.M.C.", "Rugby? (four roses hardware)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_WRONG_COLORS | MACHINE_UNEMULATED_PROTECTION | MACHINE_NO_SOUND | MACHINE_NOT_WORKING )
+GAME( 1999, 4roses, 0, _4roses, 4roses, _4roses_state, driver_init, ROT0, "<unknown>", "Four Roses (encrypted, set 1)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_WRONG_COLORS | MACHINE_UNEMULATED_PROTECTION | MACHINE_NO_SOUND | MACHINE_NOT_WORKING )
+GAME( 1999, 4rosesa, 4roses, _4roses, 4roses, _4roses_state, driver_init, ROT0, "<unknown>", "Four Roses (encrypted, set 2)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_WRONG_COLORS | MACHINE_UNEMULATED_PROTECTION | MACHINE_NO_SOUND | MACHINE_NOT_WORKING )
+GAME( 1999, rugby, 0, rugby, 4roses, rugby_state, driver_init, ROT0, "C.M.C.", "Rugby? (four roses hardware)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_WRONG_COLORS | MACHINE_UNEMULATED_PROTECTION | MACHINE_NO_SOUND | MACHINE_NOT_WORKING )
diff --git a/src/mame/drivers/taito_f3.cpp b/src/mame/drivers/taito_f3.cpp
index 2b2ab0fb6a2..4ff48705252 100644
--- a/src/mame/drivers/taito_f3.cpp
+++ b/src/mame/drivers/taito_f3.cpp
@@ -451,7 +451,7 @@ void taito_f3_state::machine_start()
save_item(NAME(m_coin_word));
}
-MACHINE_RESET_MEMBER(taito_f3_state,f3)
+void taito_f3_state::machine_reset()
{
/* start with sound m68k off, qtheater relies on it (otherwise main CPU tries to reset it while 68k is working with irq table vectors). */
m_audiocpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
@@ -464,8 +464,6 @@ MACHINE_CONFIG_START(taito_f3_state::f3)
MCFG_DEVICE_PROGRAM_MAP(f3_map)
MCFG_DEVICE_VBLANK_INT_DRIVER("screen", taito_f3_state, f3_interrupt2)
- MCFG_MACHINE_RESET_OVERRIDE(taito_f3_state,f3)
-
MCFG_EEPROM_SERIAL_93C46_ADD("eeprom")
MCFG_WATCHDOG_ADD("watchdog")
@@ -482,8 +480,6 @@ MACHINE_CONFIG_START(taito_f3_state::f3)
MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_taito_f3)
MCFG_PALETTE_ADD("palette", 0x2000)
- MCFG_VIDEO_START_OVERRIDE(taito_f3_state,f3)
-
/* sound hardware */
MCFG_DEVICE_ADD("taito_en", TAITO_EN, 0)
MACHINE_CONFIG_END
@@ -580,8 +576,6 @@ MACHINE_CONFIG_START(taito_f3_state::bubsympb)
MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_bubsympb)
MCFG_PALETTE_ADD("palette", 8192)
- MCFG_VIDEO_START_OVERRIDE(taito_f3_state,f3)
-
/* sound hardware */
SPEAKER(config, "mono").front_center();
diff --git a/src/mame/includes/1942.h b/src/mame/includes/1942.h
index 4f2bad7efc3..0d9e2a06e77 100644
--- a/src/mame/includes/1942.h
+++ b/src/mame/includes/1942.h
@@ -11,24 +11,56 @@
class _1942_state : public driver_device
{
+ friend class _1942p_state;
+
public:
_1942_state(const machine_config &mconfig, device_type type, const char *tag)
- : driver_device(mconfig, type, tag),
- m_spriteram(*this, "spriteram"),
- m_fg_videoram(*this, "fg_videoram"),
- m_bg_videoram(*this, "bg_videoram"),
- m_protopal(*this, "protopal"),
- m_audiocpu(*this, "audiocpu"),
- m_maincpu(*this, "maincpu"),
- m_gfxdecode(*this, "gfxdecode"),
- m_palette(*this, "palette"),
- m_soundlatch(*this, "soundlatch") { }
+ : driver_device(mconfig, type, tag)
+ , m_spriteram(*this, "spriteram")
+ , m_fg_videoram(*this, "fg_videoram")
+ , m_bg_videoram(*this, "bg_videoram")
+ , m_audiocpu(*this, "audiocpu")
+ , m_maincpu(*this, "maincpu")
+ , m_gfxdecode(*this, "gfxdecode")
+ , m_palette(*this, "palette")
+ , m_soundlatch(*this, "soundlatch") { }
+
+ void driver_init() override;
+
+ TILE_GET_INFO_MEMBER(get_fg_tile_info);
+ TILE_GET_INFO_MEMBER(get_bg_tile_info);
+
+ void _1942(machine_config &config);
+
+protected:
+ void machine_start() override;
+ void machine_reset() override;
+ void video_start() override;
+
+ void _1942_map(address_map &map);
+ void sound_map(address_map &map);
+
+ DECLARE_WRITE8_MEMBER(_1942_bankswitch_w);
+ DECLARE_WRITE8_MEMBER(_1942_fgvideoram_w);
+ DECLARE_WRITE8_MEMBER(_1942_bgvideoram_w);
+ DECLARE_WRITE8_MEMBER(_1942_palette_bank_w);
+ DECLARE_WRITE8_MEMBER(_1942_scroll_w);
+ DECLARE_WRITE8_MEMBER(_1942_c804_w);
+ DECLARE_PALETTE_INIT(1942);
+ TIMER_DEVICE_CALLBACK_MEMBER(_1942_scanline);
+ uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ virtual void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
/* memory pointers */
required_shared_ptr<uint8_t> m_spriteram;
required_shared_ptr<uint8_t> m_fg_videoram;
required_shared_ptr<uint8_t> m_bg_videoram;
- optional_shared_ptr<uint8_t> m_protopal;
+
+ required_device<cpu_device> m_audiocpu;
+ required_device<cpu_device> m_maincpu;
+ required_device<gfxdecode_device> m_gfxdecode;
+ required_device<palette_device> m_palette;
+ required_device<generic_latch_8_device> m_soundlatch;
/* video-related */
tilemap_t *m_fg_tilemap;
@@ -36,40 +68,31 @@ public:
int m_palette_bank;
uint8_t m_scroll[2];
void create_palette();
- DECLARE_PALETTE_INIT(1942);
- DECLARE_PALETTE_INIT(1942p);
- DECLARE_WRITE8_MEMBER(c1942p_palette_w);
+};
+
+class _1942p_state : public _1942_state
+{
+public:
+ _1942p_state(const machine_config &mconfig, device_type type, const char *tag)
+ : _1942_state(mconfig, type, tag)
+ , m_protopal(*this, "protopal")
+ { }
- /* devices */
- required_device<cpu_device> m_audiocpu;
- DECLARE_WRITE8_MEMBER(c1942_bankswitch_w);
- DECLARE_WRITE8_MEMBER(c1942_fgvideoram_w);
- DECLARE_WRITE8_MEMBER(c1942_bgvideoram_w);
- DECLARE_WRITE8_MEMBER(c1942_palette_bank_w);
- DECLARE_WRITE8_MEMBER(c1942_scroll_w);
- DECLARE_WRITE8_MEMBER(c1942_c804_w);
- DECLARE_WRITE8_MEMBER(c1942p_f600_w);
- void init_1942();
- TILE_GET_INFO_MEMBER(get_fg_tile_info);
- TILE_GET_INFO_MEMBER(get_bg_tile_info);
- virtual void machine_start() override;
- virtual void machine_reset() override;
- virtual void video_start() override;
- void video_start_c1942p();
- uint32_t screen_update_1942(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- uint32_t screen_update_1942p(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- TIMER_DEVICE_CALLBACK_MEMBER(c1942_scanline);
- void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect );
- void draw_sprites_p( bitmap_ind16 &bitmap, const rectangle &cliprect );
- required_device<cpu_device> m_maincpu;
- required_device<gfxdecode_device> m_gfxdecode;
- required_device<palette_device> m_palette;
- required_device<generic_latch_8_device> m_soundlatch;
void _1942p(machine_config &config);
- void _1942(machine_config &config);
- void c1942_map(address_map &map);
- void c1942p_map(address_map &map);
- void c1942p_sound_io(address_map &map);
- void c1942p_sound_map(address_map &map);
- void sound_map(address_map &map);
+
+protected:
+ void video_start() override;
+
+ void _1942p_map(address_map &map);
+ void _1942p_sound_io(address_map &map);
+ void _1942p_sound_map(address_map &map);
+
+ DECLARE_WRITE8_MEMBER(_1942p_f600_w);
+ DECLARE_WRITE8_MEMBER(_1942p_palette_w);
+
+ DECLARE_PALETTE_INIT(1942p);
+
+ void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect) override;
+
+ required_shared_ptr<uint8_t> m_protopal;
};
diff --git a/src/mame/includes/3do.h b/src/mame/includes/3do.h
index 8d176a2401f..73e0901665c 100644
--- a/src/mame/includes/3do.h
+++ b/src/mame/includes/3do.h
@@ -171,9 +171,6 @@ public:
DECLARE_WRITE32_MEMBER(_3do_madam_w);
DECLARE_READ32_MEMBER(_3do_clio_r);
DECLARE_WRITE32_MEMBER(_3do_clio_w);
- virtual void machine_start() override;
- virtual void machine_reset() override;
- DECLARE_VIDEO_START(_3do);
uint32_t screen_update__3do(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER( timer_x16_cb );
@@ -181,7 +178,12 @@ public:
void _3do(machine_config &config);
void _3do_pal(machine_config &config);
void _3do_mem(address_map &map);
+
protected:
+ virtual void machine_start() override;
+ virtual void machine_reset() override;
+ virtual void video_start() override;
+
required_memory_bank m_bank1;
required_memory_bank m_bank2;
diff --git a/src/mame/includes/40love.h b/src/mame/includes/40love.h
index 6f17fd32c7a..0a7213d8149 100644
--- a/src/mame/includes/40love.h
+++ b/src/mame/includes/40love.h
@@ -11,22 +11,74 @@ class fortyl_state : public driver_device
{
public:
fortyl_state(const machine_config &mconfig, device_type type, const char *tag)
- : driver_device(mconfig, type, tag),
- m_videoram(*this, "videoram"),
- m_video_ctrl(*this, "video_ctrl"),
- m_spriteram(*this, "spriteram"),
- m_colorram(*this, "colorram"),
- m_spriteram2(*this, "spriteram2"),
- m_mcu_ram(*this, "mcu_ram"),
- m_audiocpu(*this, "audiocpu"),
- m_maincpu(*this, "maincpu"),
- m_bmcu(*this, "bmcu"),
- m_msm(*this, "msm"),
- m_ay(*this,"aysnd"),
- m_ta7630(*this,"ta7630"),
- m_gfxdecode(*this, "gfxdecode"),
- m_palette(*this, "palette"),
- m_soundlatch2(*this, "soundlatch2") { }
+ : driver_device(mconfig, type, tag)
+ , m_audiocpu(*this, "audiocpu")
+ , m_maincpu(*this, "maincpu")
+ , m_bmcu(*this, "bmcu")
+ , m_msm(*this, "msm")
+ , m_ay(*this,"aysnd")
+ , m_ta7630(*this,"ta7630")
+ , m_gfxdecode(*this, "gfxdecode")
+ , m_palette(*this, "palette")
+ , m_soundlatch2(*this, "soundlatch2")
+ , m_videoram(*this, "videoram")
+ , m_video_ctrl(*this, "video_ctrl")
+ , m_spriteram(*this, "spriteram")
+ , m_colorram(*this, "colorram")
+ , m_spriteram2(*this, "spriteram2")
+ , m_mcu_ram(*this, "mcu_ram")
+ { }
+
+ virtual void driver_init() override;
+
+ uint32_t screen_update_fortyl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ void redraw_pixels();
+ void fortyl_set_scroll_x( int offset );
+ void fortyl_plot_pix( int offset );
+ void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect );
+ void draw_pixram( bitmap_ind16 &bitmap, const rectangle &cliprect );
+
+ void undoukai(machine_config &config);
+ void _40love(machine_config &config);
+ void _40love_map(address_map &map);
+ void sound_map(address_map &map);
+ void undoukai_map(address_map &map);
+
+protected:
+ virtual void machine_start() override;
+ virtual void machine_reset() override;
+ virtual void video_start() override;
+
+ DECLARE_WRITE8_MEMBER(bank_select_w);
+ DECLARE_WRITE8_MEMBER(pix1_w);
+ DECLARE_WRITE8_MEMBER(pix2_w);
+ DECLARE_READ8_MEMBER(pix2_r);
+ DECLARE_READ8_MEMBER(snd_flag_r);
+ DECLARE_READ8_MEMBER(fortyl_mcu_status_r);
+ DECLARE_WRITE8_MEMBER(fortyl_pixram_sel_w);
+ DECLARE_READ8_MEMBER(fortyl_pixram_r);
+ DECLARE_WRITE8_MEMBER(fortyl_pixram_w);
+ DECLARE_WRITE8_MEMBER(fortyl_bg_videoram_w);
+ DECLARE_READ8_MEMBER(fortyl_bg_videoram_r);
+ DECLARE_WRITE8_MEMBER(fortyl_bg_colorram_w);
+ DECLARE_READ8_MEMBER(fortyl_bg_colorram_r);
+ DECLARE_WRITE8_MEMBER(pix1_mcu_w);
+ DECLARE_WRITE8_MEMBER(sound_control_0_w);
+ DECLARE_WRITE8_MEMBER(sound_control_1_w);
+ DECLARE_WRITE8_MEMBER(sound_control_2_w);
+ DECLARE_WRITE8_MEMBER(sound_control_3_w);
+ TILE_GET_INFO_MEMBER(get_bg_tile_info);
+
+ /* devices */
+ required_device<cpu_device> m_audiocpu;
+ required_device<cpu_device> m_maincpu;
+ optional_device<taito68705_mcu_device> m_bmcu;
+ required_device<msm5232_device> m_msm;
+ required_device<ay8910_device> m_ay;
+ required_device<ta7630_device> m_ta7630;
+ required_device<gfxdecode_device> m_gfxdecode;
+ required_device<palette_device> m_palette;
+ required_device<generic_latch_8_device> m_soundlatch2;
/* memory pointers */
required_shared_ptr<uint8_t> m_videoram;
@@ -60,53 +112,4 @@ public:
uint8_t m_snd_ctrl1;
uint8_t m_snd_ctrl2;
uint8_t m_snd_ctrl3;
-
- /* devices */
- required_device<cpu_device> m_audiocpu;
- required_device<cpu_device> m_maincpu;
- optional_device<taito68705_mcu_device> m_bmcu;
- required_device<msm5232_device> m_msm;
- required_device<ay8910_device> m_ay;
- required_device<ta7630_device> m_ta7630;
- required_device<gfxdecode_device> m_gfxdecode;
- required_device<palette_device> m_palette;
- required_device<generic_latch_8_device> m_soundlatch2;
-
- DECLARE_WRITE8_MEMBER(bank_select_w);
- DECLARE_WRITE8_MEMBER(pix1_w);
- DECLARE_WRITE8_MEMBER(pix2_w);
- DECLARE_READ8_MEMBER(pix2_r);
- DECLARE_READ8_MEMBER(snd_flag_r);
- DECLARE_READ8_MEMBER(fortyl_mcu_status_r);
- DECLARE_WRITE8_MEMBER(fortyl_pixram_sel_w);
- DECLARE_READ8_MEMBER(fortyl_pixram_r);
- DECLARE_WRITE8_MEMBER(fortyl_pixram_w);
- DECLARE_WRITE8_MEMBER(fortyl_bg_videoram_w);
- DECLARE_READ8_MEMBER(fortyl_bg_videoram_r);
- DECLARE_WRITE8_MEMBER(fortyl_bg_colorram_w);
- DECLARE_READ8_MEMBER(fortyl_bg_colorram_r);
- DECLARE_WRITE8_MEMBER(pix1_mcu_w);
- DECLARE_WRITE8_MEMBER(sound_control_0_w);
- DECLARE_WRITE8_MEMBER(sound_control_1_w);
- DECLARE_WRITE8_MEMBER(sound_control_2_w);
- DECLARE_WRITE8_MEMBER(sound_control_3_w);
- void init_undoukai();
- void init_40love();
- TILE_GET_INFO_MEMBER(get_bg_tile_info);
- virtual void video_start() override;
- DECLARE_MACHINE_START(40love);
- DECLARE_MACHINE_RESET(40love);
- DECLARE_MACHINE_RESET(common);
- uint32_t screen_update_fortyl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- void redraw_pixels();
- void fortyl_set_scroll_x( int offset );
- void fortyl_plot_pix( int offset );
- void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect );
- void draw_pixram( bitmap_ind16 &bitmap, const rectangle &cliprect );
-
- void undoukai(machine_config &config);
- void _40love(machine_config &config);
- void _40love_map(address_map &map);
- void sound_map(address_map &map);
- void undoukai_map(address_map &map);
};
diff --git a/src/mame/includes/4enraya.h b/src/mame/includes/4enraya.h
index 08b061dc566..02510082292 100644
--- a/src/mame/includes/4enraya.h
+++ b/src/mame/includes/4enraya.h
@@ -6,6 +6,11 @@
*************************************************************************/
+#ifndef MAME_INCLUDES_4ENRAYA_H
+#define MAME_INCLUDES_4ENRAYA_H
+
+#pragma once
+
#include "sound/ay8910.h"
class _4enraya_state : public driver_device
@@ -22,6 +27,23 @@ public:
{
}
+ DECLARE_WRITE8_MEMBER(sound_data_w);
+ DECLARE_READ8_MEMBER(fenraya_custom_map_r);
+ DECLARE_WRITE8_MEMBER(fenraya_custom_map_w);
+ DECLARE_WRITE8_MEMBER(fenraya_videoram_w);
+ DECLARE_WRITE8_MEMBER(sound_control_w);
+ TILE_GET_INFO_MEMBER(get_tile_info);
+ uint32_t screen_update_4enraya(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+
+ void _4enraya(machine_config &config);
+ void main_map(address_map &map);
+ void main_portmap(address_map &map);
+
+protected:
+ virtual void machine_start() override;
+ virtual void machine_reset() override;
+ virtual void video_start() override;
+
required_device<cpu_device> m_maincpu;
required_device<ay8910_device> m_ay;
required_device<gfxdecode_device> m_gfxdecode;
@@ -39,23 +61,22 @@ public:
/* sound-related */
uint8_t m_soundlatch;
+};
- DECLARE_WRITE8_MEMBER(sound_data_w);
- DECLARE_READ8_MEMBER(fenraya_custom_map_r);
- DECLARE_WRITE8_MEMBER(fenraya_custom_map_w);
- DECLARE_WRITE8_MEMBER(fenraya_videoram_w);
- DECLARE_WRITE8_MEMBER(sound_control_w);
- void init_unkpacg();
- TILE_GET_INFO_MEMBER(get_tile_info);
- uint32_t screen_update_4enraya(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+class unk_gambl_state : public _4enraya_state
+{
+public:
+ unk_gambl_state(const machine_config &mconfig, device_type type, const char *tag)
+ : _4enraya_state(mconfig, type, tag)
+ {
+ }
- virtual void machine_start() override;
- virtual void machine_reset() override;
- virtual void video_start() override;
void unkpacg(machine_config &config);
- void _4enraya(machine_config &config);
- void main_map(address_map &map);
- void main_portmap(address_map &map);
void unkpacg_main_map(address_map &map);
void unkpacg_main_portmap(address_map &map);
+
+protected:
+ void driver_init() override;
};
+
+#endif // MAME_INCLUDES_4ENRAYA_H \ No newline at end of file
diff --git a/src/mame/includes/taito_f3.h b/src/mame/includes/taito_f3.h
index ce24143b28e..7c641b7197c 100644
--- a/src/mame/includes/taito_f3.h
+++ b/src/mame/includes/taito_f3.h
@@ -310,9 +310,6 @@ public:
TILE_GET_INFO_MEMBER(get_tile_info8);
TILE_GET_INFO_MEMBER(get_tile_info_vram);
TILE_GET_INFO_MEMBER(get_tile_info_pixel);
- virtual void machine_start() override;
- DECLARE_MACHINE_RESET(f3);
- DECLARE_VIDEO_START(f3);
uint32_t screen_update_f3(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
DECLARE_WRITE_LINE_MEMBER(screen_vblank_f3);
INTERRUPT_GEN_MEMBER(f3_interrupt2);
@@ -327,6 +324,10 @@ public:
void bubsympb_map(address_map &map);
void f3_map(address_map &map);
protected:
+ virtual void machine_start() override;
+ virtual void machine_reset() override;
+ virtual void video_start() override;
+
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
virtual void device_post_load(void) override;
diff --git a/src/mame/machine/3do.cpp b/src/mame/machine/3do.cpp
index ea3a5a1fa96..7d3dfe633f5 100644
--- a/src/mame/machine/3do.cpp
+++ b/src/mame/machine/3do.cpp
@@ -1030,7 +1030,7 @@ WRITE32_MEMBER(_3do_state::_3do_clio_w)
/* 9 -> 5 bits translation */
-VIDEO_START_MEMBER(_3do_state,_3do)
+void _3do_state::video_start()
{
/* We only keep the odd bits and get rid of the even bits */
// for ( int i = 0; i < 512; i++ )
diff --git a/src/mame/video/1942.cpp b/src/mame/video/1942.cpp
index 1eb28456e3c..f161836ee89 100644
--- a/src/mame/video/1942.cpp
+++ b/src/mame/video/1942.cpp
@@ -92,7 +92,7 @@ PALETTE_INIT_MEMBER(_1942_state,1942)
m_palette->set_pen_indirect(colorbase + i, 0x40 | *color_prom++);
}
-PALETTE_INIT_MEMBER(_1942_state,1942p)
+PALETTE_INIT_MEMBER(_1942p_state,1942p)
{
for (int i = 0; i < 0x400; i++)
{
@@ -154,7 +154,7 @@ void _1942_state::video_start()
m_fg_tilemap->set_transparent_pen(0);
}
-void _1942_state::video_start_c1942p()
+void _1942p_state::video_start()
{
m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(_1942_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(_1942_state::get_bg_tile_info),this), TILEMAP_SCAN_COLS, 16, 16, 32, 16);
@@ -169,20 +169,20 @@ void _1942_state::video_start_c1942p()
***************************************************************************/
-WRITE8_MEMBER(_1942_state::c1942_fgvideoram_w)
+WRITE8_MEMBER(_1942_state::_1942_fgvideoram_w)
{
m_fg_videoram[offset] = data;
m_fg_tilemap->mark_tile_dirty(offset & 0x3ff);
}
-WRITE8_MEMBER(_1942_state::c1942_bgvideoram_w)
+WRITE8_MEMBER(_1942_state::_1942_bgvideoram_w)
{
m_bg_videoram[offset] = data;
m_bg_tilemap->mark_tile_dirty((offset & 0x0f) | ((offset >> 1) & 0x01f0));
}
-WRITE8_MEMBER(_1942_state::c1942_palette_bank_w)
+WRITE8_MEMBER(_1942_state::_1942_palette_bank_w)
{
if (m_palette_bank != data)
{
@@ -191,14 +191,14 @@ WRITE8_MEMBER(_1942_state::c1942_palette_bank_w)
}
}
-WRITE8_MEMBER(_1942_state::c1942_scroll_w)
+WRITE8_MEMBER(_1942_state::_1942_scroll_w)
{
m_scroll[offset] = data;
m_bg_tilemap->set_scrollx(0, m_scroll[0] | (m_scroll[1] << 8));
}
-WRITE8_MEMBER(_1942_state::c1942_c804_w)
+WRITE8_MEMBER(_1942_state::_1942_c804_w)
{
/* bit 7: flip screen
bit 4: cpu B reset
@@ -218,7 +218,7 @@ WRITE8_MEMBER(_1942_state::c1942_c804_w)
***************************************************************************/
-void _1942_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect )
+void _1942_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect)
{
int offs;
@@ -259,7 +259,7 @@ void _1942_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect
}
-uint32_t _1942_state::screen_update_1942(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+uint32_t _1942_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0);
draw_sprites(bitmap, cliprect);
@@ -268,24 +268,19 @@ uint32_t _1942_state::screen_update_1942(screen_device &screen, bitmap_ind16 &bi
}
-void _1942_state::draw_sprites_p( bitmap_ind16 &bitmap, const rectangle &cliprect )
+void _1942p_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- int offs;
-
- for (offs = m_spriteram.bytes() - 4; offs >= 0; offs -= 4)
+ for (int offs = m_spriteram.bytes() - 4; offs >= 0; offs -= 4)
{
- int i, code, col, sx, sy, dir;
-
- code = (m_spriteram[offs] & 0x7f) + 4 * (m_spriteram[offs + 3] & 0x20)
- + 2 * (m_spriteram[offs] & 0x80);
- col = m_spriteram[offs + 3] & 0x0f;
-
-
- sx = m_spriteram[offs + 2] - 0x10 * (m_spriteram[offs + 3] & 0x10);
- sy = m_spriteram[offs + 1];
+ int code = (m_spriteram[offs] & 0x7f) + 4 * (m_spriteram[offs + 3] & 0x20)
+ + 2 * (m_spriteram[offs] & 0x80);
+ int col = m_spriteram[offs + 3] & 0x0f;
+ int sx = m_spriteram[offs + 2] - 0x10 * (m_spriteram[offs + 3] & 0x10);
+ int sy = m_spriteram[offs + 1];
+ int dir;
if (flip_screen())
{
sx = 240 - sx;
@@ -298,7 +293,7 @@ void _1942_state::draw_sprites_p( bitmap_ind16 &bitmap, const rectangle &cliprec
}
/* handle double / quadruple height */
- i = (m_spriteram[offs + 3] & 0xc0) >> 6;
+ int i = (m_spriteram[offs + 3] & 0xc0) >> 6;
if (i == 2)
i = 3;
@@ -315,13 +310,4 @@ void _1942_state::draw_sprites_p( bitmap_ind16 &bitmap, const rectangle &cliprec
} while (i >= 0);
}
-
-}
-
-uint32_t _1942_state::screen_update_1942p(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
-{
- m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0);
- draw_sprites_p(bitmap, cliprect);
- m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0);
- return 0;
}
diff --git a/src/mame/video/taito_f3.cpp b/src/mame/video/taito_f3.cpp
index 842b02863d5..459e962b39f 100644
--- a/src/mame/video/taito_f3.cpp
+++ b/src/mame/video/taito_f3.cpp
@@ -530,7 +530,7 @@ WRITE_LINE_MEMBER(taito_f3_state::screen_vblank_f3)
}
}
-VIDEO_START_MEMBER(taito_f3_state,f3)
+void taito_f3_state::video_start()
{
const struct F3config *pCFG=&f3_config_table[0];
int i;