OSDN Git Service

[VM][State] Apply new state framework to some VMs.
[csp-qt/common_source_project-fm7.git] / source / src / vm / ex80 / display.cpp
index f61b318..a92cc31 100644 (file)
@@ -324,43 +324,16 @@ void DISPLAY::draw_screen()
 
 #define STATE_VERSION  1
 
-#include "../../statesub.h"
-
-void DISPLAY::decl_state()
-{
-       enter_decl_state(STATE_VERSION);
-       DECL_STATE_ENTRY_INT32(odd_even);
-       DECL_STATE_ENTRY_BOOL(dma);
-       leave_decl_state();
-}
-
-void DISPLAY::save_state(FILEIO* state_fio)
+bool DISPLAY::process_state(FILEIO* state_fio, bool loading)
 {
-       if(state_entry != NULL) {
-               state_entry->save_state(state_fio);
+       if(!state_fio->StateCheckUint32(STATE_VERSION)) {
+               return false;
        }
-//     state_fio->FputUint32(STATE_VERSION);
-//     state_fio->FputInt32(this_device_id);
-       
-//     state_fio->FputInt32(odd_even);
-//     state_fio->FputBool(dma);
-}
-
-bool DISPLAY::load_state(FILEIO* state_fio)
-{
-       bool mb = false;
-       if(state_entry != NULL) {
-               mb = state_entry->load_state(state_fio);
+       if(!state_fio->StateCheckInt32(this_device_id)) {
+               return false;
        }
-       if(!mb) return false;
-//     if(state_fio->FgetUint32() != STATE_VERSION) {
-//             return false;
-//     }
-//     if(state_fio->FgetInt32() != this_device_id) {
-//             return false;
-//     }
-//     odd_even = state_fio->FgetInt32();
-//     dma = state_fio->FgetBool();
+       state_fio->StateInt32(odd_even);
+       state_fio->StateBool(dma);
        return true;
 }