Core: Allow reading from ISViewerHandler

This commit is contained in:
zilmar 2022-10-17 08:59:26 +10:30
parent 305648f02f
commit 9186dcab39
2 changed files with 14 additions and 1 deletions

View File

@ -15,7 +15,14 @@ ISViewerHandler::ISViewerHandler(CN64System & System) :
bool ISViewerHandler::Read32(uint32_t Address, uint32_t & Value)
{
Value = ((Address & 0xFFFF) << 16) | (Address & 0xFFFF);
if (!m_Data.empty())
{
Value = Swap32by8(*((uint32_t *)&m_Data[Address & 0xFFFC]));
}
else
{
Value = ((Address & 0xFFFF) << 16) | (Address & 0xFFFF);
}
return true;
}

View File

@ -730,6 +730,7 @@ bool CMipsMemoryVM::LW_NonMemory(uint32_t VAddr, uint32_t & Value)
case 0x05000000: m_CartridgeDomain2Address1Handler.Read32(PAddr, Value); break;
case 0x06000000: m_CartridgeDomain1Address1Handler.Read32(PAddr, Value); break;
case 0x08000000: m_CartridgeDomain2Address2Handler.Read32(PAddr, Value); break;
case 0x13F00000: m_ISViewerHandler.Read32(PAddr, Value); break;
case 0x1FC00000: m_PifRamHandler.Read32(PAddr, Value); break;
case 0x1FF00000: m_CartridgeDomain1Address3Handler.Read32(PAddr, Value); break;
default:
@ -737,6 +738,11 @@ bool CMipsMemoryVM::LW_NonMemory(uint32_t VAddr, uint32_t & Value)
{
m_RomMemoryHandler.Read32(PAddr, Value);
}
else if (BreakOnUnhandledMemory())
{
g_Notify->BreakPoint(__FILE__, __LINE__);
Value = ((PAddr & 0xFFFF) << 16) | (PAddr & 0xFFFF);
}
else
{
Value = ((PAddr & 0xFFFF) << 16) | (PAddr & 0xFFFF);