diff --git a/src/burn/burn_gun.cpp b/src/burn/burn_gun.cpp index e08a60d1e..bc4668d22 100644 --- a/src/burn/burn_gun.cpp +++ b/src/burn/burn_gun.cpp @@ -12,6 +12,8 @@ bool bBurnGunAutoHide = 1; static bool bBurnGunDrawTargets = true; // game-configured bool bBurnGunDrawReticles = true; // UI-configured +bool bBurnGunPositionalMode = false; + static INT32 Using_Trackball = 0; static INT32 nBurnGunMaxX = 0; @@ -539,6 +541,19 @@ void BurnGunMakeInputs(INT32 num, INT16 x, INT16 y) if (bBurnRunAheadFrame) return; // remove jitter w/runahead + if (bBurnGunPositionalMode) { + x = ProcessAnalog(x, 0, INPUT_DEADZONE, 0x00, 0xff); + y = ProcessAnalog(y, 0, INPUT_DEADZONE, 0x00, 0xff); + + BurnGunX[num] = ((x * nBurnGunMaxX / 0xff) - 8) << 8; + BurnGunY[num] = ((y * nBurnGunMaxY / 0xff) - 8) << 8; + + for (INT32 i = 0; i < nBurnGunNumPlayers; i++) + GunTargetUpdate(i); + + return; + } + if (y == 1 || y == -1) y = 0; if (x == 1 || x == -1) x = 0; // prevent walking crosshair diff --git a/src/burner/win32/cona.cpp b/src/burner/win32/cona.cpp index 1d85c92b5..11f58bd29 100644 --- a/src/burner/win32/cona.cpp +++ b/src/burner/win32/cona.cpp @@ -7,6 +7,8 @@ int nIniVersion = 0; +extern bool bBurnGunPositionalMode; + struct VidPresetData VidPreset[4] = { { 640, 480}, { 1024, 768}, @@ -270,6 +272,7 @@ int ConfigAppLoad() VAR(bBurnUseBlend); VAR(BurnShiftEnabled); VAR(bBurnGunDrawReticles); + VAR(bBurnGunPositionalMode); VAR(bSkipStartupCheck); VAR(nSlowMo); @@ -709,6 +712,9 @@ int ConfigAppSave() _ftprintf(h, _T("\n// If non-zero, enable lightgun reticle display support.\n")); VAR(bBurnGunDrawReticles); + _ftprintf(h, _T("\n// If non-zero, enable lightgun positional mode (Sinden or real lightgun HW).\n")); + VAR(bBurnGunPositionalMode); + _ftprintf(h, _T("\n// If non-zero, DISABLE start-up rom scan (if needed).\n")); VAR(bSkipStartupCheck);