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

Method update

src/state.cpp:1270–1309  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1268 }
1269
1270 void update(void)
1271 {
1272 bool isPaused = EmulationPaused ? true : false;
1273
1274 unsigned int curFrame = static_cast<unsigned int>(currFrameCounter);
1275
1276 if (!isPaused && loadIndexReset)
1277 {
1278 ringHead = (lastState + 1) % ringBufSize;
1279
1280 frameCounter = curFrame;
1281
1282 loadIndexReset = false;
1283 }
1284
1285 if (!isPaused && (curFrame > frameCounter) )
1286 {
1287 frameCounter = curFrame;
1288
1289 if ( (frameCounter % framesPerSnap) == 0 )
1290 {
1291 EMUFILE_MEMORY *em = ringBuf[ ringHead ];
1292
1293 em->set_len(0);
1294
1295 FCEUSS_SaveMS( em, compressionLevel );
1296
1297 //printf("Frame:%u Save:%i Size:%zu Total:%zukB \n", frameCounter, ringHead, em->size(), dataSize() / 1024 );
1298
1299 lastState = ringHead;
1300
1301 ringHead = (ringHead + 1) % ringBufSize;
1302
1303 if (ringStart == ringHead)
1304 {
1305 ringStart = (ringHead + 1) % ringBufSize;
1306 }
1307 }
1308 }
1309 }
1310
1311 int loadStateRelativeToEnd( int numSnapsFromLatest )
1312 {

Callers 1

FCEU_StateRecorderUpdateFunction · 0.45

Calls 2

FCEUSS_SaveMSFunction · 0.85
set_lenMethod · 0.80

Tested by

no test coverage detected