Skip to content

Commit aaae872

Browse files
JoeMattclaude
andcommitted
Initialize jag_retropad to BUTTON_NONE to prevent phantom inputs
Zero-initialized jag_retropad entries map to BUTTON_U (index 0), causing unintended up-presses for unmapped retropad buttons when alt_inputs is enabled. Co-Authored-By: Claude Opus 4.6 <[email protected]>
1 parent ba79b83 commit aaae872

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

libretro.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,11 +347,17 @@ static void check_variables(void)
347347

348348
for (i = 0; i < 2; i++)
349349
{
350+
int j;
350351
char base[20];
351352
char key[64];
352353
size_t _len = strlcpy(base, "virtualjaguar_p", sizeof(base));
353354
snprintf(base + _len, sizeof(base) - _len, "%d", i + 1);
354355

356+
/* Initialize all retropad mappings to BUTTON_NONE so unmapped
357+
* entries don't accidentally trigger BUTTON_U (index 0). */
358+
for (j = 0; j < 24; j++)
359+
jag_retropad[i][j] = BUTTON_NONE;
360+
355361
strlcpy(key, base, sizeof(key));
356362
strlcat(key, "_numpad_to_kb", sizeof(key));
357363
var.key = key;

0 commit comments

Comments
 (0)