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

Function UpdateAutosave

src/fceu.cpp:1314–1329  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1312static int AutosaveCounter = 0;
1313
1314void UpdateAutosave(void) {
1315 if (!EnableAutosave || turbo)
1316 return;
1317
1318 char * f;
1319 if (++AutosaveCounter >= AutosaveFrequency) {
1320 AutosaveCounter = 0;
1321 AutosaveIndex = (AutosaveIndex + 1) % AutosaveQty;
1322 f = strdup(FCEU_MakeFName(FCEUMKF_AUTOSTATE, AutosaveIndex, 0).c_str());
1323 FCEUSS_Save(f, false);
1324 AutoSS = true; //Flag that an auto-savestate was made
1325 free(f);
1326 f = NULL;
1327 AutosaveStatus[AutosaveIndex] = 1;
1328 }
1329}
1330
1331void FCEUI_RewindToLastAutosave(void) {
1332 if (!EnableAutosave || !AutoSS)

Callers 1

FCEUI_EmulateFunction · 0.85

Calls 2

FCEU_MakeFNameFunction · 0.85
FCEUSS_SaveFunction · 0.85

Tested by

no test coverage detected