mirror of
https://github.com/spice2x/spice2x.github.io.git
synced 2026-08-02 06:40:42 -07:00
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.
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
#include "bi2x_hook.h"
|
#include "bi2x_hook.h"
|
||||||
|
|
||||||
|
#include <optional>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include "util/detour.h"
|
#include "util/detour.h"
|
||||||
#include "util/logging.h"
|
#include "util/logging.h"
|
||||||
@@ -327,6 +328,34 @@ namespace games::gitadora {
|
|||||||
if (i_pNodeCtl != aioIob2Bi2xAc1) {
|
if (i_pNodeCtl != aioIob2Bi2xAc1) {
|
||||||
return aioIob2Bi2xAC1_SetOutputData_orig(i_pNodeCtl, i_CnPin, i_Data);
|
return aioIob2Bi2xAC1_SetOutputData_orig(i_pNodeCtl, i_CnPin, i_Data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::optional<Lights::gitadora_lights_t> 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,
|
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) {
|
if (i_pNodeCtl != aioIob2Bi2xAc1) {
|
||||||
return aioIob2Bi2xAC1_SetTapeLedDataPart_orig(i_pNodeCtl, i_TapeLedCh, i_Offset, i_pData, i_cntTapeLed, i_bReverse);
|
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,
|
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
|
// libaio-iob5_y32.dll
|
||||||
|
|
||||||
static AIO_IOB5_Y32D *__fastcall aioIob5Y32d_Create(AIO_NMGR_IOB5 *i_pSci, uint32_t i_bfMode) {
|
static AIO_IOB5_Y32D *__fastcall aioIob5Y32d_Create(AIO_NMGR_IOB5 *i_pSci, uint32_t i_bfMode) {
|
||||||
|
|
||||||
if (i_pSci == aioNmgrIob5) {
|
if (i_pSci == aioNmgrIob5) {
|
||||||
|
|||||||
@@ -211,7 +211,19 @@ std::vector<Light> &games::gitadora::get_lights() {
|
|||||||
"Guitar Right Speaker Mid Low Right B (DX)",
|
"Guitar Right Speaker Mid Low Right B (DX)",
|
||||||
"Guitar Right Speaker Lower R (DX)",
|
"Guitar Right Speaker Lower R (DX)",
|
||||||
"Guitar Right Speaker Lower G (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)"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -191,7 +191,18 @@ namespace games::gitadora {
|
|||||||
GuitarRightSpeakerMidLowRightB,
|
GuitarRightSpeakerMidLowRightB,
|
||||||
GuitarRightSpeakerLowerR,
|
GuitarRightSpeakerLowerR,
|
||||||
GuitarRightSpeakerLowerG,
|
GuitarRightSpeakerLowerG,
|
||||||
GuitarRightSpeakerLowerB
|
GuitarRightSpeakerLowerB,
|
||||||
|
|
||||||
|
// arena model (common for both guitar and drum)
|
||||||
|
ArenaTitleAvgR,
|
||||||
|
ArenaTitleAvgG,
|
||||||
|
ArenaTitleAvgB,
|
||||||
|
ArenaWooferR,
|
||||||
|
ArenaWooferG,
|
||||||
|
ArenaWooferB,
|
||||||
|
ArenaCardR,
|
||||||
|
ArenaCardG,
|
||||||
|
ArenaCardB,
|
||||||
} gitadora_lights_t;
|
} gitadora_lights_t;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user