I discovered a much better pair of memory addresses to use for the Kongs, which will negate the need to make ridiculous calculations. The new script would look something like this:
BackTrack = savestate.create();
while true do
savestate.save(BackTrack);
x = memory.readword(0x7E00C5)
y = memory.readword(0x7E00C7)
memory.writeword(0x7E1A62,x-128)
memory.writeword(0x7E1A4c,y-128)
gui.text(10,10,"" .. x)
gui.text(10,20,"" .. y)
snes9x.frameadvance()
keys = joypad.get(1);
savestate.load(BackTrack);
joypad.set(1,keys);
gui.text(10,50,"Don't Touch Joypad!");
snes9x.frameadvance(); --replace with snes9x.emulateframeinvisible() if it becomes available
end
However, I just tested it and it didn't seem to work. The following script still works, but unfortunately won't safeguard against desyncs.
while true do
x = memory.readword(0x7E00C5)
y = memory.readword(0x7E00C7)
memory.writeword(0x7E1A62,x-128)
memory.writeword(0x7E1A4c,y-128)
gui.text(10,10,"" .. x)
gui.text(10,20,"" .. y)
snes9x.frameadvance()
end
Still on the right track. Do you even still need this Tompa?