summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2010-06-11 15:19:59 +0000
committer Aaron Giles <aaron@aarongiles.com>2010-06-11 15:19:59 +0000
commit6e075a382388de032a1dd3ad8271d70728590a27 (patch)
tree5920700352c820a386929321bc9dacf60604d8af
parentf523ad192daa7c7ab31cd309018bbb74d3709a87 (diff)
Add back the validity check support for legacy devices to help MESS.
-rw-r--r--src/emu/devlegcy.c14
-rw-r--r--src/emu/devlegcy.h9
2 files changed, 23 insertions, 0 deletions
diff --git a/src/emu/devlegcy.c b/src/emu/devlegcy.c
index 1caaaeada8d..7bb660e5af9 100644
--- a/src/emu/devlegcy.c
+++ b/src/emu/devlegcy.c
@@ -124,6 +124,20 @@ const char *legacy_device_config_base::get_legacy_config_string(UINT32 state) co
}
+//-------------------------------------------------
+// device_validity_check - perform validity
+// checks on a device configuration
+//-------------------------------------------------
+
+bool legacy_device_config_base::device_validity_check(const game_driver &driver) const
+{
+ device_validity_check_func validity_func = reinterpret_cast<device_validity_check_func>(get_legacy_config_fct(DEVINFO_FCT_VALIDITY_CHECK));
+ if (validity_func != NULL)
+ return (*validity_func)(&driver, this);
+ return false;
+}
+
+
//**************************************************************************
// LIVE LEGACY DEVICE
diff --git a/src/emu/devlegcy.h b/src/emu/devlegcy.h
index 2632dccbfd7..e89325661b3 100644
--- a/src/emu/devlegcy.h
+++ b/src/emu/devlegcy.h
@@ -113,6 +113,7 @@ enum
DEVINFO_FCT_RESET, // R/O: device_reset_func
DEVINFO_FCT_EXECUTE, // R/O: device_execute_func
DEVINFO_FCT_NVRAM, // R/O: device_nvram_func
+ DEVINFO_FCT_VALIDITY_CHECK, // R/O: device_validity_check_func
DEVINFO_FCT_CLASS_SPECIFIC = 0x24000, // R/W: device-specific values start here
DEVINFO_FCT_DEVICE_SPECIFIC = 0x28000, // R/W: device-specific values start here
@@ -142,6 +143,10 @@ enum
#define DEVICE_GET_INFO(name) void DEVICE_GET_INFO_NAME(name)(const device_config *device, UINT32 state, deviceinfo *info)
#define DEVICE_GET_INFO_CALL(name) DEVICE_GET_INFO_NAME(name)(device, state, info)
+#define DEVICE_VALIDITY_CHECK_NAME(name) device_validity_check_##name
+#define DEVICE_VALIDITY_CHECK(name) int DEVICE_VALIDITY_CHECK_NAME(name)(const game_driver *driver, const device_config *device)
+#define DEVICE_VALIDITY_CHECK_CALL(name) DEVICE_VALIDITY_CHECK_NAME(name)(driver, device)
+
#define DEVICE_START_NAME(name) device_start_##name
#define DEVICE_START(name) void DEVICE_START_NAME(name)(device_t *device)
#define DEVICE_START_CALL(name) DEVICE_START_NAME(name)(device)
@@ -333,6 +338,7 @@ resource_pool &machine_get_pool(running_machine &machine);
// device interface function types
typedef void (*device_get_config_func)(const device_config *device, UINT32 state, deviceinfo *info);
+typedef int (*device_validity_check_func)(const game_driver *driver, const device_config *device);
typedef void (*device_start_func)(device_t *device);
typedef void (*device_stop_func)(device_t *device);
@@ -392,6 +398,9 @@ public:
void *inline_config() const { return m_inline_config; }
protected:
+ // overrides
+ virtual bool device_validity_check(const game_driver &driver) const;
+
// access to legacy configuration info
INT64 get_legacy_config_int(UINT32 state) const;
void *get_legacy_config_ptr(UINT32 state) const;