diff options
author | 2010-08-26 15:21:19 +0000 | |
---|---|---|
committer | 2010-08-26 15:21:19 +0000 | |
commit | 47dd9fe5680add9e438e75d71ce476b082382fdf (patch) | |
tree | 55f9ab6e9fe1351cbff6992924197ed9a6a33e26 /src/emu/diexec.h | |
parent | 33e4664bb21d437c5b8fee3c470b00084d0d9d8a (diff) |
De-converted MACHINE_DRIVER from tokens back to constructor functions, regaining
type safety. If legacy devices still use inline data, those types are not checked.
However, new devices no longer have access to the generic m_inline_data. Instead
their MDRV_* macros should map to calls to static functions in the device config
class which downcast a generic device_config to the specific device config, and
then set the appropriate values. This is not to be done inline in order to prevent
further code bloat in the constructors. See eeprom/7474/i2cmem/okim6295 for examples.
#ifdef'ed several unused machine driver definitions that weren't referenced.
Diffstat (limited to 'src/emu/diexec.h')
-rw-r--r-- | src/emu/diexec.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/emu/diexec.h b/src/emu/diexec.h index 27d1cd0b28f..809c6dbae61 100644 --- a/src/emu/diexec.h +++ b/src/emu/diexec.h @@ -109,17 +109,13 @@ enum //************************************************************************** #define MDRV_DEVICE_DISABLE() \ - TOKEN_UINT32_PACK1(MCONFIG_TOKEN_DIEXEC_DISABLE, 8), \ + device_config_execute_interface::static_set_disable(device); \ #define MDRV_DEVICE_VBLANK_INT(_tag, _func) \ - TOKEN_UINT32_PACK2(MCONFIG_TOKEN_DIEXEC_VBLANK_INT, 8, 0, 24), \ - TOKEN_PTR(device_interrupt, _func), \ - TOKEN_PTR(stringptr, _tag), \ + device_config_execute_interface::static_set_vblank_int(device, _func, _tag); \ #define MDRV_DEVICE_PERIODIC_INT(_func, _rate) \ - TOKEN_UINT32_PACK1(MCONFIG_TOKEN_DIEXEC_PERIODIC_INT, 8), \ - TOKEN_PTR(device_interrupt, _func), \ - TOKEN_UINT64(UINT64_ATTOTIME_IN_HZ(_rate)), \ + device_config_execute_interface::static_set_periodic_int(device, _func, ATTOTIME_IN_HZ(_rate)); \ @@ -164,6 +160,11 @@ public: UINT32 input_lines() const { return execute_input_lines(); } UINT32 default_irq_vector() const { return execute_default_irq_vector(); } + // static inline helpers + static void static_set_disable(device_config *device); + static void static_set_vblank_int(device_config *device, device_interrupt_func function, const char *tag, int rate = 0); + static void static_set_periodic_int(device_config *device, device_interrupt_func function, attotime rate); + protected: // clock and cycle information getters virtual UINT64 execute_clocks_to_cycles(UINT64 clocks) const; @@ -176,7 +177,6 @@ protected: virtual UINT32 execute_default_irq_vector() const; // optional operation overrides - virtual bool interface_process_token(UINT32 entrytype, const machine_config_token *&tokens); virtual bool interface_validity_check(const game_driver &driver) const; bool m_disabled; @@ -184,7 +184,7 @@ protected: int m_vblank_interrupts_per_frame; // usually 1 const char * m_vblank_interrupt_screen; // the screen that causes the VBLANK interrupt device_interrupt_func m_timed_interrupt; // for interrupts not tied to VBLANK - UINT64 m_timed_interrupt_period; // period for periodic interrupts + attotime m_timed_interrupt_period; // period for periodic interrupts }; |