From 4f7efb1ca4bcf00edd9e519167367f44d797186c Mon Sep 17 00:00:00 2001 From: Aaron Giles Date: Tue, 8 Feb 2011 06:48:39 +0000 Subject: Moved the state saving system to C++. For now the registration macros are still intact. The new state_manager class has templatized methods for saving the various types, and through template specialization can save more complex system types cleanly (like bitmaps and attotimes). Added new mechanism to detect proper state save types. This is much more strict and there will likely be some games/devices that fatalerror at startup until they are remedied. Spot checking has caught the more common situations. The new state_manager is embedded directly in the running_machine, allowing objects to register state saving in their constructors now. Added NAME() macro which is a generalization of FUNC() and can be used to wrap variables that are registered when directly using the new methods as opposed to the previous macros. For example: machine->state().save_item(NAME(global_item)) Added methods in the device_t class that implicitly register state against the current device, making for a cleaner interface. Just a couple of required regexes for now: state_save_register_postload( *)\(( *)([^,;]+), * \3->state().register_postload\1\(\2 state_save_register_presave( *)\(( *)([^,;]+), * \3->state().register_presave\1\(\2 --- src/emu/cpu/m68000/m68kcpu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/emu/cpu/m68000') diff --git a/src/emu/cpu/m68000/m68kcpu.c b/src/emu/cpu/m68000/m68kcpu.c index 4738f23dd37..2dbbc94fbc1 100644 --- a/src/emu/cpu/m68000/m68kcpu.c +++ b/src/emu/cpu/m68000/m68kcpu.c @@ -769,8 +769,8 @@ static CPU_INIT( m68k ) state_save_register_device_item(device, 0, m68k->save_halted); state_save_register_device_item(device, 0, m68k->pref_addr); state_save_register_device_item(device, 0, m68k->pref_data); - state_save_register_presave(device->machine, m68k_presave, m68k); - state_save_register_postload(device->machine, m68k_postload, m68k); + device->machine->state().register_presave(m68k_presave, m68k); + device->machine->state().register_postload(m68k_postload, m68k); } /* Pulse the RESET line on the CPU */ -- cgit v1.2.3-70-g09d2