forked from Hay1tsme/segatools
merge upstream
This commit is contained in:
2
dist/apm3/launch.bat
vendored
2
dist/apm3/launch.bat
vendored
@ -17,8 +17,10 @@ if exist %tmp%\SequenceSetting.json (
|
||||
:BEGIN
|
||||
pushd %~dp0
|
||||
|
||||
set DOORSTOP_DISABLE=TRUE
|
||||
qprocess amdaemon.exe > NUL
|
||||
IF %ERRORLEVEL% NEQ 0 start /min "AM Daemon" inject -d -k apm3hook.dll amdaemon.exe -c daemon_config\common.json daemon_config\server.json config_hook.json
|
||||
set DOORSTOP_DISABLE=
|
||||
|
||||
REM Add "-screen-fullscreen 0 -popupWindow" if you want to run in windowed mode
|
||||
inject -d -k apm3hook.dll APMV3System -logFile output_log.txt
|
||||
|
3
dist/idac/segatools.ini
vendored
3
dist/idac/segatools.ini
vendored
@ -235,6 +235,9 @@ viewChg=2
|
||||
; This is not possible on most devices, so we set the left and right button again.
|
||||
left=7
|
||||
right=8
|
||||
; Additional mapping for up and down buttons in DPad.
|
||||
up=4
|
||||
down=3
|
||||
; Button mappings for the simulated six-speed shifter.
|
||||
shiftDn=6
|
||||
shiftUp=5
|
||||
|
@ -60,6 +60,8 @@ void idac_di_config_load(struct idac_di_config *cfg, const wchar_t *filename)
|
||||
cfg->view_chg = GetPrivateProfileIntW(L"dinput", L"viewChg", 0, filename);
|
||||
cfg->left = GetPrivateProfileIntW(L"dinput", L"left", 0, filename);
|
||||
cfg->right = GetPrivateProfileIntW(L"dinput", L"right", 0, filename);
|
||||
cfg->up = GetPrivateProfileIntW(L"dinput", L"up", 0, filename);
|
||||
cfg->down = GetPrivateProfileIntW(L"dinput", L"down", 0, filename);
|
||||
cfg->shift_dn = GetPrivateProfileIntW(L"dinput", L"shiftDn", 0, filename);
|
||||
cfg->shift_up = GetPrivateProfileIntW(L"dinput", L"shiftUp", 0, filename);
|
||||
|
||||
|
@ -18,6 +18,8 @@ struct idac_di_config {
|
||||
uint8_t view_chg;
|
||||
uint8_t left;
|
||||
uint8_t right;
|
||||
uint8_t up;
|
||||
uint8_t down;
|
||||
uint8_t shift_dn;
|
||||
uint8_t shift_up;
|
||||
uint8_t gear[6];
|
||||
|
@ -71,6 +71,8 @@ static uint8_t idac_di_view_chg;
|
||||
static uint8_t idac_di_start;
|
||||
static uint8_t idac_di_left;
|
||||
static uint8_t idac_di_right;
|
||||
static uint8_t idac_di_up;
|
||||
static uint8_t idac_di_down;
|
||||
static uint8_t idac_di_gear[6];
|
||||
static bool idac_di_use_pedals;
|
||||
static bool idac_di_reverse_brake_axis;
|
||||
@ -247,6 +249,16 @@ static HRESULT idac_di_config_apply(const struct idac_di_config *cfg)
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
|
||||
if (cfg->up > 32) {
|
||||
dprintf("Wheel: Invalid up button: %i\n", cfg->up);
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
|
||||
if (cfg->down > 32) {
|
||||
dprintf("Wheel: Invalid down button: %i\n", cfg->down);
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
|
||||
if (cfg->shift_dn > 32) {
|
||||
dprintf("Wheel: Invalid shift down button: %i\n", cfg->shift_dn);
|
||||
|
||||
@ -282,6 +294,8 @@ static HRESULT idac_di_config_apply(const struct idac_di_config *cfg)
|
||||
dprintf("Wheel: View Change button : %i\n", cfg->view_chg);
|
||||
dprintf("Wheel: Left button . . . . : %i\n", cfg->left);
|
||||
dprintf("Wheel: Right button . . . : %i\n", cfg->right);
|
||||
dprintf("Wheel: Up button . . . . . : %i\n", cfg->up);
|
||||
dprintf("Wheel: Down button . . . : %i\n", cfg->down);
|
||||
dprintf("Wheel: Shift Down button . : %i\n", cfg->shift_dn);
|
||||
dprintf("Wheel: Shift Up button . . : %i\n", cfg->shift_up);
|
||||
dprintf("Wheel: Reverse Brake Axis : %i\n", cfg->reverse_brake_axis);
|
||||
@ -317,6 +331,8 @@ static HRESULT idac_di_config_apply(const struct idac_di_config *cfg)
|
||||
idac_di_view_chg = cfg->view_chg;
|
||||
idac_di_left = cfg->left;
|
||||
idac_di_right = cfg->right;
|
||||
idac_di_up = cfg->up;
|
||||
idac_di_down = cfg->down;
|
||||
idac_di_shift_dn = cfg->shift_dn;
|
||||
idac_di_shift_up = cfg->shift_up;
|
||||
idac_di_reverse_brake_axis = cfg->reverse_brake_axis;
|
||||
@ -480,6 +496,14 @@ static void idac_di_get_buttons(uint8_t *gamebtn_out)
|
||||
gamebtn |= IDAC_IO_GAMEBTN_RIGHT;
|
||||
}
|
||||
|
||||
if (idac_di_up && state.st.rgbButtons[idac_di_up - 1]) {
|
||||
gamebtn |= IDAC_IO_GAMEBTN_UP;
|
||||
}
|
||||
|
||||
if (idac_di_down && state.st.rgbButtons[idac_di_down - 1]) {
|
||||
gamebtn |= IDAC_IO_GAMEBTN_DOWN;
|
||||
}
|
||||
|
||||
*gamebtn_out = gamebtn;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user