MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / SysState_ComponentFreezeOut

Function SysState_ComponentFreezeOut

pcsx2/SaveState.cpp:393–419  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

391}
392
393static bool SysState_ComponentFreezeOut(SaveStateBase& writer, SysState_Component comp)
394{
395 freezeData fP = {};
396 if (comp.freeze(FreezeAction::Size, &fP) != 0)
397 {
398 Console.Error(fmt::format("* {}: Failed to get freeze size", comp.name));
399 return false;
400 }
401
402 if (fP.size == 0)
403 return true;
404
405 const int size = fP.size;
406 writer.PrepBlock(size);
407
408 Console.WriteLn(" Saving %s", comp.name);
409
410 fP.data = writer.GetBlockPtr();
411 if (comp.freeze(FreezeAction::Save, &fP) != 0)
412 {
413 Console.Error(fmt::format("* {}: Failed to save freeze data", comp.name));
414 return false;
415 }
416
417 writer.CommitBlock(size);
418 return true;
419}
420
421static bool SysState_ComponentFreezeInNew(zip_file_t* zf, const char* name, bool(*do_state_func)(StateWrapper&))
422{

Callers 2

FreezeOutMethod · 0.85
FreezeOutMethod · 0.85

Calls 7

freezeMethod · 0.80
PrepBlockMethod · 0.80
CommitBlockMethod · 0.80
formatFunction · 0.50
ErrorMethod · 0.45
WriteLnMethod · 0.45
GetBlockPtrMethod · 0.45

Tested by

no test coverage detected