Core: let the stack pointer equal end of rdram

This commit is contained in:
zilmar 2023-09-07 11:13:54 +09:30
parent 7199096748
commit ab03916a70
2 changed files with 3 additions and 3 deletions

View File

@ -1484,7 +1484,7 @@ void CN64System::SyncCPU(CN64System * const SecondCPU)
{
uint32_t StackPointer = (m_Reg.m_GPR[29].W[0] & 0x1FFFFFFF);
uint8_t * TargetStackPos = nullptr;
if (StackPointer < m_MMU_VM.RdramSize())
if (StackPointer <= m_MMU_VM.RdramSize())
{
TargetStackPos = m_MMU_VM.Rdram() + StackPointer;
}
@ -1669,7 +1669,7 @@ void CN64System::DumpSyncErrors(CN64System * SecondCPU)
{
uint32_t StackPointer = (m_Reg.m_GPR[29].W[0] & 0x1FFFFFFF);
uint8_t * TargetStackPos = nullptr;
if (StackPointer < m_MMU_VM.RdramSize())
if (StackPointer <= m_MMU_VM.RdramSize())
{
TargetStackPos = m_MMU_VM.Rdram() + StackPointer;
}

View File

@ -535,7 +535,7 @@ void CRecompiler::ResetMemoryStackPos()
uint32_t pAddr = 0;
if (m_MMU.VAddrToPAddr(m_Registers.m_GPR[29].UW[0], pAddr))
{
if (pAddr < m_MMU.RdramSize())
if (pAddr <= m_MMU.RdramSize())
{
m_MemoryStack = m_MMU.Rdram() + pAddr;
}