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

Method loadStateByIndex

src/state.cpp:1326–1357  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1324 }
1325
1326 int loadStateByIndex( int snapIdx )
1327 {
1328 if (snapIdx < 0)
1329 {
1330 snapIdx = snapIdx + ringBufSize;
1331 }
1332 snapIdx = snapIdx % ringBufSize;
1333
1334 EMUFILE_MEMORY *em = ringBuf[ snapIdx ];
1335
1336 em->fseek(SEEK_SET, 0);
1337
1338 FCEUSS_LoadFP( em, SSLOADPARAM_NOBACKUP );
1339
1340 frameCounter = lastLoadFrame = static_cast<unsigned int>(currFrameCounter);
1341
1342 lastState = snapIdx;
1343 loadIndexReset = true;
1344
1345 if (pauseOnLoad == StateRecorderConfigData::TEMPORARY_PAUSE)
1346 {
1347 if (loadPauseTime > 0)
1348 { // Temporary pause after loading new state for user to have time to process
1349 FCEUI_PauseForDuration(loadPauseTime);
1350 }
1351 }
1352 else if (pauseOnLoad == StateRecorderConfigData::FULL_PAUSE)
1353 {
1354 FCEUI_SetEmulationPaused( EMULATIONPAUSED_PAUSED );
1355 }
1356 return 0;
1357 }
1358
1359 int loadPrevState(void)
1360 {

Callers 1

Calls 4

FCEUSS_LoadFPFunction · 0.85
FCEUI_PauseForDurationFunction · 0.85
FCEUI_SetEmulationPausedFunction · 0.85
fseekMethod · 0.45

Tested by

no test coverage detected