Post subject: Why savestate.persist() ?
Experienced player (869)
Joined: 9/18/2008
Posts: 148
Location: Japan
I remember FCEU does not have savestate.persist(). Is this function really necessary? I read the svn log (r870) of FCEUX, and I understood this function was introduced to optimize the performance, processing savestates on-memory. But, I think this function and its documentation spoil the compatibility with FCEU and they are confusing.
FCEUX Help wrote:
savestate.persist(object savestate) Set the given savestate to be persistent. It will not be deleted when you load this state but at the exit of this script instead, unless it's one of the predefined states. If it is one of the predefined savestates it will be saved as a file on disk.
I understood the sentence above like below: * By default, anonymous savestates will be deleted when they are loaded. But if you call persist() against them, they will be remain until the exit of the script. * By default, predefined savestates will not be deleted when they are loaded. But if you want to write them out to disk, you must call persist() against them. For predefined savestates, it is true on FCEUX 2.1.2. But for anonymous savestates, it is not true (they will not be deleted when they are loaded, in any case). First, is the feature which deletes anonymous savestates when they are loaded really needed? If not, persist() against anonymous savestates is meaningless, isn't it? And, I think the feature which does not write predefined savestates out to disk by default is not compatible with FCEU, and confusing. If a person uses a predefined savestate, his purpose will be reusing the savestate after the exit of the script, in most cases. Indeed, writing savestates out to disk whenever they are saved may be slow, but saving is not so frequent operation as loading, isn't it? How about removing this function and reverting the feature to that of FCEU?
Emulator Coder
Joined: 8/12/2008
Posts: 42
FCEU doesn't include a lua scripting engine at all, IIRC I don't believe I follow your post.
** FceuX SDL Developer/Maintainer ** get the latest source http://sourceforge.net/p/fceultra/code/