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

Function LoadInternalStructuresState

pcsx2/SaveState.cpp:1140–1163  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1138}
1139
1140static bool LoadInternalStructuresState(zip_t* zf, s64 index, Error* error)
1141{
1142 zip_stat_t zst;
1143 if (zip_stat_index(zf, index, 0, &zst) != 0 || zst.size > std::numeric_limits<int>::max())
1144 return false;
1145
1146 // Load all the internal data
1147 auto zff = zip_fopen_index_managed(zf, index, 0);
1148 if (!zff)
1149 return false;
1150
1151 std::vector<u8> buffer(zst.size);
1152 if (zip_fread(zff.get(), buffer.data(), buffer.size()) != static_cast<zip_int64_t>(buffer.size()))
1153 return false;
1154
1155 memLoadingState state(buffer);
1156 if (!state.FreezeBios())
1157 return false;
1158
1159 if (!state.FreezeInternals(error))
1160 return false;
1161
1162 return true;
1163}
1164
1165bool SaveState_UnzipFromDisk(const std::string& filename, Error* error)
1166{

Callers 1

SaveState_UnzipFromDiskFunction · 0.85

Calls 9

zip_stat_indexFunction · 0.85
zip_fopen_index_managedFunction · 0.85
zip_freadFunction · 0.85
FreezeBiosMethod · 0.80
FreezeInternalsMethod · 0.80
maxFunction · 0.50
getMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected