Wrapping external RAM banking support. Required for Pokémon Pinball's saves.
This commit is contained in:
parent
ec8823e620
commit
e822f17bb7
@ -234,6 +234,10 @@ static void write_mbc(GB_gameboy_t *gb, unsigned short addr, unsigned char value
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
gb->mbc_ram_bank = value;
|
gb->mbc_ram_bank = value;
|
||||||
|
/* Some games assume banks wrap around. We can do this if RAM size is a power of two */
|
||||||
|
if (gb->mbc_ram_bank >= gb->mbc_ram_size / 0x2000 && (gb->mbc_ram_size & (gb->mbc_ram_size - 1)) == 0 && gb->mbc_ram_size != 0) {
|
||||||
|
gb->mbc_ram_bank %= gb->mbc_ram_size / 0x2000;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
|
Loading…
Reference in New Issue
Block a user