OSDN Git Service

[VM][DEVICE] Add address_translate() API to generic devices.
authorK.Ohta <whatisthis.sowhat@gmail.com>
Tue, 23 Apr 2019 14:41:48 +0000 (23:41 +0900)
committerK.Ohta <whatisthis.sowhat@gmail.com>
Tue, 23 Apr 2019 14:41:48 +0000 (23:41 +0900)
source/src/vm/device.h
source/src/vm/libcpu_newdev/device.cpp
source/src/vm/libcpu_newdev/device.h

index 772e526..ed57aed 100644 (file)
@@ -631,6 +631,7 @@ public:
        virtual bool bios_ret_z80(uint16_t PC, pair32_t* af, pair32_t* bc, pair32_t* de, pair32_t* hl, pair32_t* ix, pair32_t* iy, uint8_t* iff1)       {
                return false;
        }
+       virtual bool address_translate(int space, int intention, uint64_t &taddress) { return true; /* If not present, always succeeded.*/ }
        // misc
        const _TCHAR *get_device_name(void)
        {
index 0752588..c1f4ea8 100644 (file)
@@ -631,3 +631,8 @@ const _TCHAR *DEVICE::get_lib_common_vm_version(void)
        return (const _TCHAR *)"\0";
 #endif 
 }
+
+bool DEVICE::address_translate(int space, int intention, uint64_t &taddress)
+{
+       return true; // If don't present address translation, translation succeed.
+}
index b0ad538..b05e670 100644 (file)
@@ -532,6 +532,7 @@ public:
        {
                return (const _TCHAR *)this_device_name;
        }
+       virtual bool address_translate(int space, int intention, uint64_t &taddress);
    
        // event manager
        DEVICE* event_manager;
@@ -663,7 +664,6 @@ public:
 
        // misc
        const _TCHAR *get_lib_common_vm_version(void);
-
        _TCHAR this_device_name[128];
        
        // device node using with iterator.