re-add arm9 load average tracking, this time displayed in the OSD so that people arent confused by it in the window title.

This commit is contained in:
zeromus 2009-10-04 18:18:39 +00:00
parent 6c019ad77a
commit b2341c6137
4 changed files with 12 additions and 4 deletions

View File

@ -504,7 +504,7 @@ void DrawHUD()
if (CommonSettings.hud.FpsDisplay)
{
osd->addFixed(Hud.FpsDisplay.x, Hud.FpsDisplay.y, "Fps:%02d/%02d%s", Hud.fps, Hud.fps3d, driver->EMU_IsEmulationPaused() ? " (paused)" : "");
osd->addFixed(Hud.FpsDisplay.x, Hud.FpsDisplay.y, "Fps:%02d/%02d (%02d%%)%s", Hud.fps, Hud.fps3d, Hud.arm9load, driver->EMU_IsEmulationPaused() ? " (paused)" : "");
}
if (CommonSettings.hud.FrameCounterDisplay)

View File

@ -56,6 +56,7 @@ public:
{
fps = 0;
fps3d = 0;
arm9load = 0;
clicked = false;
}
@ -71,7 +72,7 @@ public:
HudCoordinates &hud(int i) { return ((HudCoordinates*)this)[i]; }
void reset();
int fps, fps3d;
int fps, fps3d, arm9load;
bool clicked;
};

View File

@ -1946,6 +1946,12 @@ static void execHardware_hstart_vblankStart()
//trigger vblank dmas
triggerDma(EDMAMode_VBlank);
//tracking for arm9 load average
nds.runCycleCollector[nds.idleFrameCounter] = 1120380-nds.idleCycles;
nds.idleFrameCounter++;
nds.idleFrameCounter &= 15;
nds.idleCycles = 0;
}
static void execHardware_hstart_vcount()
@ -2232,7 +2238,9 @@ static /*donotinline*/ std::pair<s32,s32> armInnerLoop(
}
else
{
s32 temp = arm9;
arm9 = min(s32next, arm9 + kIrqWait);
nds.idleCycles += arm9-temp;
}
}
if(doarm7 && (!doarm9 || arm7 <= timer))

View File

@ -1277,8 +1277,7 @@ static void StepRunLoop_User()
for(int i=0;i<16;i++)
load = load/8 + nds.runCycleCollector[(i+nds.idleFrameCounter)&15]*7/8;
load = std::min(100,std::max(0,(int)(load*100/1120380)));
//sprintf(txt,"(%02d%%) %s", load, DESMUME_NAME_AND_VERSION);
SetWindowText(mainLoopData.hwnd, DESMUME_NAME_AND_VERSION);
Hud.arm9load = load;
}
}