2024-08-05 23:16:39 +08:00
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
|
// Mapper013 CPROM //
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
|
using static VirtualNes.MMU;
|
2024-08-16 10:20:00 +08:00
|
|
|
|
|
2024-08-05 23:16:39 +08:00
|
|
|
|
|
|
|
|
|
namespace VirtualNes.Core
|
|
|
|
|
{
|
2024-08-16 10:20:00 +08:00
|
|
|
|
public class Mapper013 : Mapper
|
|
|
|
|
{
|
2024-08-05 23:16:39 +08:00
|
|
|
|
|
2024-08-16 10:20:00 +08:00
|
|
|
|
public Mapper013(NES parent) : base(parent) { }
|
2024-08-05 23:16:39 +08:00
|
|
|
|
|
2024-08-16 10:20:00 +08:00
|
|
|
|
public override void Reset()
|
|
|
|
|
{
|
|
|
|
|
SetPROM_32K_Bank(0, 1, 2, 3);
|
|
|
|
|
SetCRAM_4K_Bank(0, 0);
|
|
|
|
|
SetCRAM_4K_Bank(4, 0);
|
|
|
|
|
}
|
2024-08-05 23:16:39 +08:00
|
|
|
|
|
2024-08-16 10:20:00 +08:00
|
|
|
|
//void Mapper013::Write(WORD addr, BYTE data)
|
|
|
|
|
public override void Write(ushort addr, byte data)
|
|
|
|
|
{
|
|
|
|
|
SetPROM_32K_Bank((data & 0x30) >> 4);
|
|
|
|
|
SetCRAM_4K_Bank(4, data & 0x03);
|
|
|
|
|
}
|
2024-08-05 23:16:39 +08:00
|
|
|
|
|
|
|
|
|
|
2024-08-16 10:20:00 +08:00
|
|
|
|
}
|
2024-08-05 23:16:39 +08:00
|
|
|
|
}
|