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

Method AddRomEntry

Source/Interface/RomDB.cpp:351–379  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

349}
350
351void IRomDB::AddRomEntry( const char * filename, const RomID & id, u32 rom_size, ECicType cic_type )
352{
353 // Update filename/id map
354 FilenameVec::iterator fit( std::lower_bound( mRomFiles.begin(), mRomFiles.end(), filename, SSortByFilename() ) );
355 if( fit != mRomFiles.end() && strcmp( fit->FileName, filename ) == 0 )
356 {
357 fit->ID = id;
358 }
359 else
360 {
361 RomFilesKeyValue filename_id( filename, id );
362 mRomFiles.insert( fit, filename_id );
363 }
364
365 // Update id/details map
366 DetailsVec::iterator dit( std::lower_bound( mRomDetails.begin(), mRomDetails.end(), id, SSortDetailsByID() ) );
367 if( dit != mRomDetails.end() && dit->ID == id )
368 {
369 dit->RomSize = rom_size;
370 dit->CicType = cic_type;
371 }
372 else
373 {
374 RomDetails id_details( id, rom_size, cic_type );
375 mRomDetails.insert( dit, id_details );
376 }
377
378 mDirty = true;
379}
380
381void IRomDB::AddRomDirectory(const char * directory)
382{

Callers

nothing calls this directly

Calls 2

SSortByFilenameClass · 0.85
SSortDetailsByIDClass · 0.85

Tested by

no test coverage detected