diff options
author | 2017-05-07 23:18:47 +1000 | |
---|---|---|
committer | 2017-05-14 21:44:11 +1000 | |
commit | 0f0d39ef81562c75e79176dd3bebb1e491ca39d5 (patch) | |
tree | 201cee7fdf55ee800f83859a92efd2cfe66cf2b3 /src/mame/drivers/hh_ucom4.cpp | |
parent | e6c4be2b4d71c7a6c95be0bae111eb416ff0f9e7 (diff) |
Move static data out of devices into the device types. This is a significant change, so please pay attention.
The core changes are:
* Short name, full name and source file are no longer members of device_t, they are part of the device type
* MACHINE_COFIG_START no longer needs a driver class
* MACHINE_CONFIG_DERIVED_CLASS is no longer necessary
* Specify the state class you want in the GAME/COMP/CONS line
* The compiler will work out the base class where the driver init member is declared
* There is one static device type object per driver rather than one per machine configuration
Use DECLARE_DEVICE_TYPE or DECLARE_DEVICE_TYPE_NS to declare device type.
* DECLARE_DEVICE_TYPE forward-declares teh device type and class, and declares extern object finders.
* DECLARE_DEVICE_TYPE_NS is for devices classes in namespaces - it doesn't forward-declare the device type.
Use DEFINE_DEVICE_TYPE or DEFINE_DEVICE_TYPE_NS to define device types.
* These macros declare storage for the static data, and instantiate the device type and device finder templates.
The rest of the changes are mostly just moving stuff out of headers that shouldn't be there, renaming stuff for consistency, and scoping stuff down where appropriate.
Things I've actually messed with substantially:
* More descriptive names for a lot of devices
* Untangled the fantasy sound from the driver state, which necessitates breaking up sound/flip writes
* Changed DECO BSMT2000 ready callback into a device delegate
* Untangled Microprose 3D noise from driver state
* Used object finders for CoCo multipak, KC85 D002, and Irem sound subdevices
* Started to get TI-99 stuff out of the TI-990 directory and arrange bus devices properly
* Started to break out common parts of Samsung ARM SoC devices
* Turned some of FM, SID, SCSP DSP, EPIC12 and Voodoo cores into something resmbling C++
* Tried to make Z180 table allocation/setup a bit safer
* Converted generic keyboard/terminal to not use WRITE8 - space/offset aren't relevant
* Dynamically allocate generic terminal buffer so derived devices (e.g. teleprinter) can specify size
* Imporved encapsulation of Z80DART channels
* Refactored the SPC7110 bit table generator loop to make it more readable
* Added wrappers for SNES PPU operations so members can be made protected
* Factored out some boilerplate for YM chips with PSG
* toaplan2 gfx
* stic/intv resolution
* Video System video
* Out Run/Y-board sprite alignment
* GIC video hookup
* Amstrad CPC ROM box members
* IQ151 ROM cart region
* MSX cart IRQ callback resolution time
* SMS passthrough control devices starting subslots
I've smoke-tested several drivers, but I've probably missed something. Things I've missed will likely blow up spectacularly with failure to bind errors and the like. Let me know if there's more subtle breakage (could have happened in FM or Voodoo).
And can everyone please, please try to keep stuff clean. In particular, please stop polluting the global namespace. Keep things out of headers that don't need to be there, and use things that can be scoped down rather than macros.
It feels like an uphill battle trying to get this stuff under control while more of it's added.
Diffstat (limited to 'src/mame/drivers/hh_ucom4.cpp')
-rw-r--r-- | src/mame/drivers/hh_ucom4.cpp | 88 |
1 files changed, 44 insertions, 44 deletions
diff --git a/src/mame/drivers/hh_ucom4.cpp b/src/mame/drivers/hh_ucom4.cpp index 0595b4591ec..4d1069b552a 100644 --- a/src/mame/drivers/hh_ucom4.cpp +++ b/src/mame/drivers/hh_ucom4.cpp @@ -348,7 +348,7 @@ INPUT_PORTS_END static const s16 ufombs_speaker_levels[] = { 0, 0x7fff, -0x8000, 0 }; -static MACHINE_CONFIG_START( ufombs, ufombs_state ) +static MACHINE_CONFIG_START( ufombs ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", NEC_D552, 400000) // approximation @@ -494,7 +494,7 @@ INPUT_PORTS_END static const s16 ssfball_speaker_levels[] = { 0, 0x7fff, -0x8000, 0 }; -static MACHINE_CONFIG_START( ssfball, ssfball_state ) +static MACHINE_CONFIG_START( ssfball ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", NEC_D553, 400000) // approximation @@ -622,7 +622,7 @@ static INPUT_PORTS_START( bmsoccer ) PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Shoot") INPUT_PORTS_END -static MACHINE_CONFIG_START( bmsoccer, bmsoccer_state ) +static MACHINE_CONFIG_START( bmsoccer ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", NEC_D552, 400000) // approximation @@ -730,7 +730,7 @@ static INPUT_PORTS_START( bmsafari ) PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_16WAY INPUT_PORTS_END -static MACHINE_CONFIG_START( bmsafari, bmsafari_state ) +static MACHINE_CONFIG_START( bmsafari ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", NEC_D552, 400000) // approximation @@ -880,7 +880,7 @@ INPUT_PORTS_END static const s16 splasfgt_speaker_levels[] = { 0, 0x7fff, -0x8000, 0 }; -static MACHINE_CONFIG_START( splasfgt, splasfgt_state ) +static MACHINE_CONFIG_START( splasfgt ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", NEC_D553, 400000) // approximation @@ -984,7 +984,7 @@ static INPUT_PORTS_START( bcclimbr ) PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICKRIGHT_RIGHT ) INPUT_PORTS_END -static MACHINE_CONFIG_START( bcclimbr, bcclimbr_state ) +static MACHINE_CONFIG_START( bcclimbr ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", NEC_D553, XTAL_400kHz) @@ -1107,7 +1107,7 @@ static INPUT_PORTS_START( tactix ) PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) INPUT_PORTS_END -static MACHINE_CONFIG_START( tactix, tactix_state ) +static MACHINE_CONFIG_START( tactix ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", NEC_D557L, 400000) // approximation @@ -1201,7 +1201,7 @@ static INPUT_PORTS_START( invspace ) PORT_BIT( 0x0c, IP_ACTIVE_HIGH, IPT_UNUSED ) INPUT_PORTS_END -static MACHINE_CONFIG_START( invspace, invspace_state ) +static MACHINE_CONFIG_START( invspace ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", NEC_D552, XTAL_400kHz) @@ -1319,7 +1319,7 @@ static INPUT_PORTS_START( efball ) PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_16WAY INPUT_PORTS_END -static MACHINE_CONFIG_START( efball, efball_state ) +static MACHINE_CONFIG_START( efball ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", NEC_D553, XTAL_400kHz) @@ -1418,7 +1418,7 @@ static INPUT_PORTS_START( galaxy2 ) PORT_BIT( 0x0c, IP_ACTIVE_HIGH, IPT_UNUSED ) INPUT_PORTS_END -static MACHINE_CONFIG_START( galaxy2, galaxy2_state ) +static MACHINE_CONFIG_START( galaxy2 ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", NEC_D553, XTAL_400kHz) @@ -1536,7 +1536,7 @@ static INPUT_PORTS_START( astrocmd ) PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) INPUT_PORTS_END -static MACHINE_CONFIG_START( astrocmd, astrocmd_state ) +static MACHINE_CONFIG_START( astrocmd ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", NEC_D553, XTAL_400kHz) @@ -1632,7 +1632,7 @@ static INPUT_PORTS_START( edracula ) PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) INPUT_PORTS_END -static MACHINE_CONFIG_START( edracula, edracula_state ) +static MACHINE_CONFIG_START( edracula ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", NEC_D553, XTAL_400kHz) @@ -1714,7 +1714,7 @@ static INPUT_PORTS_START( mcompgin ) PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON8 ) INPUT_PORTS_END -static MACHINE_CONFIG_START( mcompgin, mcompgin_state ) +static MACHINE_CONFIG_START( mcompgin ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", NEC_D650, 400000) // approximation @@ -1821,7 +1821,7 @@ static INPUT_PORTS_START( mvbfree ) PORT_CONFSETTING( 0x08, "3" ) INPUT_PORTS_END -static MACHINE_CONFIG_START( mvbfree, mvbfree_state ) +static MACHINE_CONFIG_START( mvbfree ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", NEC_D553, 400000) // approximation @@ -1940,7 +1940,7 @@ static INPUT_PORTS_START( grobot9 ) PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_V) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_ucom4_state, single_interrupt_line, nullptr) PORT_NAME("Start-Pitch") INPUT_PORTS_END -static MACHINE_CONFIG_START( grobot9, grobot9_state ) +static MACHINE_CONFIG_START( grobot9 ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", NEC_D557L, 160000) // approximation @@ -2030,7 +2030,7 @@ static INPUT_PORTS_START( tccombat ) PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_2WAY INPUT_PORTS_END -static MACHINE_CONFIG_START( tccombat, tccombat_state ) +static MACHINE_CONFIG_START( tccombat ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", NEC_D552, 400000) // approximation @@ -2187,7 +2187,7 @@ void tmtennis_state::machine_reset() set_clock(); } -static MACHINE_CONFIG_START( tmtennis, tmtennis_state ) +static MACHINE_CONFIG_START( tmtennis ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", NEC_D552, 360000) // see set_clock @@ -2296,7 +2296,7 @@ static INPUT_PORTS_START( tmpacman ) PORT_BIT( 0x0e, IP_ACTIVE_HIGH, IPT_UNUSED ) INPUT_PORTS_END -static MACHINE_CONFIG_START( tmpacman, tmpacman_state ) +static MACHINE_CONFIG_START( tmpacman ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", NEC_D553, XTAL_430kHz) @@ -2399,7 +2399,7 @@ static INPUT_PORTS_START( tmscramb ) PORT_BIT( 0x0c, IP_ACTIVE_HIGH, IPT_UNUSED ) INPUT_PORTS_END -static MACHINE_CONFIG_START( tmscramb, tmscramb_state ) +static MACHINE_CONFIG_START( tmscramb ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", NEC_D553, XTAL_400kHz) @@ -2499,7 +2499,7 @@ static INPUT_PORTS_START( tcaveman ) PORT_CONFSETTING( 0x08, "Professional" ) INPUT_PORTS_END -static MACHINE_CONFIG_START( tcaveman, tcaveman_state ) +static MACHINE_CONFIG_START( tcaveman ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", NEC_D553, XTAL_400kHz) @@ -2631,7 +2631,7 @@ static INPUT_PORTS_START( alnchase ) PORT_BIT( 0x0c, IP_ACTIVE_HIGH, IPT_UNUSED ) INPUT_PORTS_END -static MACHINE_CONFIG_START( alnchase, alnchase_state ) +static MACHINE_CONFIG_START( alnchase ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", NEC_D553, XTAL_400kHz) @@ -2852,36 +2852,36 @@ ROM_END -/* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY, FULLNAME, FLAGS */ -CONS( 1979, ufombs, 0, 0, ufombs, ufombs, driver_device, 0, "Bambino", "UFO Master-Blaster Station", MACHINE_SUPPORTS_SAVE ) -CONS( 1979, ssfball, 0, 0, ssfball, ssfball, driver_device, 0, "Bambino", "Superstar Football", MACHINE_SUPPORTS_SAVE ) -CONS( 1979, bmsoccer, 0, 0, bmsoccer, bmsoccer, driver_device, 0, "Bambino", "Kick The Goal Soccer", MACHINE_SUPPORTS_SAVE ) -CONS( 1981, bmsafari, 0, 0, bmsafari, bmsafari, driver_device, 0, "Bambino", "Safari (Bambino)", MACHINE_SUPPORTS_SAVE ) -CONS( 1980, splasfgt, 0, 0, splasfgt, splasfgt, driver_device, 0, "Bambino", "Space Laser Fight", MACHINE_SUPPORTS_SAVE ) +// YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY, FULLNAME, FLAGS +CONS( 1979, ufombs, 0, 0, ufombs, ufombs, ufombs_state, 0, "Bambino", "UFO Master-Blaster Station", MACHINE_SUPPORTS_SAVE ) +CONS( 1979, ssfball, 0, 0, ssfball, ssfball, ssfball_state, 0, "Bambino", "Superstar Football", MACHINE_SUPPORTS_SAVE ) +CONS( 1979, bmsoccer, 0, 0, bmsoccer, bmsoccer, bmsoccer_state, 0, "Bambino", "Kick The Goal Soccer", MACHINE_SUPPORTS_SAVE ) +CONS( 1981, bmsafari, 0, 0, bmsafari, bmsafari, bmsafari_state, 0, "Bambino", "Safari (Bambino)", MACHINE_SUPPORTS_SAVE ) +CONS( 1980, splasfgt, 0, 0, splasfgt, splasfgt, splasfgt_state, 0, "Bambino", "Space Laser Fight", MACHINE_SUPPORTS_SAVE ) -CONS( 1982, bcclimbr, 0, 0, bcclimbr, bcclimbr, driver_device, 0, "Bandai", "Crazy Climber (Bandai)", MACHINE_SUPPORTS_SAVE ) +CONS( 1982, bcclimbr, 0, 0, bcclimbr, bcclimbr, bcclimbr_state, 0, "Bandai", "Crazy Climber (Bandai)", MACHINE_SUPPORTS_SAVE ) -CONS( 1980, tactix, 0, 0, tactix, tactix, driver_device, 0, "Castle Toy", "Tactix (Castle Toy)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) +CONS( 1980, tactix, 0, 0, tactix, tactix, tactix_state, 0, "Castle Toy", "Tactix (Castle Toy)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) -CONS( 1980, invspace, 0, 0, invspace, invspace, driver_device, 0, "Epoch", "Invader From Space", MACHINE_SUPPORTS_SAVE ) -CONS( 1980, efball, 0, 0, efball, efball, driver_device, 0, "Epoch", "Electronic Football (Epoch)", MACHINE_SUPPORTS_SAVE ) -CONS( 1981, galaxy2, 0, 0, galaxy2, galaxy2, driver_device, 0, "Epoch", "Galaxy II (VFD Rev. D)", MACHINE_SUPPORTS_SAVE ) -CONS( 1981, galaxy2b, galaxy2, 0, galaxy2b, galaxy2, driver_device, 0, "Epoch", "Galaxy II (VFD Rev. B)", MACHINE_SUPPORTS_SAVE ) -CONS( 1982, astrocmd, 0, 0, astrocmd, astrocmd, driver_device, 0, "Epoch", "Astro Command", MACHINE_SUPPORTS_SAVE ) -CONS( 1982, edracula, 0, 0, edracula, edracula, driver_device, 0, "Epoch", "Dracula (Epoch)", MACHINE_SUPPORTS_SAVE ) +CONS( 1980, invspace, 0, 0, invspace, invspace, invspace_state, 0, "Epoch", "Invader From Space", MACHINE_SUPPORTS_SAVE ) +CONS( 1980, efball, 0, 0, efball, efball, efball_state, 0, "Epoch", "Electronic Football (Epoch)", MACHINE_SUPPORTS_SAVE ) +CONS( 1981, galaxy2, 0, 0, galaxy2, galaxy2, galaxy2_state, 0, "Epoch", "Galaxy II (VFD Rev. D)", MACHINE_SUPPORTS_SAVE ) +CONS( 1981, galaxy2b, galaxy2, 0, galaxy2b, galaxy2, galaxy2_state, 0, "Epoch", "Galaxy II (VFD Rev. B)", MACHINE_SUPPORTS_SAVE ) +CONS( 1982, astrocmd, 0, 0, astrocmd, astrocmd, astrocmd_state, 0, "Epoch", "Astro Command", MACHINE_SUPPORTS_SAVE ) +CONS( 1982, edracula, 0, 0, edracula, edracula, edracula_state, 0, "Epoch", "Dracula (Epoch)", MACHINE_SUPPORTS_SAVE ) -CONS( 1979, mcompgin, 0, 0, mcompgin, mcompgin, driver_device, 0, "Mattel", "Computer Gin", MACHINE_SUPPORTS_SAVE | MACHINE_NOT_WORKING ) +CONS( 1979, mcompgin, 0, 0, mcompgin, mcompgin, mcompgin_state, 0, "Mattel", "Computer Gin", MACHINE_SUPPORTS_SAVE | MACHINE_NOT_WORKING ) -CONS( 1979, mvbfree, 0, 0, mvbfree, mvbfree, driver_device, 0, "Mego", "Mini-Vid Break Free", MACHINE_SUPPORTS_SAVE ) +CONS( 1979, mvbfree, 0, 0, mvbfree, mvbfree, mvbfree_state, 0, "Mego", "Mini-Vid Break Free", MACHINE_SUPPORTS_SAVE ) -CONS( 1980, grobot9, 0, 0, grobot9, grobot9, driver_device, 0, "Takatoku Toys", "Game Robot 9", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) // some of the minigames: *** +CONS( 1980, grobot9, 0, 0, grobot9, grobot9, grobot9_state, 0, "Takatoku Toys", "Game Robot 9", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) // some of the minigames: *** -CONS( 1980, tccombat, 0, 0, tccombat, tccombat, driver_device, 0, "Tomy", "Cosmic Combat", MACHINE_SUPPORTS_SAVE ) -CONS( 1980, tmtennis, 0, 0, tmtennis, tmtennis, driver_device, 0, "Tomy", "Tennis (Tomy)", MACHINE_SUPPORTS_SAVE ) -CONS( 1982, tmpacman, 0, 0, tmpacman, tmpacman, driver_device, 0, "Tomy", "Pac Man (Tomy)", MACHINE_SUPPORTS_SAVE ) -CONS( 1982, tmscramb, 0, 0, tmscramb, tmscramb, driver_device, 0, "Tomy", "Scramble (Tomy)", MACHINE_SUPPORTS_SAVE ) -CONS( 1982, tcaveman, 0, 0, tcaveman, tcaveman, driver_device, 0, "Tomy", "Caveman (Tomy)", MACHINE_SUPPORTS_SAVE ) -CONS( 1984, alnchase, 0, 0, alnchase, alnchase, driver_device, 0, "Tomy", "Alien Chase", MACHINE_SUPPORTS_SAVE ) +CONS( 1980, tccombat, 0, 0, tccombat, tccombat, tccombat_state, 0, "Tomy", "Cosmic Combat", MACHINE_SUPPORTS_SAVE ) +CONS( 1980, tmtennis, 0, 0, tmtennis, tmtennis, tmtennis_state, 0, "Tomy", "Tennis (Tomy)", MACHINE_SUPPORTS_SAVE ) +CONS( 1982, tmpacman, 0, 0, tmpacman, tmpacman, tmpacman_state, 0, "Tomy", "Pac Man (Tomy)", MACHINE_SUPPORTS_SAVE ) +CONS( 1982, tmscramb, 0, 0, tmscramb, tmscramb, tmscramb_state, 0, "Tomy", "Scramble (Tomy)", MACHINE_SUPPORTS_SAVE ) +CONS( 1982, tcaveman, 0, 0, tcaveman, tcaveman, tcaveman_state, 0, "Tomy", "Caveman (Tomy)", MACHINE_SUPPORTS_SAVE ) +CONS( 1984, alnchase, 0, 0, alnchase, alnchase, alnchase_state, 0, "Tomy", "Alien Chase", MACHINE_SUPPORTS_SAVE ) // ***: As far as MAME is concerned, the game is emulated fine. But for it to be playable, it requires interaction // with other, unemulatable, things eg. game board/pieces, playing cards, pen & paper, etc. |