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

53 lines
2.0 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.

//////////////////////////////////////////////////////////////////////////
// Mapper076 Namcot 109 (女神転生) //
//////////////////////////////////////////////////////////////////////////
void Mapper076::Reset()
{
SetPROM_32K_Bank( 0, 1, PROM_8K_SIZE-2, PROM_8K_SIZE-1 );
if( VROM_1K_SIZE >= 8 ) {
SetVROM_8K_Bank( 0 );
}
}
void Mapper076::Write( WORD addr, BYTE data )
{
switch( addr ) {
case 0x8000:
reg = data;
break;
case 0x8001:
switch( reg & 0x07 ) {
case 2:
SetVROM_2K_Bank( 0, data );
break;
case 3:
SetVROM_2K_Bank( 2, data );
break;
case 4:
SetVROM_2K_Bank( 4, data );
break;
case 5:
SetVROM_2K_Bank( 6, data );
break;
case 6:
SetPROM_8K_Bank( 4, data );
break;
case 7:
SetPROM_8K_Bank( 5, data );
break;
}
break;
}
}
void Mapper076::SaveState( LPBYTE p )
{
p[0] = reg;
}
void Mapper076::LoadState( LPBYTE p )
{
reg = p[0];
}