Script active problem:
It looks like I found a bug for real this time.
print("Script is loaded")
event.onloadstate(function()
print(emu.framecount())
end)
while true do
emu.frameadvance()
end
I'm on VBA-Next.
When I run this code and load a state, it prints the framecount once, which is expected.
But if I drag and drop the script into the lua console (as a habit to close and reopen the script -
this being the only way you can do so in mGBA without crashing the emulator), it looks like subsequent loadstates will execute the print() command multiple times, even though the console says there is still only 1 script active.
///
When the script is active and I drag and drop the file onto the console (which should close the script), the script still keeps going. If I drag and drop it again, it seemingly loads a 2nd instance of the script.
Script is loaded
16108
22136
16108
22136
16108
22136
16108
22136
Script is loaded
16108
16108
22136
22136
16108
16108
22136
22136
16108
16108
22136
22136
16108
16108
22136
22136
Script is loaded
16108
16108
16108
22136
22136
22136
16108
16108
16108
22136
22136
22136
Hex editor problem:
One other error I found was in the hex editor, it seems the wrong character on the right is highlighted when clicking on a byte.
http://i.imgur.com/hGHlej0.png
Also, when I click on a character on the right, the character 3 spaces to the left gets selected instead of the character I clicked on.
Both bugs have been reported as issues.
Btw, I think a event.onloadstateimmediate() could be convenient (run code inside it before emulating the loaded frame). Is this possible? Or what alternative can I use?