Core: handle jump to unaligned addresses

This commit is contained in:
zilmar 2023-05-18 10:33:57 +09:30
parent 6e58edb076
commit 74912ca8c2
1 changed files with 5 additions and 1 deletions

View File

@ -130,7 +130,11 @@ void CInterpreterCPU::ExecuteCPU()
CheckTimer = (JumpToLocation < PROGRAM_COUNTER - 4 || TestTimer);
PROGRAM_COUNTER = JumpToLocation;
PipelineStage = PIPELINE_STAGE_NORMAL;
if (CheckTimer)
if ((PROGRAM_COUNTER & 0x3) != 0)
{
GenerateAddressErrorException((int32_t)JumpToLocation, true);
}
else if (CheckTimer)
{
TestTimer = false;
if (NextTimer < 0)