From 26d6ef0250d414fec8355e4ee62f2c5f510a2abd Mon Sep 17 00:00:00 2001 From: somewhatlurker <52014015+somewhatlurker@users.noreply.github.com> Date: Sat, 26 Oct 2019 10:16:53 +1100 Subject: [PATCH] add code for skipping through menus (input bit 0x6e set based on any control panel buttons being used) --- .../TLAC/Components/Input/InputEmulator.cpp | 24 +++++++++++++++++++ .../TLAC/Components/Input/InputEmulator.h | 1 + 2 files changed, 25 insertions(+) diff --git a/source-code/source/plugins/TLAC/Components/Input/InputEmulator.cpp b/source-code/source/plugins/TLAC/Components/Input/InputEmulator.cpp index f7d6df1..96af78b 100644 --- a/source-code/source/plugins/TLAC/Components/Input/InputEmulator.cpp +++ b/source-code/source/plugins/TLAC/Components/Input/InputEmulator.cpp @@ -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); + } + } } \ No newline at end of file diff --git a/source-code/source/plugins/TLAC/Components/Input/InputEmulator.h b/source-code/source/plugins/TLAC/Components/Input/InputEmulator.h index b795293..309dfd9 100644 --- a/source-code/source/plugins/TLAC/Components/Input/InputEmulator.h +++ b/source-code/source/plugins/TLAC/Components/Input/InputEmulator.h @@ -102,5 +102,6 @@ namespace TLAC::Components void UpdateInputBit(uint32_t bit, uint8_t keycode); void UpdateSliderLR(); + void SetMetaButtons(); }; }