Skip to content

Commit

Permalink
correct handling of T bit changes w/o pipeline flush on arm9
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaklyy committed Nov 8, 2024
1 parent 5091061 commit 60a819c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ARMInterpreter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ void A_MSR_IMM(ARM* cpu)

if (cpu->CPSR & 0x20) [[unlikely]]
{
if (cpu->Num == 0) cpu->NextInstr[1] &= 0xFFFF; // checkme: probably not the right way to handle this
if (cpu->Num == 0) cpu->R[15] += 2; // pc should actually increment by 4 one more time after switching to thumb mode without a pipeline flush, this gets the same effect.
else
{
Platform::Log(Platform::LogLevel::Warn, "UNIMPLEMENTED: MSR REG T bit change on ARM7\n");
Expand Down Expand Up @@ -199,7 +199,7 @@ void A_MSR_REG(ARM* cpu)

if (cpu->CPSR & 0x20) [[unlikely]]
{
if (cpu->Num == 0) cpu->NextInstr[1] &= 0xFFFF; // checkme: probably not the right way to handle this
if (cpu->Num == 0) cpu->R[15] += 2; // pc should actually increment by 4 one more time after switching to thumb mode without a pipeline flush, this gets the same effect.
else
{
Platform::Log(Platform::LogLevel::Warn, "UNIMPLEMENTED: MSR REG T bit change on ARM7\n");
Expand Down

0 comments on commit 60a819c

Please sign in to comment.