From e738b79785852050ce8b83e369a7fc4dd46a071b Mon Sep 17 00:00:00 2001 From: Aaron Giles Date: Mon, 18 Jan 2010 09:34:43 +0000 Subject: 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. --- src/emu/machine/6850acia.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/emu/machine/6850acia.h') diff --git a/src/emu/machine/6850acia.h b/src/emu/machine/6850acia.h index a0d535410b2..987fe5b48c5 100644 --- a/src/emu/machine/6850acia.h +++ b/src/emu/machine/6850acia.h @@ -60,11 +60,11 @@ struct _acia6850_interface DEVICE_GET_INFO( acia6850 ); -void acia6850_tx_clock_in(const device_config *device) ATTR_NONNULL(1); -void acia6850_rx_clock_in(const device_config *device) ATTR_NONNULL(1); +void acia6850_tx_clock_in(running_device *device) ATTR_NONNULL(1); +void acia6850_rx_clock_in(running_device *device) ATTR_NONNULL(1); -void acia6850_set_rx_clock(const device_config *device, int clock) ATTR_NONNULL(1); -void acia6850_set_tx_clock(const device_config *device, int clock) ATTR_NONNULL(1); +void acia6850_set_rx_clock(running_device *device, int clock) ATTR_NONNULL(1); +void acia6850_set_tx_clock(running_device *device, int clock) ATTR_NONNULL(1); WRITE8_DEVICE_HANDLER( acia6850_ctrl_w ); READ8_DEVICE_HANDLER( acia6850_stat_r ); -- cgit v1.2.3-70-g09d2