trunk/src/emu/devlegcy.h
| r17574 | r17575 | |
| 114 | 114 | DEVINFO_FCT_START = DEVINFO_FCT_FIRST, // R/O: device_start_func |
| 115 | 115 | DEVINFO_FCT_STOP, // R/O: device_stop_func |
| 116 | 116 | DEVINFO_FCT_RESET, // R/O: device_reset_func |
| 117 | | DEVINFO_FCT_EXECUTE, // R/O: device_execute_func |
| 118 | | DEVINFO_FCT_NVRAM, // R/O: device_nvram_func |
| 119 | | DEVINFO_FCT_VALIDITY_CHECK, // R/O: device_validity_check_func |
| 120 | 117 | |
| 121 | 118 | DEVINFO_FCT_CLASS_SPECIFIC = 0x24000, // R/W: device-specific values start here |
| 122 | 119 | DEVINFO_FCT_DEVICE_SPECIFIC = 0x28000, // R/W: device-specific values start here |
| r17574 | r17575 | |
| 185 | 182 | #define DEVICE_GET_INFO(name) void DEVICE_GET_INFO_NAME(name)(const device_t *device, UINT32 state, deviceinfo *info) |
| 186 | 183 | #define DEVICE_GET_INFO_CALL(name) DEVICE_GET_INFO_NAME(name)(device, state, info) |
| 187 | 184 | |
| 188 | | #define DEVICE_VALIDITY_CHECK_NAME(name) device_validity_check_##name |
| 189 | | #define DEVICE_VALIDITY_CHECK(name) int DEVICE_VALIDITY_CHECK_NAME(name)(const game_driver *driver, const device_t *device, emu_options &options) |
| 190 | | #define DEVICE_VALIDITY_CHECK_CALL(name) DEVICE_VALIDITY_CHECK_NAME(name)(driver, device) |
| 191 | | |
| 192 | 185 | #define DEVICE_START_NAME(name) device_start_##name |
| 193 | 186 | #define DEVICE_START(name) void DEVICE_START_NAME(name)(device_t *device) |
| 194 | 187 | #define DEVICE_START_CALL(name) DEVICE_START_NAME(name)(device) |
| r17574 | r17575 | |
| 201 | 194 | #define DEVICE_RESET(name) void DEVICE_RESET_NAME(name)(device_t *device) |
| 202 | 195 | #define DEVICE_RESET_CALL(name) DEVICE_RESET_NAME(name)(device) |
| 203 | 196 | |
| 204 | | #define DEVICE_EXECUTE_NAME(name) device_execute_##name |
| 205 | | #define DEVICE_EXECUTE(name) INT32 DEVICE_EXECUTE_NAME(name)(device_t *device, INT32 clocks) |
| 206 | | #define DEVICE_EXECUTE_CALL(name) DEVICE_EXECUTE_NAME(name)(device, clocks) |
| 207 | 197 | |
| 208 | | |
| 209 | 198 | //************************************************************************** |
| 210 | 199 | // DEVICE_CONFIGURATION_MACROS |
| 211 | 200 | //************************************************************************** |
| r17574 | r17575 | |
| 269 | 258 | |
| 270 | 259 | // device interface function types |
| 271 | 260 | typedef void (*device_get_config_func)(const device_t *device, UINT32 state, deviceinfo *info); |
| 272 | | typedef int (*device_validity_check_func)(const game_driver *driver, const device_t *device, emu_options &options); |
| 273 | 261 | |
| 274 | 262 | typedef void (*device_start_func)(device_t *device); |
| 275 | 263 | typedef void (*device_stop_func)(device_t *device); |
| 276 | | typedef INT32 (*device_execute_func)(device_t *device, INT32 clocks); |
| 277 | 264 | typedef void (*device_reset_func)(device_t *device); |
| 278 | | typedef void (*device_nvram_func)(device_t *device, emu_file *file, int read_or_write); |
| 279 | 265 | |
| 280 | 266 | // the actual deviceinfo union |
| 281 | 267 | union deviceinfo |
| r17574 | r17575 | |
| 288 | 274 | device_start_func start; // DEVINFO_FCT_START |
| 289 | 275 | device_stop_func stop; // DEVINFO_FCT_STOP |
| 290 | 276 | device_reset_func reset; // DEVINFO_FCT_RESET |
| 291 | | device_execute_func execute; // DEVINFO_FCT_EXECUTE |
| 292 | | device_nvram_func nvram; // DEVINFO_FCT_NVRAM |
| 293 | 277 | const rom_entry * romregion; // DEVINFO_PTR_ROM_REGION |
| 294 | 278 | machine_config_constructor machine_config; // DEVINFO_PTR_MACHINE_CONFIG |
| 295 | 279 | ioport_constructor ipt; // DEVINFO_PTR_INPUT_PORTS |
| r17574 | r17575 | |
| 331 | 315 | virtual const rom_entry *device_rom_region() const { return reinterpret_cast<const rom_entry *>(get_legacy_ptr(DEVINFO_PTR_ROM_REGION)); } |
| 332 | 316 | virtual machine_config_constructor device_mconfig_additions() const { return reinterpret_cast<machine_config_constructor>(get_legacy_ptr(DEVINFO_PTR_MACHINE_CONFIG)); } |
| 333 | 317 | virtual ioport_constructor device_input_ports() const { return reinterpret_cast<ioport_constructor>(get_legacy_ptr(DEVINFO_PTR_INPUT_PORTS)); } |
| 334 | | virtual void device_validity_check(validity_checker &valid) const; |
| 335 | 318 | virtual void device_start(); |
| 336 | 319 | virtual void device_reset(); |
| 337 | 320 | virtual void device_stop(); |