MCPcopy Create free account
hub / github.com/DaedalusX64/daedalus / ReadChunk

Method ReadChunk

Source/Utility/ROMFileCompressed.cpp:268–287  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

266//
267//*****************************************************************************
268bool ROMFileCompressed::ReadChunk( u32 offset, u8 * p_dst, u32 length )
269{
270 #ifdef DAEDALUS_ENABLE_ASSERTS
271 DAEDALUS_ASSERT( mZipFile != NULL, "No open zipfile?" );
272 DAEDALUS_ASSERT( mFoundRom, "Why are we loading data when no rom was found?" );
273 #endif
274 if( !Seek( offset, p_dst, length ) )
275 {
276 return false;
277 }
278
279 if( u32( unzReadCurrentFile( mZipFile, p_dst, length ) ) != length)
280 {
281 return false;
282 }
283
284 // Apply the bytesswapping before returning the buffer
285 CorrectSwap( p_dst, length );
286 return true;
287}
288
289#endif // DAEDALUS_COMPRESSED_ROM_SUPPORT

Callers 3

GetCacheIndexMethod · 0.45
DecompressRomFunction · 0.45
OpenMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected