make it fasterer

This commit is contained in:
StapleButter 2018-12-09 01:26:51 +01:00
parent 29bca33bc6
commit b569c03884
4 changed files with 10 additions and 7 deletions

View File

@ -506,9 +506,9 @@ s32 ARMv5::Execute()
AddCycles_C();
}
s32 diff = Cycles - lastcycles;
NDS::RunTimingCriticalDevices(0, diff >> ClockShift);
lastcycles = Cycles - (diff & ClockDiffMask);
//s32 diff = Cycles - lastcycles;
//NDS::RunTimingCriticalDevices(0, diff >> ClockShift);
//lastcycles = Cycles - (diff & ClockDiffMask);
// TODO optimize this shit!!!
if (Halted)

View File

@ -24,6 +24,9 @@
// access timing for cached regions
// this would be an average between cache hits and cache misses
// this was measured to be close to hardware average
// a value of 1 would represent a perfect cache, but that causes
// games to run too fast, causing a number of issues
const int kDataCacheTiming = 2;
const int kCodeCacheTiming = 1;

View File

@ -246,8 +246,6 @@ s32 DMA::Run(s32 cycles)
writefn(CurDstAddr, readfn(CurSrcAddr));
cycles -= unitcycles;
NDS::RunTimingCriticalDevices(CPU, unitcycles);
CurSrcAddr += SrcAddrInc<<1;
CurDstAddr += DstAddrInc<<1;
IterCount--;
@ -310,8 +308,6 @@ s32 DMA::Run(s32 cycles)
writefn(CurDstAddr, readfn(CurSrcAddr));
cycles -= unitcycles;
NDS::RunTimingCriticalDevices(CPU, unitcycles);
CurSrcAddr += SrcAddrInc<<2;
CurDstAddr += DstAddrInc<<2;
IterCount--;

View File

@ -804,14 +804,18 @@ u32 RunFrame()
ndscyclestorun = ARM9->Cycles >> 1;
}
RunTimingCriticalDevices(0, ndscyclestorun);
if (CPUStop & 0x0FFF0000)
{
s32 cycles = ndscyclestorun - ARM7Offset;
s32 critcycles = cycles;
cycles = DMAs[4]->Run(cycles);
if (cycles > 0) cycles = DMAs[5]->Run(cycles);
if (cycles > 0) cycles = DMAs[6]->Run(cycles);
if (cycles > 0) cycles = DMAs[7]->Run(cycles);
ARM7Offset = -cycles;
RunTimingCriticalDevices(1, critcycles);
}
else
{