OSDN Git Service

[VM][STATE] Apply new framework to some VMs.
[csp-qt/common_source_project-fm7.git] / source / src / vm / mz5500 / sysport.cpp
index d9fc80c..96a9b49 100644 (file)
@@ -68,25 +68,15 @@ void SYSPORT::event_frame()
 
 #define STATE_VERSION  1
 
-void SYSPORT::save_state(FILEIO* state_fio)
+bool SYSPORT::process_state(FILEIO* state_fio, bool loading)
 {
-       state_fio->FputUint32(STATE_VERSION);
-       state_fio->FputInt32(this_device_id);
-       
-       state_fio->FputInt32(rst);
-       state_fio->FputInt32(highden);
-}
-
-bool SYSPORT::load_state(FILEIO* state_fio)
-{
-       if(state_fio->FgetUint32() != STATE_VERSION) {
+       if(!state_fio->StateCheckUint32(STATE_VERSION)) {
                return false;
        }
-       if(state_fio->FgetInt32() != this_device_id) {
+       if(!state_fio->StateCheckInt32(this_device_id)) {
                return false;
        }
-       rst = state_fio->FgetInt32();
-       highden = state_fio->FgetInt32();
+       state_fio->StateInt32(rst);
+       state_fio->StateInt32(highden);
        return true;
 }
-