nes-oops. also collapse UN1ROM into UxROM
This commit is contained in:
parent
395b10956a
commit
3d5798c179
|
@ -95,7 +95,6 @@
|
|||
<Compile Include="Consoles\Nintendo\NES\Boards\GxROM.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Consoles\Nintendo\NES\Boards\HVC_UN1ROM.cs" />
|
||||
<Compile Include="Consoles\Nintendo\NES\Boards\HVC_UNROM_74HC08.cs" />
|
||||
<Compile Include="Consoles\Nintendo\NES\Boards\IC_74x377.cs">
|
||||
<SubType>Code</SubType>
|
||||
|
@ -262,39 +261,6 @@
|
|||
<Compile Include="Interfaces\Base Implementations\NullController.cs" />
|
||||
<Compile Include="Interfaces\Base Implementations\NullEmulator.cs" />
|
||||
<Compile Include="Interfaces\CoreComms.cs" />
|
||||
<Compile Include="Progression\Extras\ETACalculator.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Progression\Progress.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Progression\ProgressCalculators\IProgressCalculator.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Progression\ProgressCalculators\ProgressCalcAmount.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Progression\ProgressCalculators\ProgressCalcFixed.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Progression\ProgressCalculators\ProgressCalcProportional.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Progression\ProgressCalculators\ProgressCalcUnknown.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Progression\ProgressChangedInfo.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Progression\ProgressDepth.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Progression\ProgressExtensions.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Progression\ProgressTask.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="QuickCollections.cs" />
|
||||
<Compile Include="Sound\CDAudio.cs" />
|
||||
<Compile Include="Sound\Utilities\BufferedAsync.cs" />
|
||||
|
|
|
@ -1,67 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace BizHawk.Emulation.Consoles.Nintendo
|
||||
{
|
||||
//Mapper 94
|
||||
//Senjou no Ookami (Commando)
|
||||
|
||||
class HVC_UN1ROM : NES.NESBoardBase
|
||||
{
|
||||
int prg_bank_mask_16k;
|
||||
byte prg_bank_16k;
|
||||
ByteBuffer prg_banks_16k = new ByteBuffer(2);
|
||||
|
||||
public override bool Configure(NES.EDetectionOrigin origin)
|
||||
{
|
||||
switch (Cart.board_type)
|
||||
{
|
||||
case "HVC-UN1ROM":
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
SetMirrorType(Cart.pad_h, Cart.pad_v);
|
||||
prg_bank_mask_16k = (Cart.prg_size / 16) - 1;
|
||||
prg_banks_16k[1] = 0xFF;
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void Dispose()
|
||||
{
|
||||
prg_banks_16k.Dispose();
|
||||
base.Dispose();
|
||||
}
|
||||
|
||||
public override void SyncState(Serializer ser)
|
||||
{
|
||||
base.SyncState(ser);
|
||||
ser.Sync("prg_bank_mask_16k", ref prg_bank_mask_16k);
|
||||
ser.Sync("prg_bank_16k", ref prg_bank_16k);
|
||||
ser.Sync("prg_banks_16k", ref prg_banks_16k);
|
||||
}
|
||||
|
||||
void SyncPRG()
|
||||
{
|
||||
prg_banks_16k[0] = prg_bank_16k;
|
||||
}
|
||||
|
||||
public override void WritePRG(int addr, byte value)
|
||||
{
|
||||
prg_bank_16k = (byte)((value >> 2) & 7);
|
||||
SyncPRG();
|
||||
}
|
||||
|
||||
public override byte ReadPRG(int addr)
|
||||
{
|
||||
int bank_16k = addr >> 14;
|
||||
int ofs = addr & ((1 << 14) - 1);
|
||||
bank_16k = prg_banks_16k[bank_16k];
|
||||
bank_16k &= prg_bank_mask_16k;
|
||||
addr = (bank_16k << 14) | ofs;
|
||||
return ROM[addr];
|
||||
}
|
||||
}
|
||||
}
|
|
@ -19,12 +19,15 @@ namespace BizHawk.Emulation.Consoles.Nintendo
|
|||
//configuration
|
||||
int prg_mask;
|
||||
int vram_byte_mask;
|
||||
Func<int, int> adjust_prg;
|
||||
|
||||
//state
|
||||
int prg;
|
||||
|
||||
public override bool Configure(NES.EDetectionOrigin origin)
|
||||
{
|
||||
adjust_prg = (x) => x;
|
||||
|
||||
//configure
|
||||
switch (Cart.board_type)
|
||||
{
|
||||
|
@ -34,6 +37,11 @@ namespace BizHawk.Emulation.Consoles.Nintendo
|
|||
AssertPrg(128); AssertChr(0); AssertVram(8);
|
||||
//AssertWram(0); //JJ - Tobidase Daisakusen Part 2 (J) includes WRAM
|
||||
break;
|
||||
|
||||
case "HVC-UN1ROM":
|
||||
AssertPrg(128); AssertChr(0); AssertWram(0); AssertVram(8);
|
||||
adjust_prg = (x) => ((x >> 2) & 7);
|
||||
break;
|
||||
|
||||
case "NES-UOROM": //paperboy 2
|
||||
case "HVC-UOROM":
|
||||
|
@ -60,7 +68,7 @@ namespace BizHawk.Emulation.Consoles.Nintendo
|
|||
}
|
||||
public override void WritePRG(int addr, byte value)
|
||||
{
|
||||
prg = value & prg_mask;
|
||||
prg = adjust_prg(value) & prg_mask;
|
||||
}
|
||||
|
||||
public override byte ReadPPU(int addr)
|
||||
|
|
Loading…
Reference in New Issue