2024-08-03 22:26:53 +08:00
|
|
|
|
//////////////////////////////
|
|
|
|
|
// Mapper240 Gen Ke Le Zhuan //
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
|
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 Mapper240 : Mapper
|
|
|
|
|
{
|
|
|
|
|
public Mapper240(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);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//void Mapper240::WriteLow(WORD addr, BYTE data)
|
|
|
|
|
public override void WriteLow(ushort addr, byte data)
|
|
|
|
|
{
|
|
|
|
|
if (addr >= 0x4020 && addr < 0x6000)
|
|
|
|
|
{
|
|
|
|
|
SetPROM_32K_Bank((data & 0xF0) >> 4);
|
|
|
|
|
SetVROM_8K_Bank(data & 0xF);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|