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

67 lines
2.0 KiB
C#
Raw Normal View History

2024-08-03 22:26:53 +08:00
//////////////////////////////////////////////////////////////////////////
// Mapper246 Phone Serm Berm //
//////////////////////////////////////////////////////////////////////////
using static VirtualNes.MMU;
using static VirtualNes.Core.CPU;
using INT = System.Int32;
using BYTE = System.Byte;
using System;
using Codice.CM.Client.Differences;
namespace VirtualNes.Core
{
public class Mapper246 : Mapper
{
public Mapper246(NES parent) : base(parent)
{
}
//void Mapper246::Reset()
public override void Reset()
{
SetPROM_32K_Bank(0, 1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1);
}
//void Mapper246::WriteLow(WORD addr, BYTE data)
public override void WriteLow(ushort addr, byte data)
{
if (addr >= 0x6000 && addr < 0x8000)
{
switch (addr)
{
case 0x6000:
SetPROM_8K_Bank(4, data);
break;
case 0x6001:
SetPROM_8K_Bank(5, data);
break;
case 0x6002:
SetPROM_8K_Bank(6, data);
break;
case 0x6003:
SetPROM_8K_Bank(7, data);
break;
case 0x6004:
SetVROM_2K_Bank(0, data);
break;
case 0x6005:
SetVROM_2K_Bank(2, data);
break;
case 0x6006:
SetVROM_2K_Bank(4, data);
break;
case 0x6007:
SetVROM_2K_Bank(6, data);
break;
default:
CPU_MEM_BANK[addr >> 13][addr & 0x1FFF] = data;
break;
}
}
}
}
}