MiataDrive: fix title menu auto-starting (boot grace + click guard)

This commit is contained in:
Dejvino
2026-11-12 22:42:12 +01:00
parent 6eaac43050
commit 9de07c46dd
+3 -2
View File
@@ -928,11 +928,12 @@ void setup() {
if (emuAutoplay) autoPlay = true;
#endif
drawTitle();
stateT0 = millis();
}
void loop() {
uint32_t now = millis();
if (now < 800) { resetTrackball(); delay(1); return; }
if (now < 1500) { resetTrackball(); delay(1); return; }
if ((int32_t)(now - nextFrame) < 0) { delay(1); return; }
float dt = (nextFrame == 0) ? 0.033f : (float)(now - (nextFrame - FRAME_MS)) / 1000.0f;
if (dt < 0.004f) dt = 0.004f;
@@ -942,7 +943,7 @@ void loop() {
int pxX, pxY; uint32_t clicks;
applyTrackball(pxX, pxY, clicks);
if (clicks) {
if (clicks && (int32_t)(now - stateT0) > 1500) {
if (gameState == ST_TITLE) startGame();
else if (gameState == ST_GAMEOVER || gameState == ST_WIN) { gameState = ST_TITLE; stateT0 = millis(); }
}