diff options
author | MooglyGuy <therealmogminer@gmail.com> | 2018-05-16 09:37:54 +0200 |
---|---|---|
committer | mooglyguy <therealmogminer@gmail.com> | 2018-05-16 11:58:08 +0200 |
commit | c83e2a853d4e1643fcc85b68ada3c6f7f33adea4 (patch) | |
tree | 39b249e1a0a9b2056e9815d0a284fd483338362c /src/emu | |
parent | 2242ff00893a83a113150609bd525f098d632e8d (diff) |
- Removed MACHINE/SOUND/VIDEO _START/_RESET macros. This has the side effect of making machine-config overrides of these much
uglier, but this is intended to discourage ongoing use, and will be gradually eliminated.
Diffstat (limited to 'src/emu')
-rw-r--r-- | src/emu/driver.h | 63 |
1 files changed, 7 insertions, 56 deletions
diff --git a/src/emu/driver.h b/src/emu/driver.h index 5711012188e..ce23c486e6c 100644 --- a/src/emu/driver.h +++ b/src/emu/driver.h @@ -22,67 +22,11 @@ // CONFIGURATION MACROS //************************************************************************** -// core machine callbacks -#define MCFG_MACHINE_START_OVERRIDE(_class, _func) \ - driver_device::static_set_callback(config.root_device(), driver_device::CB_MACHINE_START, driver_callback_delegate(&_class::MACHINE_START_NAME(_func), this)); - -#define MCFG_MACHINE_RESET_OVERRIDE(_class, _func) \ - driver_device::static_set_callback(config.root_device(), driver_device::CB_MACHINE_RESET, driver_callback_delegate(&_class::MACHINE_RESET_NAME(_func), this)); - -#define MCFG_MACHINE_RESET_REMOVE() \ - driver_device::static_set_callback(config.root_device(), driver_device::CB_MACHINE_RESET, driver_callback_delegate()); - -// core sound callbacks -#define MCFG_SOUND_START_OVERRIDE(_class, _func) \ - driver_device::static_set_callback(config.root_device(), driver_device::CB_SOUND_START, driver_callback_delegate(&_class::SOUND_START_NAME(_func), this)); - -#define MCFG_SOUND_RESET_OVERRIDE(_class, _func) \ - driver_device::static_set_callback(config.root_device(), driver_device::CB_SOUND_RESET, driver_callback_delegate(&_class::SOUND_RESET_NAME(_func), this)); - - -// core video callbacks -#define MCFG_VIDEO_START_OVERRIDE(_class, _func) \ - driver_device::static_set_callback(config.root_device(), driver_device::CB_VIDEO_START, driver_callback_delegate(&_class::VIDEO_START_NAME(_func), this)); - -#define MCFG_VIDEO_RESET_OVERRIDE(_class, _func) \ - driver_device::static_set_callback(config.root_device(), driver_device::CB_VIDEO_RESET, driver_callback_delegate(&_class::VIDEO_RESET_NAME(_func), this)); - - //************************************************************************** // OTHER MACROS //************************************************************************** -#define MACHINE_START_NAME(name) machine_start_##name -#define MACHINE_START_CALL_MEMBER(name) MACHINE_START_NAME(name)() -#define DECLARE_MACHINE_START(name) void MACHINE_START_NAME(name)() ATTR_COLD -#define MACHINE_START_MEMBER(cls,name) void cls::MACHINE_START_NAME(name)() - -#define MACHINE_RESET_NAME(name) machine_reset_##name -#define MACHINE_RESET_CALL_MEMBER(name) MACHINE_RESET_NAME(name)() -#define DECLARE_MACHINE_RESET(name) void MACHINE_RESET_NAME(name)() -#define MACHINE_RESET_MEMBER(cls,name) void cls::MACHINE_RESET_NAME(name)() - -#define SOUND_START_NAME(name) sound_start_##name -#define DECLARE_SOUND_START(name) void SOUND_START_NAME(name)() ATTR_COLD -#define SOUND_START_MEMBER(cls,name) void cls::SOUND_START_NAME(name)() - -#define SOUND_RESET_NAME(name) sound_reset_##name -#define SOUND_RESET_CALL_MEMBER(name) SOUND_RESET_NAME(name)() -#define DECLARE_SOUND_RESET(name) void SOUND_RESET_NAME(name)() -#define SOUND_RESET_MEMBER(cls,name) void cls::SOUND_RESET_NAME(name)() - -#define VIDEO_START_NAME(name) video_start_##name -#define VIDEO_START_CALL_MEMBER(name) VIDEO_START_NAME(name)() -#define DECLARE_VIDEO_START(name) void VIDEO_START_NAME(name)() ATTR_COLD -#define VIDEO_START_MEMBER(cls,name) void cls::VIDEO_START_NAME(name)() - -#define VIDEO_RESET_NAME(name) video_reset_##name -#define VIDEO_RESET_CALL_MEMBER(name) VIDEO_RESET_NAME(name)() -#define DECLARE_VIDEO_RESET(name) void VIDEO_RESET_NAME(name)() -#define VIDEO_RESET_MEMBER(cls,name) void cls::VIDEO_RESET_NAME(name)() - - //************************************************************************** // TYPE DEFINITIONS @@ -120,6 +64,13 @@ public: // inline configuration helpers void set_game_driver(const game_driver &game); static void static_set_callback(device_t &device, callback_type type, driver_callback_delegate callback); + static void set_machine_start_cb(machine_config &config, driver_callback_delegate callback) { static_set_callback(config.root_device(), CB_MACHINE_START, callback); } + static void set_machine_reset_cb(machine_config &config, driver_callback_delegate callback) { static_set_callback(config.root_device(), CB_MACHINE_RESET, callback); } + static void set_sound_start_cb(machine_config &config, driver_callback_delegate callback) { static_set_callback(config.root_device(), CB_SOUND_START, callback); } + static void set_sound_reset_cb(machine_config &config, driver_callback_delegate callback) { static_set_callback(config.root_device(), CB_SOUND_RESET, callback); } + static void set_video_start_cb(machine_config &config, driver_callback_delegate callback) { static_set_callback(config.root_device(), CB_VIDEO_START, callback); } + static void set_video_reset_cb(machine_config &config, driver_callback_delegate callback) { static_set_callback(config.root_device(), CB_VIDEO_RESET, callback); } + static void remove_machine_reset_cb(machine_config &config) { static_set_callback(config.root_device(), CB_MACHINE_RESET, driver_callback_delegate()); } // dummy driver_init callback void empty_init(); |