OSDN Git Service

[VM][WIP] Use namespace to devices per VMs.
[csp-qt/common_source_project-fm7.git] / source / src / vm / hc40 / io.h
index b5851bd..f943273 100644 (file)
@@ -7,8 +7,8 @@
        [ i/o ]
 */
 
-#ifndef _IO_H_
-#define _IO_H_
+#ifndef _HC40_IO_H_
+#define _HC40_IO_H_
 
 #include "../vm.h"
 #include "../../emu.h"
@@ -19,6 +19,8 @@
 
 class FIFO;
 
+namespace HC40 {
+       
 class IO : public DEVICE
 {
 private:
@@ -41,7 +43,7 @@ private:
        uint8_t rec_from_7508();
        FIFO *cmd_buf, *rsp_buf;
        // rtc
-       cur_time_t cur_time;
+       dll_cur_time_t cur_time;
        int register_id_1sec;
        bool onesec_intr, onesec_intr_enb;
        bool alarm_intr, alarm_intr_enb;
@@ -71,7 +73,7 @@ private:
        scrntype_t pd, pb;
        
 public:
-       IO(VM* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu)
+       IO(VM_TEMPLATE* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu)
        {
                set_device_name(_T("I/O Bus"));
        }
@@ -88,8 +90,7 @@ public:
        void write_io8(uint32_t addr, uint32_t data);
        uint32_t read_io8(uint32_t addr);
        uint32_t get_intr_ack();
-       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_cpu(DEVICE* device)
@@ -118,4 +119,5 @@ public:
        void key_up(int code);
 };
 
+}
 #endif