diff --git a/docs/debugging.md b/docs/debugging.md index 67af0b05fe..c9c6f20fea 100644 --- a/docs/debugging.md +++ b/docs/debugging.md @@ -55,7 +55,9 @@ A working invocation, and the traps around it: - **The timeouts apply to the whole session**, not per test. `--timeout-wall=N` is real seconds and `--timeout-emulated=N` is emulated ones; both default to infinity, both can be set at once, and whichever - is reached first ends the run (`TIMEOUT` or `TIMEOUT (emulated)`). `--timeout` is the old name for + is reached first ends the run (`TIMEOUT` or `TIMEOUT (emulated)`). With `--state=`, emulated time counts + from when the state has loaded: until then the game boots for however long the load takes on the host, so + counting from boot made runs end on different frames. `--timeout` is the old name for `--timeout-wall`. As soon as you pass one it applies to your whole interactive debugging session too, so pass something huge (`--timeout-wall=100000`) or the process exits out from under you mid-session. The wall-clock check is skipped while `IsDebuggerPresent()`; the emulated one doesn't need that escape hatch, diff --git a/headless/Headless.cpp b/headless/Headless.cpp index 85c028e454..46bee0dd8b 100644 --- a/headless/Headless.cpp +++ b/headless/Headless.cpp @@ -547,7 +547,9 @@ static bool RunAutoTest(GraphicsContext *graphicsContext, CoreParameter &corePar const double emulatedNow = CoreTiming::GetGlobalTimeUs() / 1000000.0; const double emulatedStep = emulatedNow - lastEmulatedTime; lastEmulatedTime = emulatedNow; - if (emulatedStep > 0.0 && emulatedStep < emulatedStepLimit) { + // With --state, count from when the state lands. Until then the game boots, for however long + // reading and decompressing the state takes on the host, which made runs end on different frames. + if (emulatedStep > 0.0 && emulatedStep < emulatedStepLimit && !g_stateLoadPending) { emulatedElapsed += emulatedStep; }