AxibugEmuOnline/AxibugEmuOnline.Client/Assets/VirtualNes.Core/Mapper/Mapper222.cs

77 lines
2.0 KiB
C#
Raw Normal View History

2024-08-03 22:26:53 +08:00
//////////////////////////////////////////////////////////////////////////
// Mapper222 //
//////////////////////////////////////////////////////////////////////////
using static VirtualNes.MMU;
2024-08-16 10:20:00 +08:00
2024-08-03 22:26:53 +08:00
namespace VirtualNes.Core
{
public class Mapper222 : Mapper
{
public Mapper222(NES parent) : base(parent)
{
}
public override void Reset()
{
SetPROM_32K_Bank(0, 1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1);
if (VROM_1K_SIZE != 0)
{
SetVROM_8K_Bank(0);
}
SetVRAM_Mirror(VRAM_VMIRROR);
}
//void Mapper222::Write(WORD addr, BYTE data)
public override void Write(ushort addr, byte data)
{
switch (addr & 0xF003)
{
case 0x8000:
SetPROM_8K_Bank(4, data);
break;
case 0xA000:
SetPROM_8K_Bank(5, data);
break;
case 0xB000:
SetVROM_1K_Bank(0, data);
break;
case 0xB002:
SetVROM_1K_Bank(1, data);
break;
case 0xC000:
SetVROM_1K_Bank(2, data);
break;
case 0xC002:
SetVROM_1K_Bank(3, data);
break;
case 0xD000:
SetVROM_1K_Bank(4, data);
break;
case 0xD002:
SetVROM_1K_Bank(5, data);
break;
case 0xE000:
SetVROM_1K_Bank(6, data);
break;
case 0xE002:
SetVROM_1K_Bank(7, data);
break;
}
}
2024-09-11 16:04:55 +08:00
public override void LoadState(byte[] p)
{
//
}
public override void SaveState(byte[] p)
{
//
}
2024-08-03 22:26:53 +08:00
}
}