diff --git a/BizHawk.Emulation/Consoles/Nintendo/NES/Boards/Namcot1xx/Mapper088.cs b/BizHawk.Emulation/Consoles/Nintendo/NES/Boards/Namcot1xx/Mapper088.cs index d49fe493a7..b81ddcbdd3 100644 --- a/BizHawk.Emulation/Consoles/Nintendo/NES/Boards/Namcot1xx/Mapper088.cs +++ b/BizHawk.Emulation/Consoles/Nintendo/NES/Boards/Namcot1xx/Mapper088.cs @@ -14,16 +14,15 @@ namespace BizHawk.Emulation.Consoles.Nintendo This is the same as Mapper206, with the following exception: CHR support is increased to 128KB by connecting PPU's A12 line to the CHR ROM's A16 line. - For example, masking the CHR ROM address output from the mapper by $FFFF, and then OR it with $10000 if the PPU address was >= $1000. + For example, mask the CHR ROM 1K bank output from the mapper by $3F, and then OR it with $40 if the PPU address was >= $1000. Consequently, CHR is split into two halves. $0xxx can only have CHR from the first 64K, $1xxx can only have CHR from the second 64K. - */ class Mapper088 : Namcot108Board_Base { //configuration - int chr_byte_mask; + int chr_bank_mask_1k; public override bool Configure(NES.EDetectionOrigin origin) { @@ -41,19 +40,21 @@ namespace BizHawk.Emulation.Consoles.Nintendo BaseSetup(); SetMirrorType(EMirrorType.Vertical); - chr_byte_mask = (Cart.chr_size*1024) - 1; + chr_bank_mask_1k = Cart.chr_size - 1; return true; } int RewireCHR(int addr) { - int chrrom_addr = base.MapCHR(addr); - chrrom_addr &= 0xFFFF; + int bank_1k = mapper.Get_CHRBank_1K(addr); + bank_1k &= 0x3F; if (addr >= 0x1000) - chrrom_addr |= 0x10000; - chrrom_addr &= chr_byte_mask; - return chrrom_addr; + bank_1k |= 0x40; + bank_1k &= chr_bank_mask_1k; + int ofs = addr & ((1 << 10) - 1); + addr = (bank_1k << 10) + ofs; + return addr; } public override byte ReadPPU(int addr)