MinMod: Fix CPU usage warning
This commit is contained in:
parent
21eed3e512
commit
01db0f7e54
|
@ -219,10 +219,10 @@ void DivPlatformGBAMinMod::acquire(short** buf, size_t len) {
|
||||||
void DivPlatformGBAMinMod::tick(bool sysTick) {
|
void DivPlatformGBAMinMod::tick(bool sysTick) {
|
||||||
// collect stats for display in chip config
|
// collect stats for display in chip config
|
||||||
// logV("rendered=%d,updTot=%d",sampsRendered,updCyclesTotal);
|
// logV("rendered=%d,updTot=%d",sampsRendered,updCyclesTotal);
|
||||||
if (sysTick && sampsRendered>0) {
|
if (sysTick && updCyclesTotal>0) {
|
||||||
// assuming new sample, L!=R and lowest ROM access wait in all channels
|
// assuming new sample, L!=R and lowest ROM access wait in all channels
|
||||||
// this gives 39.5 cycles/sample, rounded up to 40 for loops
|
// this gives 39.5 cycles/sample, rounded up to 40 for loops
|
||||||
maxCPU=(float)sampsRendered*chanMax*40/updCyclesTotal;
|
maxCPU=(float)sampsRendered*chanMax*40/(float)updCyclesTotal;
|
||||||
}
|
}
|
||||||
sampsRendered=0;
|
sampsRendered=0;
|
||||||
updCyclesTotal=0;
|
updCyclesTotal=0;
|
||||||
|
|
|
@ -448,8 +448,9 @@ bool FurnaceGUI::drawSysConf(int chan, int sysPos, DivSystem type, DivConfig& fl
|
||||||
DivPlatformGBAMinMod* dispatch=(DivPlatformGBAMinMod*)e->getDispatch(chan);
|
DivPlatformGBAMinMod* dispatch=(DivPlatformGBAMinMod*)e->getDispatch(chan);
|
||||||
float maxCPU=dispatch->maxCPU*100;
|
float maxCPU=dispatch->maxCPU*100;
|
||||||
ImGui::Text("Actual sample rate: %d Hz", dispatch->chipClock);
|
ImGui::Text("Actual sample rate: %d Hz", dispatch->chipClock);
|
||||||
FurnaceGUI::pushWarningColor(maxCPU>90);
|
if (maxCPU>90) ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_WARNING]);
|
||||||
ImGui::Text("Max mixer CPU usage: %.0f%%", maxCPU);
|
ImGui::Text("Max mixer CPU usage: %.0f%%", maxCPU);
|
||||||
|
if (maxCPU>90) ImGui::PopStyleColor();
|
||||||
FurnaceGUI::popWarningColor();
|
FurnaceGUI::popWarningColor();
|
||||||
if (altered) {
|
if (altered) {
|
||||||
e->lockSave([&]() {
|
e->lockSave([&]() {
|
||||||
|
|
Loading…
Reference in a new issue