alexis-soluteo / bizhawk

Automatically exported from code.google.com/p/bizhawk
0 stars 0 forks source link

Cannot call emu.frameadvance() in Lua Console #414

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Open Lua Console.
2. Type emu.frameadvance().
3. Alternatively, call any user-defined Lua function that internally calls 
emu.frameadvance().

What happens:
LuaInterface.LuaScriptException: attempt to yield across metamethod/C-call 
boundary

What should happen:
It should just work. :)

BizHawk 1.9.3, tested this with bsnes core.

Original issue reported on code.google.com by denilsonsa on 23 Mar 2015 at 4:17

GoogleCodeExporter commented 9 years ago
A similar error shows up if we call emu.frameadvance from within a button (i.e. 
inside the function that handles the click on a gui.button).

It certainly happens because we can't call that function in another thread 
(i.e. we can't call it in the GUI thread).

Not sure how easy this can be solved, probably not easy at all. Specially 
tricky if we make a Lua button that runs a function that calls frameadvance in 
a loop. Maybe the best solution would to handle this exception and give a good 
error message to the user.

Original comment by denilsonsa on 24 Mar 2015 at 3:17