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

46 lines
965 B
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("Unknown", 185)]
internal class Mapper185 : Board
{
private bool lockchr;
2024-07-03 18:15:28 +08:00
2024-07-03 18:22:22 +08:00
internal override void HardReset()
{
base.HardReset();
lockchr = false;
}
2024-07-03 18:15:28 +08:00
2024-07-03 18:22:22 +08:00
internal override void ReadCHR(ref ushort address, out byte data)
{
if (!lockchr)
{
base.ReadCHR(ref address, out data);
}
else
{
data = byte.MaxValue;
}
}
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)
{
lockchr = (data & 0xF) == 0 || data == 19;
}
2024-07-03 18:15:28 +08:00
2024-07-03 18:22:22 +08:00
internal override void WriteStateData(ref BinaryWriter stream)
{
base.WriteStateData(ref stream);
stream.Write(lockchr);
}
2024-07-03 18:15:28 +08:00
2024-07-03 18:22:22 +08:00
internal override void ReadStateData(ref BinaryReader stream)
{
base.ReadStateData(ref stream);
lockchr = stream.ReadBoolean();
}
}
2024-07-03 15:40:13 +08:00
}