Skip to content

Commit

Permalink
Fix a bug causing newly imported ROMs to sometime incorrectly prefer …
Browse files Browse the repository at this point in the history
…SGB over CGB
  • Loading branch information
LIJI32 committed May 27, 2024
1 parent e5e9cf1 commit 2bf8feb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion iOS/GBViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -491,9 +491,11 @@ - (void)loadROM
// 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"]);
}
Expand Down

0 comments on commit 2bf8feb

Please sign in to comment.