nes-fix taito_x1_005

This commit is contained in:
zeromus 2012-03-05 18:21:17 +00:00
parent 5a76c282ac
commit 1ac5ce1bfb
1 changed files with 15 additions and 9 deletions

View File

@ -74,7 +74,7 @@ PRG Setup:
}
SetMirrorType(EMirrorType.Vertical);
chr_bank_mask = Cart.chr_size / 2 - 1;
chr_bank_mask = Cart.chr_size / 1 - 1;
prg_bank_mask = Cart.prg_size / 8 - 1;
prg_regs_8k[3] = 0xFF;
return true;
@ -92,10 +92,12 @@ PRG Setup:
break;
case 0x1EF0:
chr_regs_1k[0] = value;
chr_regs_1k[0] = (byte)(value/2*2);
chr_regs_1k[1] = (byte)(value/2*2+1);
break;
case 0x1EF1:
chr_regs_1k[2] = value;
chr_regs_1k[2] = (byte)(value/2*2);
chr_regs_1k[3] = (byte)(value/2*2+1);
break;
case 0x1EF2:
@ -138,12 +140,16 @@ PRG Setup:
public override byte ReadPPU(int addr)
{
int bank_2k = addr >> 11;
int ofs = addr & ((1 << 11) - 1);
bank_2k = chr_regs_1k[bank_2k];
bank_2k &= chr_bank_mask;
addr = (bank_2k << 11) | ofs;
return VROM[addr];
if (addr < 0x2000)
{
int bank_1k = addr >> 10;
int ofs = addr & ((1 << 10) - 1);
bank_1k = chr_regs_1k[bank_1k];
bank_1k &= chr_bank_mask;
addr = (bank_1k << 10) | ofs;
return VROM[addr];
}
else return base.ReadPPU(addr);
}
}
}