summaryrefslogtreecommitdiffstats
path: root/src/mame/drivers/tp84.c
diff options
context:
space:
mode:
authorGravatarGravatar Aaron Giles <aaron@aarongiles.com>2010-09-02 07:57:50 +0000
committerGravatarGravatar Aaron Giles <aaron@aarongiles.com>2010-09-02 07:57:50 +0000
commit066e54b69fd68b249402febcf17b4b0bc7c4f79a (patch) (github)
tree3d524fc945e393c18de5beaa555dd14c8a0d107e /src/mame/drivers/tp84.c
parent1d194df33ab9ed333921bba2621ebd12b60927ed (diff)
downloadmame-066e54b69fd68b249402febcf17b4b0bc7c4f79a.tar.bz2
mame-066e54b69fd68b249402febcf17b4b0bc7c4f79a.zip
Changed driver_data objects to be devices. Replaced the driver_data_t
class with a new driver_device class, which is the base class for all driver_data objects now. The new driver devices are added as the first device in the device list, with a tag of "root"; all other devices are now owned by the driver device. Moved core callbacks (machine_start/_reset, sound_start/_reset, video_start/_reset/_eof/_update, and palette_init) into device configuration parameters on these new devices. The driver_device base class overrides device_start(), ensures all other devices have been started, and then calls, in order, the following overridable methods: find_devices() - new, used to locate devices prior to DRIVER_INIT DRIVER_INIT function from the game driver palette_init() - by default calls the MDRV_PALETTE_INIT function driver_start() - new machine_start() - by default calls the MDRV_MACHINE_START function sound_start() - by default calls the MDRV_SOUND_START function video_start() - by default calls the MDRV_VIDEO_START function Similarly, the driver_device class overrides device_reset() and then calls these methods in order: driver_reset() - new machine_reset() - by default calls the MDRV_MACHINE_RESET function sound_reset() - by default calls the MDRV_SOUND_RESET function video_reset() - by default calls the MDRV_VIDEO_RESET function To accommodate these changes, initialization order is slightly altered from before. The tilemap, video, sound, and debug systems are now initialized prior to the devices' start. And the user callbacks for DRIVER_INIT, PALETTE_INIT, MACHINE_START, SOUND_START, and VIDEO_START are all called back-to-back. The net effect should be similar, however. Added methods (optional_device and required_device) to the new driver_device class to find devices, intended to be used from the find_devices() callback. See harddriv.h and beathead.h for examples of usage. Changed device_t::subtag to only prepend a prefix if the device is not the 'root' device, in order to keep compatibility with existing tag searching. Changed device startup to actively reorder devices when they report missing dependencies. This ensures that the reset functions get called in the same order that the start functions did. Bulk updated drivers as follows: First removed the old static alloc function from the driver_data_t: S: [ \t]*static driver_device \*alloc *\( *running_machine *\&machine *\) *\{ *return auto_alloc_clear *\( *\&machine *, *[a-zA-Z0-9_]+_state *\( *machine *\) *\); *\}[\r\n]* R: Then switched from driver_data_t to driver_device: S: driver_data_t R: driver_device Then changed the constructors to pass the correct parameters: S: ([a-zA-Z0-9_]+)_state *\( *running_machine *\&machine *\)([\r\n\t ]+): *driver_device *\( *machine *\) R: \1_state\(running_machine \&machine, const driver_device_config_base \&config\)\2: driver_device\(machine, config\)
Diffstat (limited to 'src/mame/drivers/tp84.c')
-rw-r--r--src/mame/drivers/tp84.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mame/drivers/tp84.c b/src/mame/drivers/tp84.c
index 3bc27ae6443..09c8c79978b 100644
--- a/src/mame/drivers/tp84.c
+++ b/src/mame/drivers/tp84.c
@@ -291,7 +291,7 @@ GFXDECODE_END
-static MACHINE_CONFIG_START( tp84, driver_data_t )
+static MACHINE_CONFIG_START( tp84, driver_device )
/* basic machine hardware */
MDRV_CPU_ADD("cpu1",M6809, XTAL_18_432MHz/12) /* verified on pcb */