mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -06:00
apply ayuanx's fix for classic controller events not being recognized if you are pressing certain combinations. fixes issue 1592
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4567 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -923,15 +923,23 @@ void FillReportExtension(wm_extension& _ext)
|
|||||||
_ext.jy = g_nu.jy.min;
|
_ext.jy = g_nu.jy.min;
|
||||||
if(IsKey(g_NunchuckExt.U))
|
if(IsKey(g_NunchuckExt.U))
|
||||||
_ext.jy = g_nu.jy.max;
|
_ext.jy = g_nu.jy.max;
|
||||||
|
|
||||||
|
// On a real stick, the initialization value of center is 0x80,
|
||||||
|
// but after a first time touch, the center value automatically changes to 0x7F
|
||||||
|
if(_ext.jx != g_nu.jx.center)
|
||||||
|
g_nu.jx.center = 0x7F;
|
||||||
|
if(_ext.jy != g_nu.jy.center)
|
||||||
|
g_nu.jy.center = 0x7F;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Get adjusted pad state values
|
// Get adjusted pad state values
|
||||||
int _Lx, _Ly, _Rx, _Ry, _Tl, _Tr;
|
int _Lx, _Ly, _Rx, _Ry, _Tl, _Tr;
|
||||||
PadStateAdjustments(_Lx, _Ly, _Rx, _Ry, _Tl, _Tr);
|
PadStateAdjustments(_Lx, _Ly, _Rx, _Ry, _Tl, _Tr);
|
||||||
// The Y-axis is inverted
|
// The Y-axis is inverted, but we should keep its initialization center value
|
||||||
_Ly = 0xff - _Ly;
|
// till it is touched for the first time
|
||||||
_Ry = 0xff - _Ry;
|
if (_Ly != g_nu.jy.center) _Ly = 0xFE - _Ly;
|
||||||
|
if (_Ry != g_nu.jy.center) _Ry = 0xFE - _Ry;
|
||||||
|
|
||||||
/* This is if we are also using a real Nunchuck that we are sharing the
|
/* This is if we are also using a real Nunchuck that we are sharing the
|
||||||
calibration with. It's not needed if we are using our default
|
calibration with. It's not needed if we are using our default
|
||||||
@ -945,8 +953,8 @@ void FillReportExtension(wm_extension& _ext)
|
|||||||
float Ly = (float)_Ly;
|
float Ly = (float)_Ly;
|
||||||
float Rx = (float)_Rx;
|
float Rx = (float)_Rx;
|
||||||
float Ry = (float)_Ry;
|
float Ry = (float)_Ry;
|
||||||
// float Tl = (float)_Tl;
|
//float Tl = (float)_Tl;
|
||||||
// float Tr = (float)_Tr;
|
//float Tr = (float)_Tr;
|
||||||
|
|
||||||
float XRangePos = (float) (g_nu.jx.max - g_nu.jx.center);
|
float XRangePos = (float) (g_nu.jx.max - g_nu.jx.center);
|
||||||
float XRangeNeg = (float) (g_nu.jx.center - g_nu.jx.min);
|
float XRangeNeg = (float) (g_nu.jx.center - g_nu.jx.min);
|
||||||
@ -1062,15 +1070,22 @@ void FillReportClassicExtension(wm_classic_extension& _ext)
|
|||||||
if(IsKey(g_ClassicContExt.Ld)) // down
|
if(IsKey(g_ClassicContExt.Ld)) // down
|
||||||
Ly = g_ClassicContCalibration.Ly.min;
|
Ly = g_ClassicContCalibration.Ly.min;
|
||||||
|
|
||||||
|
// On a real stick, the initialization value of center is 0x80,
|
||||||
|
// but after a first time touch, the center value automatically changes to 0x7F
|
||||||
|
if(Lx != g_ClassicContCalibration.Lx.center)
|
||||||
|
g_ClassicContCalibration.Lx.center = 0x7F;
|
||||||
|
if(Ly != g_ClassicContCalibration.Ly.center)
|
||||||
|
g_ClassicContCalibration.Ly.center = 0x7F;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Get adjusted pad state values
|
// Get adjusted pad state values
|
||||||
int _Lx, _Ly, _Rx, _Ry, _Tl, _Tr;
|
int _Lx, _Ly, _Rx, _Ry, _Tl, _Tr;
|
||||||
PadStateAdjustments(_Lx, _Ly, _Rx, _Ry, _Tl, _Tr);
|
PadStateAdjustments(_Lx, _Ly, _Rx, _Ry, _Tl, _Tr);
|
||||||
// The Y-axis is inverted
|
// The Y-axis is inverted, but we should keep its initialization center value
|
||||||
_Ly = 0xff - _Ly;
|
// till it is touched for the first time
|
||||||
_Ry = 0xff - _Ry;
|
if (_Ly != g_ClassicContCalibration.Ly.center) _Ly = 0xFE - _Ly;
|
||||||
|
if (_Ry != g_ClassicContCalibration.Ry.center) _Ry = 0xFE - _Ry;
|
||||||
|
|
||||||
/* This is if we are also using a real Classic Controller that we
|
/* This is if we are also using a real Classic Controller that we
|
||||||
are sharing the calibration with. It's not needed if we are
|
are sharing the calibration with. It's not needed if we are
|
||||||
@ -1104,15 +1119,23 @@ void FillReportClassicExtension(wm_classic_extension& _ext)
|
|||||||
Rx = g_ClassicContCalibration.Rx.max;
|
Rx = g_ClassicContCalibration.Rx.max;
|
||||||
if(IsKey(g_ClassicContExt.Rd)) // down
|
if(IsKey(g_ClassicContExt.Rd)) // down
|
||||||
Ry = g_ClassicContCalibration.Ry.min;
|
Ry = g_ClassicContCalibration.Ry.min;
|
||||||
|
|
||||||
|
// On a real stick, the initialization value of center is 0x80,
|
||||||
|
// but after a first time touch, the center value automatically changes to 0x7F
|
||||||
|
if(Rx != g_ClassicContCalibration.Rx.center)
|
||||||
|
g_ClassicContCalibration.Rx.center = 0x7F;
|
||||||
|
if(Ry != g_ClassicContCalibration.Ry.center)
|
||||||
|
g_ClassicContCalibration.Ry.center = 0x7F;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Get adjusted pad state values
|
// Get adjusted pad state values
|
||||||
int _Lx, _Ly, _Rx, _Ry, _Tl, _Tr;
|
int _Lx, _Ly, _Rx, _Ry, _Tl, _Tr;
|
||||||
PadStateAdjustments(_Lx, _Ly, _Rx, _Ry, _Tl, _Tr);
|
PadStateAdjustments(_Lx, _Ly, _Rx, _Ry, _Tl, _Tr);
|
||||||
// The Y-axis is inverted
|
// The Y-axis is inverted, but we should keep its initialization center value
|
||||||
_Ly = 0xff - _Ly;
|
// till it is touched for the first time
|
||||||
_Ry = 0xff - _Ry;
|
if (_Ly != g_ClassicContCalibration.Ly.center) _Ly = 0xFE - _Ly;
|
||||||
|
if (_Ry != g_ClassicContCalibration.Ry.center) _Ry = 0xFE - _Ry;
|
||||||
|
|
||||||
/* This is if we are also using a real Classic Controller that we
|
/* This is if we are also using a real Classic Controller that we
|
||||||
are sharing the calibration with. It's not needed if we are
|
are sharing the calibration with. It's not needed if we are
|
||||||
|
Reference in New Issue
Block a user