Skip to content

Jedi Knight: keys work at the menus after a quit and relaunch; console commands too - #39

Merged
finger563 merged 1 commit into
mainfrom
fix/jk-second-session-keys
Nov 23, 2026
Merged

finger563 merged 1 commit into
mainfrom
fix/jk-second-session-keys

Conversation

@finger563

Copy link
Copy Markdown
Contributor

Engine side: esp-cpp/OpenJKDF2#4. This PR bumps components/jk/OpenJKDF2 to that branch (e1598554).

Summary

  • Keys work at JK's menus after JK is quit and launched again in the same boot.
  • Console commands and cheats work in the third and later sessions. Their registration counts outlived their tables, so from the third session everything was "not recognized".
  • Desktop resets all globals at each launch; the ESP32 port didn't. These three are now reset per session. The broader per-session globals reset is left for a separate audit (details in the engine PR).

Testing (Tab5)

Four JK sessions in one boot. Each one starts level 1, ends it for real (cutscene, tally, Enter) and reaches level 2, then quits.

Before Now
Session 2: tally after level 1 ignores Enter forever advances
Session 3: console commands and cheats "not recognized" work
Sessions 1–4 all reach level 2; launcher at 18,833 K after each quit

The fix was reviewed adversarially, and no defects were found.

🤖 Generated with Claude Code

https://claude.ai/code/session_01SFCMzomCZ5wRHJN4sxwkvY

esp-cpp/OpenJKDF2 esp32/second-session-keys. After JK was quit and launched
again in the same boot, its message handler table still held the first
session's entries while the count started from zero. Keys and taps were
ignored at every menu (the first tally waited forever for Enter) and Esc no
longer opened JK's in-game menu. From the third session, console commands and
cheats were refused too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SFCMzomCZ5wRHJN4sxwkvY
@finger563
finger563 merged commit 0e74fa6 into main Nov 23, 2026
1 check passed
@finger563
finger563 deleted the fix/jk-second-session-keys branch November 23, 2026 02:42
finger563 added a commit that referenced this pull request Nov 23, 2026
…op (#40)

esp-cpp/OpenJKDF2 esp32/session-globals-reset. tab5-emu runs the engine more
than once per boot, but unlike desktop's launcher it never reset the engine's
globals between launches. So state from the last session carried over: the
handler table and the console counts were found and fixed by hand in #39, and
a quit before any level, after a session that had played one, freed a HUD
buffer twice. The engine now resets all of its generated globals at the start
of each launch. Two small leaks that would otherwise have become permanent
are fixed at the source.


Claude-Session: https://claude.ai/code/session_01SFCMzomCZ5wRHJN4sxwkvY

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant