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

56 lines
1.6 KiB
C#
Raw Normal View History

2024-08-05 00:05:15 +08:00
//////////////////////////////////////////////////////////////////////////
// Mapper072 Jaleco/Type1 lower bank switch //
//////////////////////////////////////////////////////////////////////////
2024-08-05 11:52:43 +08:00
using VirtualNes.Core.Debug;
2024-08-16 10:20:00 +08:00
using static VirtualNes.MMU;
2024-08-05 00:05:15 +08:00
namespace VirtualNes.Core
2024-08-05 11:52:43 +08:00
{
public class Mapper072 : Mapper
{
public Mapper072(NES parent) : base(parent)
{
}
public override void Reset()
{
SetPROM_32K_Bank(0, 1, PROM_8K_SIZE - 2, PROM_8K_SIZE - 1);
if (VROM_8K_SIZE != 0)
{
SetVROM_8K_Bank(0);
}
}
//void Mapper072::Write(WORD addr, BYTE data)
public override void Write(ushort addr, byte data)
{
if ((data & 0x80) != 0)
{
SetPROM_16K_Bank(4, data & 0x0F);
}
else if ((data & 0x40) != 0)
{
SetVROM_8K_Bank(data & 0x0F);
}
else
{
if (addr >= 0xC100 && addr <= 0xC11F && data == 0x20)
{
Debuger.Log($"SOUND CODE:{addr & 0x1F:X2}");
// OSDにするべきか…
if (Supporter.Config.sound.bExtraSoundEnable)
{
//TODO : 似乎VirtuaNES有直接播放某个音频文件的功能
//DirectSound.EsfAllStop();
//DirectSound.EsfPlay(ESF_MOETENNIS_00 + (addr & 0x1F));
}
}
}
}
}
2024-08-05 00:05:15 +08:00
}