AxibugEmuOnline/virtuanessrc097-master/NES/PadEX/EXPAD_VSUnisystem.cpp

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

//////////////////////////////////////////////////////////////////////////
// VS-Unisystem //
//////////////////////////////////////////////////////////////////////////
void EXPAD_VSUnisystem::Reset()
{
}
BYTE EXPAD_VSUnisystem::Read4016()
{
BYTE data = 0x00;
// Coin 1
if( Config.ButtonCheck( 0, Config.controller.nVSUnisystem ) )
data |= 0x20;
// Coin 2
if( Config.ButtonCheck( 1, Config.controller.nVSUnisystem ) ) {
data |= 0x40;
}
// Service
if( Config.ButtonCheck( 2, Config.controller.nVSUnisystem ) ) {
data |= 0x04;
}
// Dip-Switch
data |= ((nes->GetVSDipSwitch()<<3) & 0x18);
if( nes->rom->GetPROM_CRC() == 0xC99EC059 ) { // VS Raid on Bungeling Bay(J)
data |= 0x80;
}
return data;
}
BYTE EXPAD_VSUnisystem::Read4017()
{
BYTE data = 0x00;
// Dip-Switch
data = nes->GetVSDipSwitch() & 0xFC;
return data;
}