summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/machine/6526cia.h
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/6526cia.h
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/6526cia.h')
-rw-r--r--src/emu/machine/6526cia.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/emu/machine/6526cia.h b/src/emu/machine/6526cia.h
index fc7cff2b11f..4b40f2873b4 100644
--- a/src/emu/machine/6526cia.h
+++ b/src/emu/machine/6526cia.h
@@ -59,15 +59,15 @@ DEVICE_GET_INFO(cia6526r2);
DEVICE_GET_INFO(cia8520);
/* configuration */
-void cia_set_port_mask_value(const device_config *device, int port, int data);
+void cia_set_port_mask_value(running_device *device, int port, int data);
/* reading and writing */
READ8_DEVICE_HANDLER( cia_r );
WRITE8_DEVICE_HANDLER( cia_w );
-void cia_clock_tod(const device_config *device);
-void cia_issue_index(const device_config *device);
-void cia_set_input_cnt(const device_config *device, int data);
-void cia_set_input_sp(const device_config *device, int data);
+void cia_clock_tod(running_device *device);
+void cia_issue_index(running_device *device);
+void cia_set_input_cnt(running_device *device, int data);
+void cia_set_input_sp(running_device *device, int data);
WRITE_LINE_DEVICE_HANDLER( mos6526_tod_w );
WRITE_LINE_DEVICE_HANDLER( mos6526_cnt_w );
@@ -75,8 +75,8 @@ WRITE_LINE_DEVICE_HANDLER( mos6526_sp_w );
WRITE_LINE_DEVICE_HANDLER( mos6526_flag_w );
/* accessors */
-UINT8 cia_get_output_a(const device_config *device);
-UINT8 cia_get_output_b(const device_config *device);
-int cia_get_irq(const device_config *device);
+UINT8 cia_get_output_a(running_device *device);
+UINT8 cia_get_output_b(running_device *device);
+int cia_get_irq(running_device *device);
#endif /* __6526CIA_H__ */