I'm trying to remake an SNES game frame-by-frame (I know that seems stupid, but roll with it). and I decided the best way to go about that was implementing frame advance into my remake and dumping a frame every time a frame is rendered. I know that sounds even dumber, but I'm planning on making it read either SNES9x or ZSNES movies for input so I can do things one frame at a time and compare the images using another program I'm going to make.
Now rather than manually
10 pause
20 start emulation
30 take screenshot
40 frame advance
50 goto 30
I decided it'd be a better idea to make a lua script that dumped every frame. I'm great with C# and XNA, but lua is something I'm horrible at. So I have no clue if I'm doing this wrong or if there's an error in the emulator. I'm assuming it's the former. I've installed
Lua For Windows and copied it's gd.dll to my snes9x-1.52-rr-r185 (by the way, my lua files are in a subfolder called Lua in that directory, if that matters any). Using the following script:
require "gd"
curframe = 0
function takescreen()
im = gd.createFromGdStr(gui.gdscreenshot())
if im:png(curframe..".png") then
print("Image written to disk")
else
print("Oops, an error...")
end
curframe = curframe + 1
end
gui.register(takescreen)
I get the following message:
script returned but is still running registered functions
...s\SNES\snes9x-1.52-rr-r185\Lua\lotsofscreenshots.lua:7: attempt to call field 'gdscreenshot' (a nil value)
Could anyone help me?