-
Notifications
You must be signed in to change notification settings - Fork 449
Lua cannot unpause when user presses frame advance key #4591
Copy link
Copy link
Closed
Labels
App: EmuHawkRelating to EmuHawk frontendRelating to EmuHawk frontendWorking as intended (wontfix)Bug in deprecated feature, or misidentification of correct behavior, or unreasonable feature requestBug in deprecated feature, or misidentification of correct behavior, or unreasonable feature requestre: Lua API/scriptingRelating to EmuHawk's Lua API (not the Lua Console)Relating to EmuHawk's Lua API (not the Lua Console)
Metadata
Metadata
Assignees
Labels
App: EmuHawkRelating to EmuHawk frontendRelating to EmuHawk frontendWorking as intended (wontfix)Bug in deprecated feature, or misidentification of correct behavior, or unreasonable feature requestBug in deprecated feature, or misidentification of correct behavior, or unreasonable feature requestre: Lua API/scriptingRelating to EmuHawk's Lua API (not the Lua Console)Relating to EmuHawk's Lua API (not the Lua Console)
Summary
The frame advance key pauses, and this happens after Lua has run for the frame that was advanced.
Repro
Run this Lua script:
Observe that the frame advance key still causes emulation to pause, and this is true even when already paused: Lua cannot unpause on frame advance. A user frame advancing through a movie will want their Lua script to be able to conditionally unpause (e.g. to enable Lua-based seeking).
This is a unexpected behavior that has existed for a long time, but was unreported and perhaps unknown until #4347.
Related to this, is the question of whether the above Lua script should keep emulation unpaused when the user presses the pause button. After all, it would make sense if
client.unpause(); emu.frameadvance();always triggered a frame advance.An alternative solution for the particular use case that uncovered this issue might be to introduce a new Lua method that does what
emu.frameadvancesuggests in its name: actually trigger a frame advance. This would still need to be done in a way that does not pause emulation. And regardless of if we do that, I think Lua should be able to unpause after a frame advance.