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

64 lines
1.6 KiB
C#
Raw Normal View History

2024-08-05 23:16:39 +08:00
//////////////////////////////////////////////////////////////////////////
// Mapper003 CNROM //
//////////////////////////////////////////////////////////////////////////
using static VirtualNes.MMU;
2024-08-16 10:20:00 +08:00
2024-08-05 23:16:39 +08:00
namespace VirtualNes.Core
{
public class Mapper003 : Mapper
{
2024-08-06 13:49:24 +08:00
public Mapper003(NES parent) : base(parent) { }
public override void Reset()
{
switch (PROM_16K_SIZE)
{
case 1: // 16K only
SetPROM_16K_Bank(4, 0);
SetPROM_16K_Bank(6, 0);
break;
case 2: // 32K
SetPROM_32K_Bank(0);
break;
}
// nes.SetRenderMethod( NES::TILE_RENDER );
uint crc = nes.rom.GetPROM_CRC();
if (crc == 0x2b72fe7e)
{ // Ganso Saiyuuki - Super Monkey Dai Bouken(J)
nes.SetRenderMethod(EnumRenderMethod.TILE_RENDER);
nes.ppu.SetExtNameTableMode(true);
}
// if( crc == 0xE44D95B5 ) { // ひみつw
// }
}
2024-08-05 23:16:39 +08:00
#if FALSE//0
void Mapper003::WriteLow( WORD addr, BYTE data )
{
if( patch ) {
Mapper::WriteLow( addr, data );
} else {
if( nes.rom.IsSAVERAM() ) {
Mapper::WriteLow( addr, data );
} else {
if( addr >= 0x4800 ) {
SetVROM_8K_Bank( data & 0x03 );
}
}
}
}
#endif
2024-08-06 13:49:24 +08:00
//void Mapper003::Write(WORD addr, BYTE data)
public override void Write(ushort addr, byte data)
{
SetVROM_8K_Bank(data);
}
}
2024-08-05 23:16:39 +08:00
}