MCPcopy Create free account
hub / github.com/clementgallet/libTAS / getNextPageFlag

Method getNextPageFlag

src/library/checkpoint/SaveStateLoading.cpp:193–210  ·  view source on GitHub ↗

Like getPageFlag(), but assumes you're going through the addresses * sequentially. This means it can skip some checks and be a little faster. */

Source from the content-addressed store, hash-verified

191/* Like getPageFlag(), but assumes you're going through the addresses
192 * sequentially. This means it can skip some checks and be a little faster. */
193char SaveStateLoading::getNextPageFlag()
194{
195 char flag = nextFlag();
196 if (flag == Area::FULL_PAGE) {
197 next_pfd_offset += 4096;
198 }
199 else if (flag == Area::COMPRESSED_PAGE) {
200 lseek(pfd, next_pfd_offset, SEEK_SET);
201 Utils::readAll(pfd, &compressed_length, sizeof(int));
202 if (!validateCompressedLength()) {
203 current_flag = Area::NONE;
204 return Area::NONE;
205 }
206 next_pfd_offset += sizeof(int) + compressed_length;
207 }
208 current_addr += 4096;
209 return flag;
210}
211
212void SaveStateLoading::finishLoad()
213{

Callers 2

readAnAreaFunction · 0.80
readASavefileFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected