More accurate OAM randomization

This commit is contained in:
Lior Halphon 2025-03-21 22:52:55 +02:00
parent 3cb04e88d1
commit 9c958a1cb4
1 changed files with 1 additions and 4 deletions

View File

@ -1549,7 +1549,7 @@ static void reset_ram(GB_gameboy_t *gb)
case GB_MODEL_SGB_PAL_NO_SFC: /* Unverified */
case GB_MODEL_SGB2:
case GB_MODEL_SGB2_NO_SFC:
for (unsigned i = 0; i < 8; i++) {
for (unsigned i = 0; i < sizeof(gb->oam); i++) {
if (i & 2) {
gb->oam[i] = GB_random() & GB_random() & GB_random();
}
@ -1557,9 +1557,6 @@ static void reset_ram(GB_gameboy_t *gb)
gb->oam[i] = GB_random() | GB_random() | GB_random();
}
}
nounroll for (unsigned i = 8; i < sizeof(gb->oam); i++) {
gb->oam[i] = gb->oam[i - 8];
}
break;
}