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

45 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.

//////////////////////////////////////////////////////////////////////////
// Mapper086 Jaleco Early Mapper #2 //
//////////////////////////////////////////////////////////////////////////
void Mapper086::Reset()
{
SetPROM_32K_Bank( 0, 1, 2, 3 );
SetVROM_8K_Bank( 0 );
reg = 0xFF;
cnt = 0;
}
void Mapper086::WriteLow( WORD addr, BYTE data )
{
if( addr == 0x6000 ) {
SetPROM_32K_Bank( (data&0x30)>>4 );
SetVROM_8K_Bank( (data&0x03)|((data & 0x40)>>4) );
}
if( addr == 0x7000 ) {
if( !(reg&0x10) && (data&0x10) && !cnt ) {
//DEBUGOUT( "WR:$%02X\n", data );
if( (data&0x0F) == 0 // Strike
|| (data&0x0F) == 5 ) { // Foul
cnt = 60; // 次の発声を1秒程禁止する
}
// OSDにするべきか…
if( Config.sound.bExtraSoundEnable ) {
DirectSound.EsfAllStop();
DirectSound.EsfPlay( ESF_MOEPRO_STRIKE+(data&0x0F) );
}
}
reg = data;
}
}
void Mapper086::VSync()
{
if( cnt ) {
cnt--;
}
}