frame usage debug info

This commit is contained in:
madeline
2026-04-07 22:11:50 -07:00
parent be7161abc0
commit 7b4d9ce807
4 changed files with 6 additions and 0 deletions
+1
View File
@@ -10,6 +10,7 @@ extern const char* configPath;
namespace dusk {
extern AuroraStats lastFrameAuroraStats;
extern float frameUsagePct;
}
constexpr u32 defaultWindowWidth = 608;
@@ -13,6 +13,7 @@
#include "JSystem/JUtility/JUTDbPrint.h"
#include "JSystem/JUtility/JUTProcBar.h"
#include "aurora/aurora.h"
#include "dusk/dusk.h"
#include "dusk/gx_helper.h"
#include "dusk/logging.h"
#include "dusk/settings.h"
@@ -358,10 +359,12 @@ static void waitForTick(u32 p1, u16 p2) {
{
static OSTime nextTick = OSGetTime();
OSTime time = OSGetTime();
OSTime waitTime = (nextTick > time) ? (nextTick - time) : 0;
while (time < nextTick) {
JFWDisplay::getManager()->threadSleep((nextTick - time));
time = OSGetTime();
}
dusk::frameUsagePct = 100.0f * (1.0f - (float)waitTime / (float)p1);
nextTick = time + p1;
} else {
static u32 nextCount = VIGetRetraceCount();
+1
View File
@@ -97,6 +97,7 @@ namespace dusk {
hasPrevious = true;
ImGuiStringViewText(fmt::format(FMT_STRING("FPS: {:.2f}\n"), io.Framerate));
ImGuiStringViewText(fmt::format(FMT_STRING("Frame usage: {:.1f}%\n"), frameUsagePct));
if (hasPrevious) {
ImGui::Separator();
+1
View File
@@ -111,6 +111,7 @@ s32 LOAD_COPYDATE(void*) {
AuroraInfo auroraInfo;
AuroraStats dusk::lastFrameAuroraStats;
float dusk::frameUsagePct = 0.0f;
const char* configPath;
void main01(void) {