NESHawk Fix ACtion 52

This commit is contained in:
alyosha-tas 2017-09-27 22:17:38 -04:00 committed by GitHub
parent 32797eea46
commit 961723ef32
1 changed files with 10 additions and 2 deletions

View File

@ -1,5 +1,6 @@
using BizHawk.Common; using BizHawk.Common;
using BizHawk.Common.NumberExtensions; using BizHawk.Common.NumberExtensions;
using System;
namespace BizHawk.Emulation.Cores.Nintendo.NES namespace BizHawk.Emulation.Cores.Nintendo.NES
{ {
@ -108,6 +109,11 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
{ {
cheetahmen = true; cheetahmen = true;
} }
else
{
prg_bank_mask_16k = 0x1F;
prg_bank_mask_32k = 0xF;
}
AutoMapperProps.Apply(this); AutoMapperProps.Apply(this);
@ -155,6 +161,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
//$8000-FFFF: [.... ..CC] Low 2 bits of CHR //$8000-FFFF: [.... ..CC] Low 2 bits of CHR
//A~[..MH HPPP PPO. CCCC] //A~[..MH HPPP PPO. CCCC]
addr += 0x8000;
if (addr.Bit(13)) if (addr.Bit(13))
{ {
SetMirrorType(EMirrorType.Horizontal); SetMirrorType(EMirrorType.Horizontal);
@ -173,7 +181,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
switch (chip) switch (chip)
{ {
case 0: case 0:
chip_offset = 0; chip_offset = 0x0;
break; break;
case 1: case 1:
chip_offset = 0x80000; chip_offset = 0x80000;
@ -201,7 +209,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
if (prg_mode == false) if (prg_mode == false)
{ {
int bank = (prg_reg >> 1) & prg_bank_mask_32k; int bank = (prg_reg >> 1) & prg_bank_mask_32k;
return ROM[(bank * 0x8000) + addr]; return ROM[(bank * 0x8000) + addr + chip_offset];
} }
else else
{ {