OSDN Git Service

[VM] .
[csp-qt/common_source_project-fm7.git] / source / src / vm / fmr30 / system.cpp
index d0c9c3f..10c2936 100644 (file)
@@ -7,15 +7,17 @@
        [ system ]
 */
 
-#include "system.h"
+#include "./system.h"
 
+namespace FMR30 {
+       
 void SYSTEM::initialize()
 {
        arr = nmistat = 0;
        nmimask = 0xf0;
 }
 
-void SYSTEM::write_io8(uint32 addr, uint32 data)
+void SYSTEM::write_io8(uint32_t addr, uint32_t data)
 {
        switch(addr & 0xffff) {
        case 0x46:
@@ -30,7 +32,7 @@ void SYSTEM::write_io8(uint32 addr, uint32 data)
        }
 }
 
-uint32 SYSTEM::read_io8(uint32 addr)
+uint32_t SYSTEM::read_io8(uint32_t addr)
 {
        switch(addr & 0xffff) {
        case 0x18:
@@ -54,3 +56,21 @@ uint32 SYSTEM::read_io8(uint32 addr)
        return 0xff;
 }
 
+#define STATE_VERSION  1
+
+
+bool SYSTEM::process_state(FILEIO* state_fio, bool loading)
+{
+       if(!state_fio->StateCheckUint32(STATE_VERSION)) {
+               return false;
+       }
+       if(!state_fio->StateCheckInt32(this_device_id)) {
+               return false;
+       }
+       state_fio->StateUint8(arr);
+       state_fio->StateUint8(nmistat);
+       state_fio->StateUint8(nmimask);
+       return true;
+}
+
+}