MCPcopy Create free account
hub / github.com/dborth/fceugx / LoadState

Function LoadState

source/fceustate.cpp:76–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74}
75
76bool LoadState (char * filepath, bool silent)
77{
78 int offset = 0;
79 bool retval = false;
80 int device;
81
82 if(!FindDevice(filepath, &device))
83 return 0;
84
85 AllocSaveBuffer ();
86
87 offset = LoadFile(filepath, silent);
88
89 if (offset > 0)
90 {
91 EMUFILE_MEMFILE save(savebuffer, offset);
92 FCEUSS_LoadFP(&save, SSLOADPARAM_NOBACKUP);
93 retval = true;
94 }
95 else
96 {
97 // if we reached here, nothing was done!
98 if(!silent)
99 ErrorPrompt ("State file not found");
100 }
101 FreeSaveBuffer ();
102 return retval;
103}
104
105bool
106LoadStateAuto (bool silent)

Callers 2

LoadStateAutoFunction · 0.85
MenuGameSavesFunction · 0.85

Calls 6

FindDeviceFunction · 0.85
AllocSaveBufferFunction · 0.85
LoadFileFunction · 0.85
FCEUSS_LoadFPFunction · 0.85
ErrorPromptFunction · 0.85
FreeSaveBufferFunction · 0.85

Tested by

no test coverage detected