OSDN Git Service

[VM][WIP] Use namespace to devices per VMs.
[csp-qt/common_source_project-fm7.git] / source / src / vm / hc20 / memory.h
index e83a8db..7703fde 100644 (file)
@@ -7,8 +7,8 @@
        [ memory ]
 */
 
-#ifndef _MEMORY_H_
-#define _MEMORY_H_
+#ifndef _HC20_MEMORY_H_
+#define _HC20_MEMORY_H_
 
 #include "../vm.h"
 #include "../../emu.h"
@@ -26,6 +26,8 @@
 class BEEP;
 class FIFO;
 
+namespace HC20 {
+
 class MEMORY : public DEVICE
 {
 private:
@@ -81,6 +83,9 @@ private:
        
        int int_status;
        int int_mask;
+
+       bool tmp_wbank_is_ext;
+       bool tmp_rbank_is_ext;
        
        void update_sound();
        void update_keyboard();
@@ -89,8 +94,9 @@ private:
        void send_to_main(uint8_t val);
        
 public:
-       MEMORY(VM* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu) {
-               set_device_name(_T("MEMORY"));
+       MEMORY(VM_TEMPLATE* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu)
+       {
+               set_device_name(_T("Memory Bus"));
        }
        ~MEMORY() {}
        
@@ -102,8 +108,7 @@ public:
        uint32_t read_data8(uint32_t addr);
        void write_signal(int id, uint32_t data, uint32_t mask);
        void event_callback(int event_id, int err);
-       void save_state(FILEIO* state_fio);
-       bool load_state(FILEIO* state_fio);
+       bool process_state(FILEIO* state_fio, bool loading);
        
        // unique functions
        void set_context_beep(BEEP* device)
@@ -135,5 +140,6 @@ public:
        void draw_screen();
 };
 
+}
 #endif