forked from Hay1tsme/segatools
Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
cb05c53a7b | |||
e36031ebfb |
15
dist/idac/segatools.ini
vendored
15
dist/idac/segatools.ini
vendored
@ -211,10 +211,21 @@ accelAxis=Y
|
||||
start=1
|
||||
viewChg=2
|
||||
; DPad is already emulated, but in order to trigger "Time Up" and exit the
|
||||
; course you need to press both left and right on the DPad at the same time.
|
||||
; This is not possible on most devices, so we set the left and right button again.
|
||||
; course you need to press both left and right on the DPad at the same time
|
||||
; This is not possible on most devices, so we set the left and right button again
|
||||
;
|
||||
; up key
|
||||
; down key
|
||||
; left key
|
||||
; right key
|
||||
; leftThumb key (The left and right buttons cannot be pressed at the same time to set)
|
||||
; rightThumb key (The left and right buttons cannot be pressed at the same time to set)
|
||||
up=0
|
||||
down=0
|
||||
left=7
|
||||
right=8
|
||||
leftThumb=7
|
||||
rightThumb=8
|
||||
; Button mappings for the simulated six-speed shifter.
|
||||
shiftDn=6
|
||||
shiftUp=5
|
||||
|
@ -58,8 +58,12 @@ void idac_di_config_load(struct idac_di_config *cfg, const wchar_t *filename)
|
||||
|
||||
cfg->start = GetPrivateProfileIntW(L"dinput", L"start", 0, filename);
|
||||
cfg->view_chg = GetPrivateProfileIntW(L"dinput", L"viewChg", 0, filename);
|
||||
cfg->up = GetPrivateProfileIntW(L"dinput", L"up", 0, filename);
|
||||
cfg->down = GetPrivateProfileIntW(L"dinput", L"down", 0, filename);
|
||||
cfg->left = GetPrivateProfileIntW(L"dinput", L"left", 0, filename);
|
||||
cfg->right = GetPrivateProfileIntW(L"dinput", L"right", 0, filename);
|
||||
cfg->leftThumb = GetPrivateProfileIntW(L"dinput", L"leftThumb", 0, filename);
|
||||
cfg->rightThumb = GetPrivateProfileIntW(L"dinput", L"rightThumb", 0, filename);
|
||||
cfg->shift_dn = GetPrivateProfileIntW(L"dinput", L"shiftDn", 0, filename);
|
||||
cfg->shift_up = GetPrivateProfileIntW(L"dinput", L"shiftUp", 0, filename);
|
||||
|
||||
|
@ -16,8 +16,12 @@ struct idac_di_config {
|
||||
wchar_t accel_axis[16];
|
||||
uint8_t start;
|
||||
uint8_t view_chg;
|
||||
uint8_t up;
|
||||
uint8_t down;
|
||||
uint8_t left;
|
||||
uint8_t right;
|
||||
uint8_t leftThumb;
|
||||
uint8_t rightThumb;
|
||||
uint8_t shift_dn;
|
||||
uint8_t shift_up;
|
||||
uint8_t gear[6];
|
||||
|
26
idacio/di.c
26
idacio/di.c
@ -69,8 +69,12 @@ static uint8_t idac_di_shift_dn;
|
||||
static uint8_t idac_di_shift_up;
|
||||
static uint8_t idac_di_view_chg;
|
||||
static uint8_t idac_di_start;
|
||||
static uint8_t idac_di_up;
|
||||
static uint8_t idac_di_down;
|
||||
static uint8_t idac_di_left;
|
||||
static uint8_t idac_di_right;
|
||||
static uint8_t idac_di_leftThumb;
|
||||
static uint8_t idac_di_rightThumb;
|
||||
static uint8_t idac_di_gear[6];
|
||||
static bool idac_di_use_pedals;
|
||||
static bool idac_di_reverse_brake_axis;
|
||||
@ -105,6 +109,8 @@ HRESULT idac_di_init(
|
||||
return hr;
|
||||
}
|
||||
|
||||
dprintf("DirectInput: Controller initializing\n");
|
||||
|
||||
/* Initial D Zero has some built-in DirectInput support that is not
|
||||
particularly useful. idachook shorts this out by redirecting dinput8.dll
|
||||
to a no-op implementation of DirectInput. However, idacio does need to
|
||||
@ -321,8 +327,12 @@ static HRESULT idac_di_config_apply(const struct idac_di_config *cfg)
|
||||
}
|
||||
dprintf("Wheel: Start button . . . : %i\n", cfg->start);
|
||||
dprintf("Wheel: View Change button : %i\n", cfg->view_chg);
|
||||
dprintf("Wheel: Up button . . . . . : %i\n", cfg->up);
|
||||
dprintf("Wheel: Down button . . . . : %i\n", cfg->down);
|
||||
dprintf("Wheel: Left button . . . . : %i\n", cfg->left);
|
||||
dprintf("Wheel: Right button . . . : %i\n", cfg->right);
|
||||
dprintf("Wheel: LeftThumb button . : %i\n", cfg->leftThumb);
|
||||
dprintf("Wheel: RightThumb button : %i\n", cfg->rightThumb);
|
||||
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);
|
||||
@ -356,8 +366,12 @@ static HRESULT idac_di_config_apply(const struct idac_di_config *cfg)
|
||||
idac_di_off_accel = accel_axis->off;
|
||||
idac_di_start = cfg->start;
|
||||
idac_di_view_chg = cfg->view_chg;
|
||||
idac_di_up = cfg->up;
|
||||
idac_di_down = cfg->down;
|
||||
idac_di_left = cfg->left;
|
||||
idac_di_right = cfg->right;
|
||||
idac_di_leftThumb = cfg->leftThumb;
|
||||
idac_di_rightThumb = cfg->rightThumb;
|
||||
idac_di_shift_dn = cfg->shift_dn;
|
||||
idac_di_shift_up = cfg->shift_up;
|
||||
idac_di_reverse_brake_axis = cfg->reverse_brake_axis;
|
||||
@ -504,11 +518,19 @@ static void idac_di_get_buttons(uint8_t *gamebtn_out)
|
||||
gamebtn |= IDAC_IO_GAMEBTN_VIEW_CHANGE;
|
||||
}
|
||||
|
||||
if (idac_di_left && state.st.rgbButtons[idac_di_left - 1]) {
|
||||
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;
|
||||
}
|
||||
|
||||
if (idac_di_left && (state.st.rgbButtons[idac_di_left - 1] | state.st.rgbButtons[idac_di_leftThumb - 1])) {
|
||||
gamebtn |= IDAC_IO_GAMEBTN_LEFT;
|
||||
}
|
||||
|
||||
if (idac_di_right && state.st.rgbButtons[idac_di_right - 1]) {
|
||||
if (idac_di_right && (state.st.rgbButtons[idac_di_right - 1] | state.st.rgbButtons[idac_di_rightThumb - 1])) {
|
||||
gamebtn |= IDAC_IO_GAMEBTN_RIGHT;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user