Fix a bug causing newly imported ROMs to sometime incorrectly prefer SGB over CGB

This commit is contained in:
Lior Halphon 2024-05-27 23:06:16 +03:00
parent e5e9cf145a
commit 2bf8feb299
1 changed files with 3 additions and 1 deletions

View File

@ -491,9 +491,11 @@ static void rumbleCallback(GB_gameboy_t *gb, double amp)
// Newly played ROM, pick the best model
uint8_t *rom = GB_get_direct_access(&_gb, GB_DIRECT_ACCESS_ROM, NULL, NULL);
if ((rom[0x143] & 0x80) && !GB_is_cgb(&_gb)) {
if ((rom[0x143] & 0x80)) {
if (!GB_is_cgb(&_gb)) {
GB_switch_model_and_reset(&_gb, [[NSUserDefaults standardUserDefaults] integerForKey:@"GBCGBModel"]);
}
}
else if ((rom[0x146] == 3) && !GB_is_sgb(&_gb)) {
GB_switch_model_and_reset(&_gb, [[NSUserDefaults standardUserDefaults] integerForKey:@"GBSGBModel"]);
}