Posts for HowardC


Experienced Forum User
Joined: 2/5/2014
Posts: 28
Well yeah, obviously the implementation is different, but that's not what I mean. It looks like universal function names were decided upon.... savestate.load emu.pause ect But what they do and how you use them is often completely different. It makes things quite counter-intuitive.
Post subject: Re: Potential LUA bug... savesates not working properly.
Experienced Forum User
Joined: 2/5/2014
Posts: 28
Ilari wrote:
HowardC wrote:
Even then it doesn't work properly. savestate.save never saves the state to file, rather it saves it to memory and yes I am using valid numbers to create the state as per the documentation.
Maybe using savestate.persist might help? At least the documentation looks like it might be relevant.
Well yeah that seems to have helped. Apparently to save to file you need to do a savestate.persist immediately AFTER saving the slot. I'm not sure if this will fix the other issues (having to make the save object at launch only) but I can work with it regardless. Thanks. You know I've been working on this project for a couple of days and I'm a bit perplexed as to why each emulator seems do want slightly different scripting even though it's obvious that the lua was implemented with the idea of scripts having universal syntax. I've got a working menu system for Gens but it doesn't have a emu.reset, so I have to make a savestate on load and fake it that way. Ditto for snes9x... fceux on the other hand... emu.reset works just fine. Snes9x is similar to Gens, but my infinite loop to wait for the emulator to start crashes the emulator if I don't have the rom loaded first. Also snes9x crashes if you attempt to load a save state that doesn't exist while gens just silently prints the error to screen as it should. Fceux's gui.text function draws a different font of text than the other two with an ugly blue background. I'm new to these forums so I'm wondering where would be the best place to post about this project. I think it's long overdo that these emulators get an interface that you can navigate via the original gamepads instead of fiddling with a keyboard all the time.
Post subject: Potential LUA bug... savesates not working properly.
Experienced Forum User
Joined: 2/5/2014
Posts: 28
I've started a project to make an in-game menu system for all the lua-enabled console emulators. Basically I'm trying to make it to where you can access all the pertinent functions via your gamepad instead of having to whip out a keyboard. Anyway... fceux is giving me issues. savestate.load and savestate.save aren't working properly. First off if I try to create a state on the fly, it doesn't work..... like say my function for save is setup like: ss1=savestate.create(1); savestate.save(ss1); and load is: ss1=savestate.create(1); savestate.load(ss1); If coded like this nothing happens. What I have to do to get any functionality at all is to put a loop waiting for the emulation to start at the top of the script and create the state object once and only once at the beginning. Even then it doesn't work properly. savestate.save never saves the state to file, rather it saves it to memory and yes I am using valid numbers to create the state as per the documentation. Strangely enough savestate.load WILL load a state that I've created manually. So long story short I think savestate.save is broken completely... it saves to memory, but not to file.