Reduce touch overhead and cap frame rate at 24 FPS

This commit is contained in:
Adolfo Reyna
2026-02-18 15:53:48 -05:00
parent 73a78069e3
commit fe6e403a98
4 changed files with 26 additions and 9 deletions

View File

@@ -722,13 +722,13 @@ int main()
printf("\nEntering reactive game loop (Core 0 - input & logic)\n");
printf("Display refreshes handled by Core 1\n");
printf("Frame rate limited to 30 FPS (33.3ms per frame)\n\n");
printf("Frame rate limited to 24 FPS (41.7ms per frame)\n\n");
Game* current_game = nullptr;
uint32_t game_start_time = 0;
// Frame rate limiting (30 FPS = 33.33ms per frame)
const uint32_t TARGET_FRAME_TIME_MS = 33; // 1000ms / 30fps ≈ 33ms
// Frame rate limiting (24 FPS = 41.67ms per frame)
const uint32_t TARGET_FRAME_TIME_MS = 42; // 1000ms / 24fps ≈ 41.7ms
uint32_t last_frame_time = 0;
bool needs_refresh = false; // Track if screen needs redraw
@@ -990,7 +990,7 @@ int main()
}
}
// 4. Redraw and queue async refresh on Core 1 (with 30 FPS limiting)
// 4. Redraw and queue async refresh on Core 1 (with 24 FPS limiting)
if (needs_refresh || pending_refresh) {
// Check frame rate limiting
uint32_t current_time = to_ms_since_boot(get_absolute_time());