AxibugEmuOnline/AxibugEmuOnline.Client/Assets/MyNes.Core/Mapper034.cs

51 lines
1.1 KiB
C#
Raw Normal View History

2024-07-03 18:22:22 +08:00
namespace MyNes.Core
2024-07-03 18:15:28 +08:00
{
2024-07-03 18:22:22 +08:00
[BoardInfo("BxROM/NINA-001", 34)]
internal class Mapper034 : Board
{
private bool BxROM;
2024-07-03 18:15:28 +08:00
2024-07-03 18:22:22 +08:00
private byte writeData;
2024-07-03 18:15:28 +08:00
2024-07-03 18:22:22 +08:00
internal override void HardReset()
{
base.HardReset();
BxROM = true;
if (base.BoardType.Contains("NINA"))
{
BxROM = false;
}
}
2024-07-03 18:15:28 +08:00
2024-07-03 18:22:22 +08:00
internal override void WriteSRM(ref ushort address, ref byte data)
{
base.WriteSRM(ref address, ref data);
if (!BxROM)
{
switch (address)
{
case 32765:
Switch32KPRG(data, PRGArea.Area8000);
break;
case 32766:
Switch04KCHR(data, CHRArea.Area0000);
break;
case 32767:
Switch04KCHR(data, CHRArea.Area1000);
break;
}
}
}
2024-07-03 18:15:28 +08:00
2024-07-03 18:22:22 +08:00
internal override void WritePRG(ref ushort address, ref byte data)
{
if (BxROM)
{
ReadPRG(ref address, out writeData);
writeData &= data;
Switch32KPRG(writeData, PRGArea.Area8000);
}
}
}
2024-07-03 15:40:13 +08:00
}