AxibugEmuOnline/References/virtuanessrc097-master/NES/Mapper/Mapper022.cpp
2024-08-05 17:58:53 +08:00

61 lines
2.5 KiB
C++
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//////////////////////////////////////////////////////////////////////////
// Mapper022 Konami VRC2 type A //
//////////////////////////////////////////////////////////////////////////
void Mapper022::Reset()
{
SetPROM_32K_Bank( 0, 1, PROM_8K_SIZE-2, PROM_8K_SIZE-1 );
}
void Mapper022::Write( WORD addr, BYTE data )
{
switch( addr ) {
case 0x8000:
SetPROM_8K_Bank( 4, data );
break;
case 0x9000:
data &= 0x03;
if( data == 0 ) SetVRAM_Mirror( VRAM_VMIRROR );
else if( data == 1 ) SetVRAM_Mirror( VRAM_HMIRROR );
else if( data == 2 ) SetVRAM_Mirror( VRAM_MIRROR4H );
else SetVRAM_Mirror( VRAM_MIRROR4L );
break;
case 0xA000:
SetPROM_8K_Bank( 5, data );
break;
case 0xB000:
SetVROM_1K_Bank( 0, data>>1 );
break;
case 0xB001:
SetVROM_1K_Bank( 1, data>>1 );
break;
case 0xC000:
SetVROM_1K_Bank( 2, data>>1 );
break;
case 0xC001:
SetVROM_1K_Bank( 3, data>>1 );
break;
case 0xD000:
SetVROM_1K_Bank( 4, data>>1 );
break;
case 0xD001:
SetVROM_1K_Bank( 5, data>>1 );
break;
case 0xE000:
SetVROM_1K_Bank( 6, data>>1 );
break;
case 0xE001:
SetVROM_1K_Bank( 7, data>>1 );
break;
}
}