MCPcopy Create free account
hub / github.com/TASEmulators/fceux / savestate_load

Function savestate_load

src/lua-engine.cpp:3145–3167  ·  view source on GitHub ↗

savestate.load(object state) Loads the given state

Source from the content-addressed store, hash-verified

3143//
3144// Loads the given state
3145static int savestate_load(lua_State *L) {
3146
3147 //char *filename = savestateobj2filename(L,1);
3148
3149 LuaSaveState *ss = (LuaSaveState *)lua_touserdata(L, 1);
3150
3151 if (!ss) {
3152 luaL_error(L, "Invalid savestate.load object");
3153 return 0;
3154 }
3155
3156 numTries--;
3157
3158 /*if (!ss->data) {
3159 luaL_error(L, "Invalid savestate.load data");
3160 return 0;
3161 } */
3162 if (FCEUSS_LoadFP(ss->data,SSLOADPARAM_NOBACKUP))
3163 ss->data->fseek(0,SEEK_SET);
3164
3165 return 0;
3166
3167}
3168
3169static int savestate_registersave(lua_State *L) {
3170

Callers

nothing calls this directly

Calls 4

lua_touserdataFunction · 0.85
luaL_errorFunction · 0.85
FCEUSS_LoadFPFunction · 0.85
fseekMethod · 0.45

Tested by

no test coverage detected