AxibugEmuOnline/virtuanessrc097-master/NES/Mapper/Mapper060.cpp

39 lines
1.9 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.

//////////////////////////////////////////////////////////////////////////
// Mapper060 //
//////////////////////////////////////////////////////////////////////////
void Mapper060::Reset()
{
patch = 0;
DWORD crc = nes->rom->GetPROM_CRC();
if( crc == 0xf9c484a0 ) { // Reset Based 4-in-1(Unl)
SetPROM_16K_Bank( 4, game_sel );
SetPROM_16K_Bank( 6, game_sel );
SetVROM_8K_Bank( game_sel );
game_sel++;
game_sel &= 3;
} else {
patch = 1;
SetPROM_32K_Bank( 0 );
SetVROM_8K_Bank( 0 );
}
}
void Mapper060::Write( WORD addr, BYTE data )
{
if( patch ) {
if( addr & 0x80 ) {
SetPROM_16K_Bank( 4, (addr&0x70)>>4 );
SetPROM_16K_Bank( 6, (addr&0x70)>>4 );
} else {
SetPROM_32K_Bank( (addr&0x70)>>5 );
}
SetVROM_8K_Bank( addr&0x07 );
if( data & 0x08 ) SetVRAM_Mirror( VRAM_VMIRROR );
else SetVRAM_Mirror( VRAM_HMIRROR );
}
}