nes: MMC5: change prg ram behavior to mask out of range banks. seems to fix Shin 4 Nin Uchi Mahjong: Yakuman Tengoku (新4人打ちマージャン 役満天国). i have no idea what's actually going on
This commit is contained in:
parent
a4f3c2a7de
commit
c90d2dcd56
|
@ -22,6 +22,7 @@ namespace BizHawk.Emulation.Consoles.Nintendo
|
||||||
{
|
{
|
||||||
//configuraton
|
//configuraton
|
||||||
int prg_bank_mask_8k, chr_bank_mask_1k; //board setup (to be isolated from mmc5 code later, when we need the separate mmc5 class)
|
int prg_bank_mask_8k, chr_bank_mask_1k; //board setup (to be isolated from mmc5 code later, when we need the separate mmc5 class)
|
||||||
|
int wram_bank_mask_8k;
|
||||||
|
|
||||||
//state
|
//state
|
||||||
int irq_target, irq_counter;
|
int irq_target, irq_counter;
|
||||||
|
@ -113,6 +114,7 @@ namespace BizHawk.Emulation.Consoles.Nintendo
|
||||||
|
|
||||||
prg_bank_mask_8k = Cart.prg_size / 8 - 1;
|
prg_bank_mask_8k = Cart.prg_size / 8 - 1;
|
||||||
chr_bank_mask_1k = Cart.chr_size - 1;
|
chr_bank_mask_1k = Cart.chr_size - 1;
|
||||||
|
wram_bank_mask_8k = Cart.wram_size / 8 - 1;
|
||||||
|
|
||||||
PoweronState();
|
PoweronState();
|
||||||
|
|
||||||
|
@ -138,7 +140,7 @@ namespace BizHawk.Emulation.Consoles.Nintendo
|
||||||
|
|
||||||
int MapWRAM(int addr)
|
int MapWRAM(int addr)
|
||||||
{
|
{
|
||||||
int bank_8k = wram_bank;
|
int bank_8k = wram_bank & wram_bank_mask_8k;
|
||||||
int ofs = addr & ((1 << 13) - 1);
|
int ofs = addr & ((1 << 13) - 1);
|
||||||
addr = (bank_8k << 13) | ofs;
|
addr = (bank_8k << 13) | ofs;
|
||||||
return addr;
|
return addr;
|
||||||
|
|
Loading…
Reference in New Issue