Post subject: EmuLua fceux zapper set function?
Joined: 2/3/2011
Posts: 4
Location: Lexington, KY
Hey guys... just wondering if there was an easy way to manually set an NES Zapper click in Lua. The only function dealing with the Zapper on the wiki is zapper.read(), which returns the coordinates and whether the zapper is currently being fired. I'd like to do something similar to clicking on the screen with the mouse to fire the zapper. The joypad has both a get and set, it seems like the zapper should/might as well. If there is no built in function, there's probably a value that I could shove into a location in memory to get it to go off, I just thought it might be built-in. Thanks!!
Joined: 7/2/2007
Posts: 3960
If I recall correctly, the NES zapper just has a simple light sensor -- pulling the trigger makes the game redraw the screen differently so the gun can say if it's seeing a specific color (or color transition, or whatever). There's nothing that directly says "the zapper is pointed at this pixel". That said, the ability to say "fire the zapper now", regardless of positioning, would seem to be rather important. :)
Pyrel - an open-source rewrite of the Angband roguelike game in Python.
Joined: 2/3/2011
Posts: 4
Location: Lexington, KY
Derakon wrote:
If I recall correctly, the NES zapper just has a simple light sensor -- pulling the trigger makes the game redraw the screen differently so the gun can say if it's seeing a specific color (or color transition, or whatever). There's nothing that directly says "the zapper is pointed at this pixel". That said, the ability to say "fire the zapper now", regardless of positioning, would seem to be rather important. :)
right, which makes the zapper.read return table seem kind of odd... it returns 3 values: x, y and click, indicating whether the trigger is being pulled this cycle/frame... but what are x and y if click is false? couldn't we get away with just returning x and y and when those two values are false, it's assumed that there was no click? anyway, being able to manually trigger a zapper click through Lua is my end-goal, any ideas?