add bBurnGunPositionalMode (fbneo.ini), to put lightgun in Positional Mode

This commit is contained in:
dinkc64 2024-04-21 09:51:06 -04:00
parent a13556aac1
commit c6c566bf1f
2 changed files with 21 additions and 0 deletions

View File

@ -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

View File

@ -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);