OSDN Git Service

[VM][STATE] Apply new framework to some VMs.
[csp-qt/common_source_project-fm7.git] / source / src / vm / pasopia7 / keyboard.cpp
index 24e3f51..9e37232 100644 (file)
@@ -79,23 +79,14 @@ void KEYBOARD::create_key()
 
 #define STATE_VERSION  1
 
-void KEYBOARD::save_state(FILEIO* state_fio)
+bool KEYBOARD::process_state(FILEIO* state_fio, bool loading)
 {
-       state_fio->FputUint32(STATE_VERSION);
-       state_fio->FputInt32(this_device_id);
-       
-       state_fio->FputUint8(sel);
-}
-
-bool KEYBOARD::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;
        }
-       sel = state_fio->FgetUint8();
+       state_fio->StateUint8(sel);
        return true;
 }
-