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

56 lines
2.6 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.

//////////////////////////////////////////////////////////////////////////
// Exciting Boxing //
//////////////////////////////////////////////////////////////////////////
void EXPAD_ExcitingBoxing::Reset()
{
outbits = 0;
padbits = 0;
}
BYTE EXPAD_ExcitingBoxing::Read4017()
{
return outbits;
}
void EXPAD_ExcitingBoxing::Write4016( BYTE data )
{
outbits = 0;
if( data & 0x02 ) {
outbits = (~padbits<<1)&0x1E;
} else {
outbits = (~padbits>>3)&0x1E;
}
}
void EXPAD_ExcitingBoxing::Sync()
{
padbits = 0;
// Straight
if( Config.ExButtonCheck( 2, 0 ) ) padbits |= 1<<3;
// Right Jabb
if( Config.ExButtonCheck( 2, 1 ) ) padbits |= 1<<2;
// Body
if( Config.ExButtonCheck( 2, 2 ) ) padbits |= 1<<1;
// Left Jabb
if( Config.ExButtonCheck( 2, 3 ) ) padbits |= 1<<0;
// Right hook
if( Config.ExButtonCheck( 2, 4 ) ) padbits |= 1<<7;
// Left hook
if( Config.ExButtonCheck( 2, 5 ) ) padbits |= 1<<4;
// Right move
if( Config.ExButtonCheck( 2, 6 ) ) padbits |= 1<<5;
// Left move
if( Config.ExButtonCheck( 2, 7 ) ) padbits |= 1<<6;
}
void EXPAD_ExcitingBoxing::SetSyncData( INT type, LONG data )
{
padbits = (BYTE)data;
}
LONG EXPAD_ExcitingBoxing::GetSyncData( INT type )
{
return (LONG)padbits;
}