Skip to content

Commit

Permalink
Fixed a bug causing some roms to not get properly parsed.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rinnegatamante committed Jul 19, 2020
1 parent 0b7a71d commit ec0303b
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 22 deletions.
8 changes: 4 additions & 4 deletions Data/DaedalusX64/roms.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4481,7 +4481,7 @@ Preview=Wonder_Project_J2.png
Name=Wonder Project J2 (English)
Preview=Wonder_Project_J2.png

{9de22fd559a7a68e-0}
{9de22fd559a7a68e-00}
Name=Donchan Puzzle Hanabi de Doon! (Aleck64)
Preview=DonchanPuzzle.png
SaveType=FlashRAM
Expand All @@ -4491,12 +4491,12 @@ Name=Eleven Beat - World Tournament (Aleck64)
Preview=ElevenBeat.png
SaveType=FlashRAM

{cf977caf185d7524-0}
{cf977caf185d7524-00}
Name=Hi Pai Paradise (Aleck64)
Preview=HiPaiParadise.png
SaveType=FlashRAM

{87ba48425d60be99-0}
{87ba48425d60be99-00}
Name=Kurukuru Fever (Aleck64)
Preview=KuruKuruFever.png
SaveType=FlashRAM
Expand All @@ -4521,7 +4521,7 @@ Name=Super Real Mah-Jong VS (Aleck64)
Preview=SuperRealMahjong.png
SaveType=FlashRAM

{2c8daf90371bace1-0}
{2c8daf90371bace1-00}
Name=Tower & Shaft (Aleck64)
Preview=TowerShaft.png
SaveType=FlashRAM
Expand Down
39 changes: 21 additions & 18 deletions Source/Core/RomSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ namespace

ESaveType SaveTypeFromString( const char * str )
{
for( u32 i {}; i < NUM_SAVE_TYPES; ++i )
for( u32 i = 0; i < NUM_SAVE_TYPES; ++i )
{
ESaveType save_type = ESaveType( i );

Expand Down Expand Up @@ -79,8 +79,12 @@ const char * ROM_GetSaveTypeName( ESaveType save_type )
}
#ifdef DAEDALUS_DEBUG_CONSOLE
DAEDALUS_ERROR( "Unknown save type" );
#endif
#endif
#ifdef DEADALUS_VITA
return lang_strings[STR_UNKNOWN];
#else
return "?";
#endif
}


Expand Down Expand Up @@ -347,34 +351,33 @@ void IRomSettingsDB::OutputSectionDetails( const RomID & id, const RomSettings &

bool IRomSettingsDB::GetSettings( const RomID & id, RomSettings * p_settings ) const
{
SettingsMap::const_iterator it( mSettings.find( id ) );
if ( it != mSettings.end() )
{
*p_settings = it->second;
return true;
}
else
for ( SettingsMap::const_iterator it = mSettings.begin(); it != mSettings.end(); ++it )
{
return false;
if ( it->first == id )
{
*p_settings = it->second;
return true;
}
}

return false;
}


// Update the settings for the specified rom - creates a new entry if necessary

void IRomSettingsDB::SetSettings( const RomID & id, const RomSettings & settings )
{
SettingsMap::iterator it( mSettings.find( id ) );
if ( it != mSettings.end() )
{
it->second = settings;
}
else
for ( SettingsMap::const_iterator it = mSettings.begin(); it != mSettings.end(); ++it )
{
mSettings[ id ] = settings;
if ( it->first == id )
{
it->second = settings;
return;
}
}

mDirty = true;
mSettings[id] = settings;
}


Expand Down

0 comments on commit ec0303b

Please sign in to comment.