Post subject: snes9x-rr 1.52 r185 - Can't get gui.gdscreenshot() to work
Joined: 11/4/2011
Posts: 11
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?
Emulator Coder, Skilled player (1310)
Joined: 12/21/2004
Posts: 2687
Snes9x 1.52 has some Lua support but many things are disabled at the moment, including gdscreenshot. I think if you try either 1.51 or 1.43 you'll find that gdscreenshot actually works there.
Joined: 11/4/2011
Posts: 11
Thank you. :)