diff --git a/include/app/app.h b/include/app/app.h index 28f8fe5..67b5c22 100644 --- a/include/app/app.h +++ b/include/app/app.h @@ -262,7 +262,7 @@ struct app { bool is_running; // Current FPS - uint32_t fps; + float fps; // The current quicksave request struct { diff --git a/source/app/main.c b/source/app/main.c index 92dd5f7..021ba9e 100644 --- a/source/app/main.c +++ b/source/app/main.c @@ -180,7 +180,7 @@ main( now = SDL_GetTicks(); if ((now - app.ui.ticks_last_frame) >= 1000) { - app.emulation.fps = gba_shared_reset_frame_counter(app.emulation.gba); + app.emulation.fps = gba_shared_reset_frame_counter(app.emulation.gba) / (float)(now - app.ui.ticks_last_frame) * 1000.0; app.ui.ticks_last_frame = now; /* diff --git a/source/app/windows/menubar.c b/source/app/windows/menubar.c index 5eb21f5..1cd60a7 100644 --- a/source/app/windows/menubar.c +++ b/source/app/windows/menubar.c @@ -474,7 +474,7 @@ app_win_menubar_fps_counter( spacing = igGetStyle()->ItemSpacing.x; igSameLine(igGetWindowWidth() - (app->ui.menubar_fps_width + spacing * 2), 1); - igText("FPS: %u (%u%%)", app->emulation.fps, (unsigned)(app->emulation.fps / 60.0 * 100.0)); + igText("FPS: %.1f (%.1f%%)", app->emulation.fps, app->emulation.fps / 60.0 * 100.0); igGetItemRectSize(&out); app->ui.menubar_fps_width = out.x; }