add code for skipping through menus (input bit 0x6e set based on any control panel buttons being used)

This commit is contained in:
somewhatlurker
2019-10-26 10:16:53 +11:00
parent 4854086c8c
commit c3e8ad226d
2 changed files with 25 additions and 0 deletions
@@ -139,6 +139,8 @@ namespace TLAC::Components
UpdateSliderLR();
}
SetMetaButtons();
UpdateHoldState();
heldButtons = GetButtonFromHold();
@@ -371,4 +373,26 @@ namespace TLAC::Components
else
inputState->Down.Buttons &= ~JVS_R;
}
void InputEmulator::SetMetaButtons()
{
// bit 0x6e is used to skip a bunch of screens
if ((inputState->Down.Buttons & (JVS_L | JVS_R)) == 0) // ask sega okay? idk why this is needed
{
if ((inputState->Tapped.Buttons & (JVS_START | JVS_TRIANGLE | JVS_SQUARE | JVS_CROSS | JVS_CIRCLE)) != 0)
inputState->SetBit(0x6e, true, InputBufferType_Tapped);
else
inputState->SetBit(0x6e, false, InputBufferType_Tapped);
if ((inputState->Down.Buttons & (JVS_START | JVS_TRIANGLE | JVS_SQUARE | JVS_CROSS | JVS_CIRCLE)) != 0)
inputState->SetBit(0x6e, true, InputBufferType_Down);
else
inputState->SetBit(0x6e, false, InputBufferType_Down);
if ((inputState->Released.Buttons & (JVS_START | JVS_TRIANGLE | JVS_SQUARE | JVS_CROSS | JVS_CIRCLE)) != 0)
inputState->SetBit(0x6e, true, InputBufferType_Released);
else
inputState->SetBit(0x6e, false, InputBufferType_Released);
}
}
}