OSDN Git Service

[VM][WIP] Use namespace to devices per VMs.
[csp-qt/common_source_project-fm7.git] / source / src / vm / mz700 / cmos.cpp
index 441dc88..c26201a 100644 (file)
@@ -14,6 +14,8 @@
 #define DATA_SIZE      0x8000
 #define ADDR_MASK      (DATA_SIZE - 1)
 
+namespace MZ700 {
+       
 void CMOS::initialize()
 {
        // init memory
@@ -84,53 +86,6 @@ uint32_t CMOS::read_io8(uint32_t addr)
 
 #define STATE_VERSION  1
 
-#include "../../statesub.h"
-
-void CMOS::decl_state()
-{
-       enter_decl_state(STATE_VERSION);
-       
-       DECL_STATE_ENTRY_1D_ARRAY(data_buffer, DATA_SIZE);
-       DECL_STATE_ENTRY_UINT32(data_addr);
-       DECL_STATE_ENTRY_BOOL(modified);
-       
-       leave_decl_state();
-}
-
-void CMOS::save_state(FILEIO* state_fio)
-{
-       if(state_entry != NULL) {
-               state_entry->save_state(state_fio);
-       }
-//     state_fio->FputUint32(STATE_VERSION);
-//     state_fio->FputInt32(this_device_id);
-//     
-//     state_fio->Fwrite(data_buffer, DATA_SIZE, 1);
-//     state_fio->FputUint32(data_addr);
-//     state_fio->FputBool(modified);
-}
-
-bool CMOS::load_state(FILEIO* state_fio)
-{
-       bool mb = false;
-       if(state_entry != NULL) {
-               mb = state_entry->load_state(state_fio);
-       }
-       if(!mb) {
-               return false;
-       }
-//     if(state_fio->FgetUint32() != STATE_VERSION) {
-//             return false;
-//     }
-//     if(state_fio->FgetInt32() != this_device_id) {
-//             return false;
-//     }
-//     state_fio->Fread(data_buffer, DATA_SIZE, 1);
-//     data_addr = state_fio->FgetUint32();
-//     modified = state_fio->FgetBool();
-       return true;
-}
-
 bool CMOS::process_state(FILEIO* state_fio, bool loading)
 {
        if(!state_fio->StateCheckUint32(STATE_VERSION)) {
@@ -144,3 +99,5 @@ bool CMOS::process_state(FILEIO* state_fio, bool loading)
        state_fio->StateBool(modified);
        return true;
 }
+
+}