forked from TeamTofuShop/segatools
mu3: added lights hook
This commit is contained in:
@ -57,11 +57,11 @@ void chuni_io_config_load(
|
||||
filename);
|
||||
}
|
||||
|
||||
cfg->led_output_pipe = GetPrivateProfileIntW(L"led", L"cabLedOutputPipe", 1, filename);
|
||||
cfg->led_output_serial = GetPrivateProfileIntW(L"led", L"cabLedOutputSerial", 0, filename);
|
||||
cfg->cab_led_output_pipe = GetPrivateProfileIntW(L"led", L"cabLedOutputPipe", 1, filename);
|
||||
cfg->cab_led_output_serial = GetPrivateProfileIntW(L"led", L"cabLedOutputSerial", 0, filename);
|
||||
|
||||
cfg->slider_led_output_pipe = GetPrivateProfileIntW(L"led", L"controllerLedOutputPipe", 1, filename);
|
||||
cfg->slider_led_output_serial = GetPrivateProfileIntW(L"led", L"controllerLedOutputSerial", 0, filename);
|
||||
cfg->controller_led_output_pipe = GetPrivateProfileIntW(L"led", L"controllerLedOutputPipe", 1, filename);
|
||||
cfg->controller_led_output_serial = GetPrivateProfileIntW(L"led", L"controllerLedOutputSerial", 0, filename);
|
||||
|
||||
cfg->led_serial_baud = GetPrivateProfileIntW(L"led", L"serialBaud", 921600, filename);
|
||||
|
||||
@ -70,7 +70,7 @@ void chuni_io_config_load(
|
||||
L"serialPort",
|
||||
L"COM5",
|
||||
port_input,
|
||||
6,
|
||||
_countof(port_input),
|
||||
filename);
|
||||
|
||||
// Sanitize the output path. If it's a serial COM port, it needs to be prefixed
|
||||
|
@ -12,16 +12,15 @@ struct chuni_io_config {
|
||||
uint8_t vk_cell[32];
|
||||
|
||||
// Which ways to output LED information are enabled
|
||||
bool led_output_pipe;
|
||||
bool led_output_serial;
|
||||
bool cab_led_output_pipe;
|
||||
bool cab_led_output_serial;
|
||||
|
||||
bool slider_led_output_pipe;
|
||||
bool slider_led_output_serial;
|
||||
bool controller_led_output_pipe;
|
||||
bool controller_led_output_serial;
|
||||
|
||||
// The name of a COM port to output LED data on, in serial mode
|
||||
wchar_t led_serial_port[12];
|
||||
int32_t led_serial_baud;
|
||||
|
||||
};
|
||||
|
||||
void chuni_io_config_load(
|
||||
|
@ -48,15 +48,15 @@ HRESULT led_output_init(struct chuni_io_config* const cfg)
|
||||
led_escaped_buf[i].data_len = chuni_led_board_data_lens[i];
|
||||
}
|
||||
|
||||
any_outputs_enabled = config->led_output_pipe || config->slider_led_output_pipe
|
||||
|| config->led_output_serial || config->slider_led_output_serial;
|
||||
any_outputs_enabled = config->cab_led_output_pipe || config->controller_led_output_pipe
|
||||
|| config->cab_led_output_serial || config->controller_led_output_serial;
|
||||
|
||||
if (config->led_output_pipe || config->slider_led_output_pipe)
|
||||
if (config->cab_led_output_pipe || config->controller_led_output_pipe)
|
||||
{
|
||||
led_pipe_init(); // don't really care about errors here tbh
|
||||
}
|
||||
|
||||
if (config->led_output_serial || config->slider_led_output_serial)
|
||||
if (config->cab_led_output_serial || config->controller_led_output_serial)
|
||||
{
|
||||
led_serial_init(config->led_serial_port, config->led_serial_baud);
|
||||
}
|
||||
@ -106,13 +106,13 @@ void led_output_update(uint8_t board, const byte* rgb)
|
||||
|
||||
if (board < 2)
|
||||
{
|
||||
// billboard
|
||||
if (config->led_output_pipe)
|
||||
// billboard (cab)
|
||||
if (config->cab_led_output_pipe)
|
||||
{
|
||||
led_pipe_update(escaped_data);
|
||||
}
|
||||
|
||||
if (config->led_output_serial)
|
||||
if (config->cab_led_output_serial)
|
||||
{
|
||||
led_serial_update(escaped_data);
|
||||
}
|
||||
@ -120,12 +120,12 @@ void led_output_update(uint8_t board, const byte* rgb)
|
||||
else
|
||||
{
|
||||
// slider
|
||||
if (config->slider_led_output_pipe)
|
||||
if (config->controller_led_output_pipe)
|
||||
{
|
||||
led_pipe_update(escaped_data);
|
||||
}
|
||||
|
||||
if (config->slider_led_output_serial)
|
||||
if (config->controller_led_output_serial)
|
||||
{
|
||||
led_serial_update(escaped_data);
|
||||
}
|
||||
|
@ -4,6 +4,7 @@
|
||||
Credits:
|
||||
somewhatlurker, skogaby
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <windows.h>
|
||||
|
Reference in New Issue
Block a user