diff options
author | 2008-12-18 08:28:50 +0000 | |
---|---|---|
committer | 2008-12-18 08:28:50 +0000 | |
commit | cf9fc5861805c5e344fab6e96d084a372c2683aa (patch) | |
tree | d1fd7dd4b3d409b5cdc49be0441a5fccee7e2188 /src/emu/cpuexec.h | |
parent | d9fbf0dba5d2e98f1fe0a2f7107ac17db1146e03 (diff) |
Made the concept of a "clock" native to devices. The clock is now
specified when the device is added, and the clock is available in
the device_config directly via device->clock. Updated all devices
that have a clock to specify it when adding the device, rather than
as part of their configuration. As part of this work, also created
device-specific _ADD and _REMOVE macros to simplify configuration.
Dfined a generic device execute function callback, though it
is not used yet. The long term plan is that any device with an
execute callback will be scheduled along with the CPUs. Now that
CPUs are devices, their scheduling will be moved over to this
logic eventually.
Changed various NVRAM devices to fetch their default memory region
from the device->region rather than specifying it in the
configuration.
Moved a number of CPUINFO_PTR_* constants to CPUINFO_FCT_*.
Fixed several drivers that manually created their own gfx_elements
to fill in the machine object, so they no longer crash.
Fixed incorrect CPU display on info screen (recently broken).
Moved device startup to *before* the DRIVER_INIT is called. This
is to allow the DRIVER_INIT to configure devices that have been
properly allocated. So far I don't see any negative effects, but
be on the lookout if something weird shows up.
Rewrote the device iteration logic to make use of the typenext
field and the newly-introduced classnext field for iterating more
efficiently through devices of a given type or class.
Fixed behavior of MDRV_CPU_REPLACE so it does not delete and then
re-add a CPU (causing the order to change).
Diffstat (limited to 'src/emu/cpuexec.h')
-rw-r--r-- | src/emu/cpuexec.h | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/emu/cpuexec.h b/src/emu/cpuexec.h index ed50050c2eb..6bd1933259d 100644 --- a/src/emu/cpuexec.h +++ b/src/emu/cpuexec.h @@ -58,7 +58,6 @@ struct _cpu_config { cpu_type type; /* index for the CPU type */ UINT32 flags; /* flags; see #defines below */ - UINT32 clock; /* in Hertz */ const addrmap_token *address_map[ADDRESS_SPACES]; /* 2 memory maps per address space */ const addrmap_token *address_map2[ADDRESS_SPACES]; /* 2 memory maps per address space */ cpu_interrupt_func vblank_interrupt; /* for interrupts tied to VBLANK */ @@ -75,9 +74,8 @@ struct _cpu_config ***************************************************************************/ #define MDRV_CPU_ADD(_tag, _type, _clock) \ - MDRV_DEVICE_ADD(_tag, CPU) \ - MDRV_DEVICE_CONFIG_DATAPTR(cpu_config, type, CPU_##_type) \ - MDRV_DEVICE_CONFIG_DATA32(cpu_config, clock, _clock) + MDRV_DEVICE_ADD(_tag, CPU, _clock) \ + MDRV_DEVICE_CONFIG_DATAPTR(cpu_config, type, CPU_##_type) #define MDRV_CPU_REMOVE(_tag) \ MDRV_DEVICE_REMOVE(_tag, CPU) @@ -85,11 +83,16 @@ struct _cpu_config #define MDRV_CPU_MODIFY(_tag) \ MDRV_DEVICE_MODIFY(_tag, CPU) +#define MDRV_CPU_TYPE(_type) \ + MDRV_DEVICE_CONFIG_DATAPTR(cpu_config, type, CPU_##_type) + +#define MDRV_CPU_CLOCK(_clock) \ + MDRV_DEVICE_CLOCK(_clock) + #define MDRV_CPU_REPLACE(_tag, _type, _clock) \ - MDRV_DEVICE_REMOVE(_tag, CPU) \ - MDRV_DEVICE_ADD(_tag, CPU) \ + MDRV_DEVICE_MODIFY(_tag, CPU) \ MDRV_DEVICE_CONFIG_DATAPTR(cpu_config, type, CPU_##_type) \ - MDRV_DEVICE_CONFIG_DATA32(cpu_config, clock, _clock) + MDRV_DEVICE_CLOCK(_clock) #define MDRV_CPU_FLAGS(_flags) \ MDRV_DEVICE_CONFIG_DATA32(cpu_config, flags, _flags) |