summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/machine/ldvp931.c
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2010-01-18 09:34:43 +0000
committer Aaron Giles <aaron@aarongiles.com>2010-01-18 09:34:43 +0000
commite738b79785852050ce8b83e369a7fc4dd46a071b (patch)
tree1ac39e9f40790b375c57fea4e5d56ca8d132babc /src/emu/machine/ldvp931.c
parent3f87f47a2ecdccb9d9627d0d52b76f262becb949 (diff)
Correct a long-standing design flaw: device configuration state
is now separate from runtime device state. I have larger plans for devices, so there is some temporary scaffolding to hold everything together, but this first step does separate things out. There is a new class 'running_device' which represents the state of a live device. A list of these running_devices sits in machine->devicelist and is created when a running_machine is instantiated. To access the configuration state, use device->baseconfig() which returns a reference to the configuration. The list of running_devices in machine->devicelist has a 1:1 correspondance with the list of device configurations in machine->config->devicelist, and most navigation options work equally on either (scanning by class, type, etc.) For the most part, drivers will now deal with running_device objects instead of const device_config objects. In fact, in order to do this patch, I did the following global search & replace: const device_config -> running_device device->static_config -> device->baseconfig().static_config device->inline_config -> device->baseconfig().inline_config and then fixed up the compiler errors that fell out. Some specifics: Removed device_get_info_* functions and replaced them with methods called get_config_*. Added methods for get_runtime_* to access runtime state from the running_device. DEVICE_GET_INFO callbacks are only passed a device_config *. This means they have no access to the token or runtime state at all. For most cases this is fine. Added new DEVICE_GET_RUNTIME_INFO callback that is passed the running_device for accessing data that is live at runtime. In the future this will go away to make room for a cleaner mechanism. Cleaned up the handoff of memory regions from the memory subsystem to the devices.
Diffstat (limited to 'src/emu/machine/ldvp931.c')
-rw-r--r--src/emu/machine/ldvp931.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/emu/machine/ldvp931.c b/src/emu/machine/ldvp931.c
index db04b4a9d81..e6ff82593bb 100644
--- a/src/emu/machine/ldvp931.c
+++ b/src/emu/machine/ldvp931.c
@@ -49,8 +49,8 @@
struct _ldplayer_data
{
/* low-level emulation data */
- const device_config *cpu; /* CPU index of the 8049 */
- const device_config *tracktimer; /* timer device */
+ running_device *cpu; /* CPU index of the 8049 */
+ running_device *tracktimer; /* timer device */
vp931_data_ready_func data_ready_cb; /* data ready callback */
/* I/O port states */
@@ -187,7 +187,7 @@ const ldplayer_interface vp931_interface =
ready callback
-------------------------------------------------*/
-void vp931_set_data_ready_callback(const device_config *device, vp931_data_ready_func callback)
+void vp931_set_data_ready_callback(running_device *device, vp931_data_ready_func callback)
{
laserdisc_state *ld = ldcore_get_safe_token(device);
ld->player->data_ready_cb = callback;
@@ -215,8 +215,8 @@ static void vp931_init(laserdisc_state *ld)
player->data_ready_cb = cbsave;
/* find our devices */
- player->cpu = ld->device->machine->device(device_build_tag(tempstring, ld->device, "vp931"));
- player->tracktimer = ld->device->machine->device(device_build_tag(tempstring, ld->device, "tracktimer"));
+ player->cpu = ld->device->subdevice("vp931");
+ player->tracktimer = ld->device->subdevice("tracktimer");
timer_device_set_ptr(player->tracktimer, ld);
}