OSDN Git Service

[VM][STATE] Use namespace {VMNAME} to separate per VMs.
[csp-qt/common_source_project-fm7.git] / source / src / vm / qc10 / memory.cpp
index 5adab54..05b1912 100644 (file)
@@ -12,7 +12,9 @@
 #include "../pcm1bit.h"
 #include "../upd765a.h"
 
-#define SET_BANK(s, e, w, r) { \
+namespace QC10 {
+
+#define SET_BANK(s, e, w, r) {                 \
        int sb = (s) >> 11, eb = (e) >> 11; \
        for(int i = sb; i <= eb; i++) { \
                wbank[i] = (w) + 0x800 * (i - sb); \
@@ -182,80 +184,6 @@ void MEMORY::update_pcm()
 
 #define STATE_VERSION  1
 
-#include "../../statesub.h"
-
-void MEMORY::decl_state()
-{
-       enter_decl_state(STATE_VERSION);
-
-       DECL_STATE_ENTRY_1D_ARRAY(ram, sizeof(ram));
-       DECL_STATE_ENTRY_1D_ARRAY(cmos, sizeof(cmos));
-       DECL_STATE_ENTRY_UINT32(cmos_crc32);
-       DECL_STATE_ENTRY_UINT8(bank);
-       DECL_STATE_ENTRY_UINT8(psel);
-       DECL_STATE_ENTRY_UINT8(csel);
-       DECL_STATE_ENTRY_BOOL(pcm_on);
-       DECL_STATE_ENTRY_BOOL(pcm_cont);
-       DECL_STATE_ENTRY_BOOL(pcm_pit);
-       DECL_STATE_ENTRY_BOOL(fdc_irq);
-       DECL_STATE_ENTRY_BOOL(motor);
-       
-       leave_decl_state();
-}
-
-void MEMORY::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(ram, sizeof(ram), 1);
-//     state_fio->Fwrite(cmos, sizeof(cmos), 1);
-//     state_fio->FputUint32(cmos_crc32);
-//     state_fio->FputUint8(bank);
-//     state_fio->FputUint8(psel);
-//     state_fio->FputUint8(csel);
-//     state_fio->FputBool(pcm_on);
-//     state_fio->FputBool(pcm_cont);
-//     state_fio->FputBool(pcm_pit);
-//     state_fio->FputBool(fdc_irq);
-//     state_fio->FputBool(motor);
-}
-
-bool MEMORY::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(ram, sizeof(ram), 1);
-//     state_fio->Fread(cmos, sizeof(cmos), 1);
-//     cmos_crc32 = state_fio->FgetUint32();
-//     bank = state_fio->FgetUint8();
-//     psel = state_fio->FgetUint8();
-//     csel = state_fio->FgetUint8();
-//     pcm_on = state_fio->FgetBool();
-//     pcm_cont = state_fio->FgetBool();
-//     pcm_pit = state_fio->FgetBool();
-//     fdc_irq = state_fio->FgetBool();
-//     motor = state_fio->FgetBool();
-       
-       // post process
-       update_map();
-       return true;
-}
-
 bool MEMORY::process_state(FILEIO* state_fio, bool loading)
 {
        if(!state_fio->StateCheckUint32(STATE_VERSION)) {
@@ -282,3 +210,5 @@ bool MEMORY::process_state(FILEIO* state_fio, bool loading)
        }
        return true;
 }
+
+}