1 Commits
Author SHA1 Message Date
popux 4bc46d3434 Gyro fix 2026-10-23 15:52:48 +02:00
4 changed files with 14 additions and 45 deletions

No files matched your search

+8 -7
View File
@@ -915,11 +915,12 @@ void inputApplyMouseRequests(void)
* Controller input is entirely independent of all of this. */
/* D594: on macOS the FOCUS_GAINED-driven click-to-lock is unreliable (AppKit
* key-window; no focus events over ssh), so start armed like PD's MLOCK_ON --
* the mouse is locked by default in-stage (see reconcileGrab()). Every other
* platform starts armed too: Steam Input's gyro (Steam Deck "Gamepad with Gyro"
* template) arrives as mouse motion with no click, so click-to-lock never
* captured it. Esc still releases (inputReleaseCapture), a click re-arms. */
static int captureArmed = 1;
* the mouse is locked by default in-stage (see reconcileGrab()). */
#ifdef PLATFORM_MACOS
static int captureArmed = 1; /* D594: PD MLOCK_ON default (see reconcileGrab) */
#else
static int captureArmed = 0; /* user has clicked to lock (capture mode) */
#endif
static int windowFocused = 1;
static int mouseAimSpeed = 16; /* aim-mode sensitivity, percent (B3: 50 -> 25 M-29 -> 16; still overshot at 25) */
static int gepdSens = 38; /* D194 Input.GepdSens: GEPD SENSITIVITY setting, range 1..500
@@ -1760,8 +1761,8 @@ int inputInit(void)
sysLogPrintf(LOG_INFO, "input: PC bindings, crouch mode %s",
crouchMode ? "toggle" : "hold");
/* Relative mouse mode for mouse-look. Armed by default (PD MLOCK_ON, see
* captureArmed): the grab is taken once a stage runs, no click needed. */
/* Relative mouse mode for mouse-look. Click-to-lock: we start released
* and wait for a click in the window (video.c -> inputNotifyClick). */
mouseGrabbed = 0;
if (mouseEnabled) {
if (mouseRawInput) {
-16
View File
@@ -301,12 +301,6 @@ static struct Row rows[] = {
* vertical/pitch sensitivity, %); input.c already applies it. */
{ .key="Input.MouseYScale", .label="Vertical sensitivity", .kind=ROW_SLIDER, .step=10,
.uiMin=10, .uiMax=400 }, /* D506: shown as a multiplier like the horizontal row, raw 100 = 1.0x */
/* Per-case scales on top of the two rows above: turning the camera vs moving the
* crosshair while aiming. Shown as multipliers of their defaults (50 / 38). */
{ .key="Input.MouseTurnSpeed", .label="Look speed", .kind=ROW_SLIDER, .step=5,
.uiMin=5, .uiMax=250 },
{ .key="Input.AimModeSens", .label="Aim speed", .kind=ROW_SLIDER, .step=4,
.uiMin=2, .uiMax=190 },
{ .key="Input.MouseInvertY", .label="Invert look", .kind=ROW_TOGGLE, .step=1, .names=kOnOff },
{ .key="Input.MouseSmoothing", .label="Smoothing", .kind=ROW_SLIDER, .step=5, .unit="%" },
{ .key="Input.MouseRawInput", .label="Raw input", .kind=ROW_TOGGLE, .step=1, .names=kOnOff },
@@ -2088,8 +2082,6 @@ static const struct { const char *key; double def; } kResetDefaults[] = {
{ "Input.CrosshairCursor", 1 }, /* = 1 (on, D555) */
{ "Input.MouseSensitivity", 100 }, /* static int mouseSensitivity = 100 */
{ "Input.MouseYScale", 100 }, /* = 100 (native), Wave A item 6 */
{ "Input.MouseTurnSpeed", 50 }, /* static int mouseTurnSpeed = 50 */
{ "Input.AimModeSens", 38 }, /* static int gepdSens = 38 */
{ "Input.MouseInvertY", 0 }, /* = 0 */
{ "Input.AimMode", 0 }, /* = AIMMODE_N64 (0) */
{ "Input.AimRange", 0 }, /* = 0 (PC) */
@@ -3005,14 +2997,6 @@ static void valueText(int i, char *out, int n)
snprintf(out, n, "%.1fx", v / 100.0);
return;
}
if (!strcmp(r->key, "Input.MouseTurnSpeed")) { /* default 50 = 1.0x */
snprintf(out, n, "%.1fx", v / 50.0);
return;
}
if (!strcmp(r->key, "Input.AimModeSens")) { /* default 38 = 1.0x */
snprintf(out, n, "%.1fx", v / 38.0);
return;
}
if (!strcmp(r->key, "Game.ScreenShakeIntensity")) { /* D181: shown as whole % */
snprintf(out, n, "%d%%", (int)lround(v * 100.0));
return;
+6 -13
View File
@@ -5075,19 +5075,12 @@ void sub_GAME_7F067FBC(f32 turn_x, f32 turn_y)
f32 mouse_x, mouse_y;
if (portMouseAimPdGetTurn(&mouse_x, &mouse_y)) {
if (g_PlayerIsInTank == 1) {
/* Tank aim turns mouse motion into a stepped stick (0 or 61..70) for the
* turret, which would make the undamped crosshair jitter: mouse position only */
turn_x = mouse_x;
turn_y = mouse_y;
} else {
/* The stick still offsets the crosshair from the mouse position, so
* gyro (sent as mouse) and right-stick aiming combine, as in PD */
turn_x += mouse_x;
turn_y += mouse_y;
turn_x = (turn_x < -1.0f) ? -1.0f : ((turn_x > 1.0f) ? 1.0f : turn_x);
turn_y = (turn_y < -1.0f) ? -1.0f : ((turn_y > 1.0f) ? 1.0f : turn_y);
}
/* The stick still offsets the crosshair from the mouse position, so
* gyro (sent as mouse) and right-stick aiming combine, as in PD */
turn_x += mouse_x;
turn_y += mouse_y;
turn_x = (turn_x < -1.0f) ? -1.0f : ((turn_x > 1.0f) ? 1.0f : turn_x);
turn_y = (turn_y < -1.0f) ? -1.0f : ((turn_y > 1.0f) ? 1.0f : turn_y);
guncrossdamp = 0.01f;
}
}
-9
View File
@@ -5864,15 +5864,7 @@ s32 objTick(struct PropRecord *prop)
{
pad36C = (struct DoorRecord *) prop->obj;
var_s2_6 = 1;
#ifdef PORT
/* The opaque distance is the N64 s32 at 0xC4, which the struct splits into CullDist/soundType/
* fadeTime60 (Facility lab doors: 0x00000258 = 600). On PC that raw offset lands on openPosition,
* so a closed door (0.0) read 0 and its glass stayed opaque until opened. Rebuild the word. */
pad36C->calculatedopacity = glassCalculateOpacity(&obj->runtime_pos, pad36C->TintDist,
(s32)(((u32)(u16)pad36C->CullDist << 16) | ((u32)(u8)pad36C->soundType << 8) | (u8)pad36C->fadeTime60), 0.0f);
#else
pad36C->calculatedopacity = glassCalculateOpacity(&obj->runtime_pos, pad36C->TintDist, *((s32 *) (((u8 *) pad36C) + 0xC4)), 0.0f);
#endif
if (playerCount == 1)
{
if ((pad36C->calculatedopacity != 0xFF) || (pad36C->openPosition > 0.0f))
@@ -14743,4 +14735,3 @@ void drop_inventory(void)
}
}
}