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

Function LoadRAMAuto

source/fceuram.cpp:265–292  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

263}
264
265bool
266LoadRAMAuto (bool silent)
267{
268 char filepath[MAXPATHLEN];
269 char filepath2[MAXPATHLEN];
270
271 // look for Auto save file
272 if(!MakeFilePath(filepath, FILE_RAM, romFilename, 0))
273 return false;
274
275 if (LoadRAM(filepath, silent))
276 return true;
277
278 if (!GCSettings.AppendAuto)
279 return false;
280
281 // look for file with no number or Auto appended
282 if(!MakeFilePath(filepath2, FILE_RAM, romFilename, -1))
283 return false;
284
285 if(LoadRAM(filepath2, silent))
286 {
287 // rename this file - append Auto
288 rename(filepath2, filepath); // rename file (to avoid duplicates)
289 return true;
290 }
291 return false;
292}

Callers 1

BrowserLoadFileFunction · 0.85

Calls 2

MakeFilePathFunction · 0.85
LoadRAMFunction · 0.85

Tested by

no test coverage detected