Closed RetroEdit closed 4 months ago
To be fair, this sems to be mostly your own fault: #1799
If the logic were clever, it'd skip the RefreshDialog
call when appropriate. I'll try to do that in the least offensive way, but it's not easy to ensure the behavior stays the same.
Note: skipping the check in https://github.com/TASEmulators/BizHawk/blob/5fd3575c0f928c07d53b3903647fb4bae2d061a1/src/BizHawk.Client.EmuHawk/tools/Lua/Libraries/TAStudioLuaLibrary.cs#L192 would allow using a single applyinputchanges
call instead of requiring two... but it breaks the script completely. I have no idea why, it's probably some bullshit with invalidating greenzone.
Background:
tastudio.submitclearframes(int frame, int number)
followed bytastudio.applyinputchanges()
is a set of operations that can be applied in Lua.However, it appears to be too inefficient to actually be that useful in practice. Take for instance some tests I did in the latest dev build using Gambatte with unthrottled clock clearing the current frame every frame in a new movie and having
tastudio.submitinputchange
run every other frame.tastudio.submitinputchange
, with the TAStudio window focused and follow cursor unchecked, I get 70 FPS. With it minimized, I get 300-350 FPS.There is an alternate solution that's far more efficient: turning on recording mode and using
joypad.set
to press the buttons.In practice, I end up using recording mode for the major efficiency gain, but it's not necessarily my favorite, since having recording mode accidentally toggled on can be destructive. It seems to me that clearing a single frame should be comparable speed since it's an equivalent operation.
Additional note
I found an old note I wrote down saying manually clearing 20,000 frames in BizHawk 2.9.1 took 10 seconds, so clearing multiple frames also seems excessively slow. But even clearing a single frame has a surprising performance hit.
Testing scripts
These are the Lua scripts I used for testing: clear_frames_test.zip
Host env.
(it's probably inefficient on versions prior to 2.8.0, but I haven't had as much experience using input entry scripts on those versions)