mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-24 06:39:58 -06:00
integrate changes from ARM64 backend and more
- better handle LDM/STM in reg alloc - unify Halted and IRQ in anticipation for branch inlining - literal optimisations can be disabled in gui - jit blocks follow simple returns - fix idle loop detection - break jit blocks on IRQ (fixes saving in Pokemon White)
This commit is contained in:
40
src/ARM.cpp
40
src/ARM.cpp
@ -159,7 +159,7 @@ void ARM::DoSavestate(Savestate* file)
|
||||
|
||||
file->Var32((u32*)&Cycles);
|
||||
//file->Var32((u32*)&CyclesToRun);
|
||||
file->Var32(&Halted);
|
||||
file->Var32(&StopExecution);
|
||||
|
||||
file->VarArray(R, 16*sizeof(u32));
|
||||
file->Var32(&CPSR);
|
||||
@ -632,16 +632,21 @@ void ARMv5::ExecuteJIT()
|
||||
NDS::ARM9Timestamp += Cycles;
|
||||
Cycles = 0;
|
||||
|
||||
if (IRQ) TriggerIRQ();
|
||||
if (Halted)
|
||||
if (StopExecution)
|
||||
{
|
||||
bool idleLoop = Halted & 0x20;
|
||||
Halted &= ~0x20;
|
||||
if ((Halted == 1 || idleLoop) && NDS::ARM9Timestamp < NDS::ARM9Target)
|
||||
if (IRQ)
|
||||
TriggerIRQ();
|
||||
|
||||
if (Halted || IdleLoop)
|
||||
{
|
||||
NDS::ARM9Timestamp = NDS::ARM9Target;
|
||||
bool idleLoop = IdleLoop;
|
||||
IdleLoop = 0;
|
||||
if ((Halted == 1 || idleLoop) && NDS::ARM9Timestamp < NDS::ARM9Target)
|
||||
{
|
||||
NDS::ARM9Timestamp = NDS::ARM9Target;
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -769,16 +774,21 @@ void ARMv4::ExecuteJIT()
|
||||
Cycles = 0;
|
||||
|
||||
// TODO optimize this shit!!!
|
||||
if (IRQ) TriggerIRQ();
|
||||
if (Halted)
|
||||
if (StopExecution)
|
||||
{
|
||||
bool idleLoop = Halted & 0x20;
|
||||
Halted &= ~0x20;
|
||||
if ((Halted == 1 || idleLoop) && NDS::ARM7Timestamp < NDS::ARM7Target)
|
||||
if (IRQ)
|
||||
TriggerIRQ();
|
||||
|
||||
if (Halted || IdleLoop)
|
||||
{
|
||||
NDS::ARM7Timestamp = NDS::ARM7Target;
|
||||
bool idleLoop = IdleLoop;
|
||||
IdleLoop = 0;
|
||||
if ((Halted == 1 || idleLoop) && NDS::ARM7Timestamp < NDS::ARM7Target)
|
||||
{
|
||||
NDS::ARM7Timestamp = NDS::ARM7Target;
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user