Closed GoogleCodeExporter closed 9 years ago
Another option to fix problem #2 is to make your own version of
luaL_checkinteger and call it everywhere instead of using the one in Lua. Since
lua_number2integer is inlined, it should work correctly if used directly.
Although, I don't know what other bugs might also be happening because of the
inconsistency of using a Lua that wasn't built with the same luaconf.h as
Snes9x.
Original comment by nitsuja-@hotmail.com
on 31 Jan 2011 at 5:37
Confirmed broken in DeSmuME 0.9.7 too (both things). I'm not really sure about
the DLL explanation I presented, but problem #2 was not a problem in DeSmuME
0.9.6, so maybe it "imported" this bug recently from a change that was made to
this branch of Snes9x.
Original comment by nitsuja-@hotmail.com
on 4 Feb 2011 at 9:41
I'm starting to think that these really are both the same issue and that the
correct fix is to get any values that could be "unsigned long" integers using
the tonumber or checknumber functions (instead of tointeger or checkinteger),
followed by using the correct (non-default) lua_number2integer conversion macro
(instead of letting it auto-cast the number, which would be slower). That way
it doesn't depend on Lua to handle it and it doesn't slow things down either.
I'll try fixing it in various emulators when I get a chance, if nobody else has
fixed it by then.
Original comment by nitsuja-@hotmail.com
on 4 Feb 2011 at 10:04
Should be fixed in r192, at least in all the Snes9x branches I could find.
Original comment by nitsuja-@hotmail.com
on 6 Feb 2011 at 6:34
Original issue reported on code.google.com by
nitsuja-@hotmail.com
on 31 Jan 2011 at 8:07