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

47 lines
1.1 KiB
C#
Raw Normal View History

2024-07-03 18:15:28 +08:00
using System.IO;
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("74161/32", 96, 1, 32)]
internal class Mapper096 : Board
{
private int flag_c;
internal override string Issues => MNInterfaceLanguage.IssueMapper96;
internal override void HardReset()
{
base.HardReset();
flag_c = 0;
Switch04KCHR(3, CHRArea.Area1000);
}
internal override void WritePRG(ref ushort address, ref byte data)
{
Switch32KPRG(data & 3, PRGArea.Area8000);
flag_c = (((data & 4) == 4) ? 1 : 0);
Switch04KCHR(3, CHRArea.Area1000);
}
internal override void OnPPUAddressUpdate(ref ushort address)
{
if ((address & 0x3FF) < 960 && (address & 0x1000) == 0)
{
Switch04KCHR(((address & 0x300) >> 8) | flag_c, CHRArea.Area0000);
}
}
internal override void WriteStateData(ref BinaryWriter stream)
{
base.WriteStateData(ref stream);
stream.Write(flag_c);
}
internal override void ReadStateData(ref BinaryReader stream)
{
base.ReadStateData(ref stream);
flag_c = stream.ReadInt32();
}
}
2024-07-03 15:40:13 +08:00
}