Core: have MemoryValue32 be able to read from rom
This commit is contained in:
parent
718d7e0359
commit
1fe8fd1299
|
@ -43,7 +43,8 @@ CMipsMemoryVM::CMipsMemoryVM(CN64System & System, bool SavesReadOnly) :
|
|||
m_TLB_WriteMap(nullptr),
|
||||
m_RDRAM(nullptr),
|
||||
m_DMEM(nullptr),
|
||||
m_IMEM(nullptr)
|
||||
m_IMEM(nullptr),
|
||||
m_Rom(*g_Rom)
|
||||
{
|
||||
g_Settings->RegisterChangeCB(Game_RDRamSize, this, (CSettings::SettingChangedFunc)RdramChanged);
|
||||
}
|
||||
|
@ -343,6 +344,18 @@ bool CMipsMemoryVM::MemoryValue32(uint32_t VAddr, uint32_t& Value)
|
|||
Value = *(uint32_t*)(m_IMEM + (PAddr - 0x04001000));
|
||||
return true;
|
||||
}
|
||||
if (PAddr >= 0x10000000 && PAddr < 0x16000000)
|
||||
{
|
||||
if ((PAddr & 0xFFFFFFF) < m_Rom.GetRomSize())
|
||||
{
|
||||
Value = *(uint32_t *)&m_Rom.GetRomAddress()[(PAddr & 0xFFFFFFF)];
|
||||
}
|
||||
else
|
||||
{
|
||||
Value = (PAddr << 16) | (PAddr & 0xFFFF);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
g_Notify->BreakPoint(__FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -184,6 +184,7 @@ private:
|
|||
VideoInterfaceHandler m_VideoInterfaceHandler;
|
||||
uint8_t * m_RDRAM, *m_DMEM, *m_IMEM;
|
||||
uint32_t m_AllocatedRdramSize;
|
||||
CN64Rom & m_Rom;
|
||||
|
||||
mutable char m_strLabelName[100];
|
||||
uint32_t * m_TLB_ReadMap;
|
||||
|
|
Loading…
Reference in New Issue