mirror of
https://github.com/dingusdev/dingusppc.git
synced 2025-01-28 07:30:20 +00:00
memctrlbase: add get_region_hostmem_ptr().
This commit is contained in:
parent
e94be9acee
commit
e722ef3e8a
@ -350,3 +350,14 @@ AddressMapEntry* MemCtrlBase::find_rom_region()
|
|||||||
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint8_t *MemCtrlBase::get_region_hostmem_ptr(const uint32_t addr) {
|
||||||
|
AddressMapEntry *reg_desc = this->find_range(addr);
|
||||||
|
if (reg_desc == nullptr || reg_desc->type == RT_MMIO)
|
||||||
|
return nullptr;
|
||||||
|
|
||||||
|
if (reg_desc->type == RT_MIRROR)
|
||||||
|
return (addr - reg_desc->mirror) + reg_desc->mem_ptr;
|
||||||
|
else
|
||||||
|
return (addr - reg_desc->start) + reg_desc->mem_ptr;
|
||||||
|
}
|
||||||
|
@ -86,6 +86,8 @@ public:
|
|||||||
|
|
||||||
AddressMapEntry* find_rom_region();
|
AddressMapEntry* find_rom_region();
|
||||||
|
|
||||||
|
uint8_t *get_region_hostmem_ptr(const uint32_t addr);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool add_mem_region(
|
bool add_mem_region(
|
||||||
uint32_t start_addr, uint32_t size, uint32_t dest_addr, uint32_t type,
|
uint32_t start_addr, uint32_t size, uint32_t dest_addr, uint32_t type,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user