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

68 lines
1.6 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("Namco 118", 88)]
internal class Mapper088 : Board
{
private int address_8001;
2024-07-03 18:15:28 +08:00
2024-07-03 18:22:22 +08:00
internal override void HardReset()
{
base.HardReset();
Switch16KPRG(PRG_ROM_16KB_Mask, PRGArea.AreaC000);
}
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)
{
switch (address & 0x8001)
{
case 32768:
address_8001 = data & 7;
break;
case 32769:
switch (address_8001)
{
case 0:
Switch02KCHR((data & 0x3F) >> 1, CHRArea.Area0000);
break;
case 1:
Switch02KCHR((data & 0x3F) >> 1, CHRArea.Area0800);
break;
case 2:
Switch01KCHR(data | 0x40, CHRArea.Area1000);
break;
case 3:
Switch01KCHR(data | 0x40, CHRArea.Area1400);
break;
case 4:
Switch01KCHR(data | 0x40, CHRArea.Area1800);
break;
case 5:
Switch01KCHR(data | 0x40, CHRArea.Area1C00);
break;
case 6:
Switch08KPRG(data, PRGArea.Area8000);
break;
case 7:
Switch08KPRG(data, PRGArea.AreaA000);
break;
}
break;
}
}
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(address_8001);
}
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);
address_8001 = stream.ReadInt32();
}
}
2024-07-03 15:40:13 +08:00
}