nes-do mapper088 differently

This commit is contained in:
zeromus 2012-07-15 22:30:25 +00:00
parent a33859fc1e
commit 3ae3a52f7a
1 changed files with 10 additions and 9 deletions

View File

@ -14,16 +14,15 @@ namespace BizHawk.Emulation.Consoles.Nintendo
This is the same as Mapper206, with the following exception: 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. 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. 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 class Mapper088 : Namcot108Board_Base
{ {
//configuration //configuration
int chr_byte_mask; int chr_bank_mask_1k;
public override bool Configure(NES.EDetectionOrigin origin) public override bool Configure(NES.EDetectionOrigin origin)
{ {
@ -41,19 +40,21 @@ namespace BizHawk.Emulation.Consoles.Nintendo
BaseSetup(); BaseSetup();
SetMirrorType(EMirrorType.Vertical); SetMirrorType(EMirrorType.Vertical);
chr_byte_mask = (Cart.chr_size*1024) - 1; chr_bank_mask_1k = Cart.chr_size - 1;
return true; return true;
} }
int RewireCHR(int addr) int RewireCHR(int addr)
{ {
int chrrom_addr = base.MapCHR(addr); int bank_1k = mapper.Get_CHRBank_1K(addr);
chrrom_addr &= 0xFFFF; bank_1k &= 0x3F;
if (addr >= 0x1000) if (addr >= 0x1000)
chrrom_addr |= 0x10000; bank_1k |= 0x40;
chrrom_addr &= chr_byte_mask; bank_1k &= chr_bank_mask_1k;
return chrrom_addr; int ofs = addr & ((1 << 10) - 1);
addr = (bank_1k << 10) + ofs;
return addr;
} }
public override byte ReadPPU(int addr) public override byte ReadPPU(int addr)