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

Method Open

Source/Utility/ROMFileCache.cpp:108–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106//
107//*****************************************************************************
108bool ROMFileCache::Open( ROMFile * p_rom_file )
109{
110 mpROMFile = p_rom_file;
111
112 u32 rom_size( p_rom_file->GetRomSize() );
113 u32 rom_chunks( AlignPow2( rom_size, CHUNK_SIZE ) / CHUNK_SIZE );
114
115 mChunkMapEntries = rom_chunks;
116 mpChunkMap = new CacheIdx[ rom_chunks ];
117
118 // Invalidate all entries
119 for(u32 i = 0; i < rom_chunks; ++i)
120 {
121 mpChunkMap[ i ] = INVALID_IDX;
122 }
123
124 for(u32 i = 0; i < CACHE_SIZE; ++i)
125 {
126 mpChunkInfo[ i ].StartOffset = INVALID_ADDRESS;
127 mpChunkInfo[ i ].LastUseIdx = 0;
128 }
129
130 return true;
131}
132
133//*****************************************************************************
134//

Callers

nothing calls this directly

Calls 2

AlignPow2Function · 0.85
GetRomSizeMethod · 0.45

Tested by

no test coverage detected