summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/state.h
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2008-04-11 05:41:46 +0000
committer Aaron Giles <aaron@aarongiles.com>2008-04-11 05:41:46 +0000
commitdbb98c547380ba8c6148f9f49b9bbb81a15d89e5 (patch)
tree325ff3b39776788b20e5a6d02c0428524b1152c3 /src/emu/state.h
parent6331c8d69950041543552fc528018a373e1091ae (diff)
Reduced the number of save state callback types from 3 to 1. The
only remaining form is the one that takes a pointer parameter. Added macros for STATE_PRESAVE and STATE_POSTLOAD to define common functions. Added machine parameter to these functions. Updated all drivers and CPU/sound cores to use the new macros and consolidate on the single function type. As a result pushed the machine parameter through a few initialization stacks. Removed unnecessary postload callbacks which only marked all tiles dirty, since this is done automatically by the tilemap engine.
Diffstat (limited to 'src/emu/state.h')
-rw-r--r--src/emu/state.h23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/emu/state.h b/src/emu/state.h
index b68d46a6fe5..fbe95becdb9 100644
--- a/src/emu/state.h
+++ b/src/emu/state.h
@@ -19,9 +19,22 @@
/***************************************************************************
+ TYPE DEFINTIONS
+***************************************************************************/
+
+typedef void (*state_presave_func)(running_machine *machine, void *param);
+typedef void (*state_postload_func)(running_machine *machine, void *param);
+
+
+
+/***************************************************************************
MACROS
***************************************************************************/
+#define STATE_PRESAVE(name) void name(running_machine *machine, void *param)
+#define STATE_POSTLOAD(name) void name(running_machine *machine, void *param)
+
+
#define IS_COMPATIBLE_TYPE(_valtype, _checktype) \
(sizeof(_valtype) == sizeof(_checktype) && TYPES_COMPATIBLE(typeof(_valtype), _checktype))
@@ -88,14 +101,8 @@ int state_save_get_reg_count(void);
void state_save_register_memory(const char *module, UINT32 instance, const char *name, void *val, UINT32 valsize, UINT32 valcount);
void state_save_register_bitmap(const char *module, UINT32 instance, const char *name, bitmap_t *val);
-void state_save_register_func_presave(void (*func)(void));
-void state_save_register_func_postload(void (*func)(void));
-
-void state_save_register_func_presave_int(void (*func)(int), int param);
-void state_save_register_func_postload_int(void (*func)(int), int param);
-
-void state_save_register_func_presave_ptr(void (*func)(void *), void *param);
-void state_save_register_func_postload_ptr(void (*func)(void *), void *param);
+void state_save_register_presave(running_machine *machine, state_presave_func func, void *param);
+void state_save_register_postload(running_machine *machine, state_postload_func func, void *param);
/* Save and load functions */
/* The tags are a hack around the current cpu structures */