From cf59ae5f896e1e2e9b79df1a57e173a4faea0809 Mon Sep 17 00:00:00 2001 From: bicarus <202771338+bicarus-dev@users.noreply.github.com> Date: Fri, 2 Jan 2026 03:49:01 -0800 Subject: [PATCH] gitadora: (arena model) lights (#492) ## Link to GitHub Issue, if one exists #477 ## Description of change Add lights for J region cab. I can't figure out how the extra lights on U region cab are wired up. ## Testing Tested guitar and drums, J and U regions. --- src/spice2x/games/gitadora/bi2x_hook.cpp | 42 +++++++++++++++++++++++- src/spice2x/games/gitadora/io.cpp | 14 +++++++- src/spice2x/games/gitadora/io.h | 13 +++++++- 3 files changed, 66 insertions(+), 3 deletions(-) diff --git a/src/spice2x/games/gitadora/bi2x_hook.cpp b/src/spice2x/games/gitadora/bi2x_hook.cpp index 5c7fb7a..4d6c9c7 100644 --- a/src/spice2x/games/gitadora/bi2x_hook.cpp +++ b/src/spice2x/games/gitadora/bi2x_hook.cpp @@ -1,5 +1,6 @@ #include "bi2x_hook.h" +#include #include #include "util/detour.h" #include "util/logging.h" @@ -323,10 +324,38 @@ namespace games::gitadora { } void __fastcall aioIob2Bi2xAC1_SetOutputData(AIO_IOB2_BI2X_AC1 *i_pNodeCtl, uint32_t i_CnPin, uint8_t i_Data) { - + if (i_pNodeCtl != aioIob2Bi2xAc1) { return aioIob2Bi2xAC1_SetOutputData_orig(i_pNodeCtl, i_CnPin, i_Data); } + + std::optional light; + switch (i_CnPin) { + case 14: + light = Lights::ArenaWooferR; + break; + case 15: + light = Lights::ArenaWooferG; + break; + case 16: + light = Lights::ArenaWooferB; + break; + case 17: + light = Lights::ArenaCardR; + break; + case 18: + light = Lights::ArenaCardG; + break; + case 19: + light = Lights::ArenaCardB; + break; + default: + break; + } + if (light.has_value()) { + auto &lights = games::gitadora::get_lights(); + GameAPI::Lights::writeLight(RI_MGR, lights.at(light.value()), i_Data / 255.f); + } } void __fastcall aioIob2Bi2xAC1_SetTapeLedDataPart(AIO_IOB2_BI2X_AC1 *i_pNodeCtl, uint32_t i_TapeLedCh, @@ -336,6 +365,16 @@ namespace games::gitadora { if (i_pNodeCtl != aioIob2Bi2xAc1) { return aioIob2Bi2xAC1_SetTapeLedDataPart_orig(i_pNodeCtl, i_TapeLedCh, i_Offset, i_pData, i_cntTapeLed, i_bReverse); } + + if (tapeledutils::is_enabled() && + i_TapeLedCh == 0 && i_Offset == 0 && i_cntTapeLed == 62) { + + auto &lights = get_lights(); + const auto rgb = tapeledutils::pick_color_from_led_tape(i_pData, i_cntTapeLed); + GameAPI::Lights::writeLight(RI_MGR, lights[Lights::ArenaTitleAvgR], rgb.r); + GameAPI::Lights::writeLight(RI_MGR, lights[Lights::ArenaTitleAvgG], rgb.g); + GameAPI::Lights::writeLight(RI_MGR, lights[Lights::ArenaTitleAvgB], rgb.b); + } } void __fastcall aioIob2Bi2x_SetTapeLedDataLimit(AIO_IOB2_BI2X_AC1 *i_pNodeCtl, uint32_t i_Channel, @@ -551,6 +590,7 @@ namespace games::gitadora { } // libaio-iob5_y32.dll + static AIO_IOB5_Y32D *__fastcall aioIob5Y32d_Create(AIO_NMGR_IOB5 *i_pSci, uint32_t i_bfMode) { if (i_pSci == aioNmgrIob5) { diff --git a/src/spice2x/games/gitadora/io.cpp b/src/spice2x/games/gitadora/io.cpp index f7c226b..63dc8b8 100644 --- a/src/spice2x/games/gitadora/io.cpp +++ b/src/spice2x/games/gitadora/io.cpp @@ -211,7 +211,19 @@ std::vector &games::gitadora::get_lights() { "Guitar Right Speaker Mid Low Right B (DX)", "Guitar Right Speaker Lower R (DX)", "Guitar Right Speaker Lower G (DX)", - "Guitar Right Speaker Lower B (DX)" + "Guitar Right Speaker Lower B (DX)", + + "Title Average R (Arena)", + "Title Average G (Arena)", + "Title Average B (Arena)", + + "Woofer R (Arena)", + "Woofer G (Arena)", + "Woofer B (Arena)", + + "Card Reader R (Arena)", + "Card Reader G (Arena)", + "Card Reader B (Arena)" ); } diff --git a/src/spice2x/games/gitadora/io.h b/src/spice2x/games/gitadora/io.h index bd982fc..673c283 100644 --- a/src/spice2x/games/gitadora/io.h +++ b/src/spice2x/games/gitadora/io.h @@ -191,7 +191,18 @@ namespace games::gitadora { GuitarRightSpeakerMidLowRightB, GuitarRightSpeakerLowerR, GuitarRightSpeakerLowerG, - GuitarRightSpeakerLowerB + GuitarRightSpeakerLowerB, + + // arena model (common for both guitar and drum) + ArenaTitleAvgR, + ArenaTitleAvgG, + ArenaTitleAvgB, + ArenaWooferR, + ArenaWooferG, + ArenaWooferB, + ArenaCardR, + ArenaCardG, + ArenaCardB, } gitadora_lights_t; }