Add fullscreen display and SDL gamepad support to emulator - #1
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 253c941303
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| SDL_CloseGamepad(slot.gamepad); | ||
| return true; | ||
| }); | ||
| gamepads.erase(removed, gamepads.end()); |
There was a problem hiding this comment.
Preserve gamepad player slots on disconnect
When the first of two connected gamepads is unplugged, this erase compacts the vector, while gamepadPad() treats vector index 0/1 as player 1/2. In a two-player session with a transient disconnect of player 1's controller, the remaining player 2 controller starts driving player 1 and player 2 reads as disconnected; replugging the original controller then assigns it to player 2. Keep fixed slots or replace the removed slot with an empty entry so hotplugging does not silently swap player assignments.
Useful? React with 👍 / 👎.
Motivation
Description
SDL_WINDOW_FULLSCREENand keep the existing logical presentation usingSDL_SetRenderLogicalPresentationso the 320x180 framebuffer is letterboxed.GamepadSlotstruct, agamepadsvector, and lifecycle methodsopenAvailableGamepads,openGamepad,closeGamepad,closeAllGamepads, andgamepadPadtoSdlHostinemulator/include/e16/sdl_host.h.gamepadButtonsto map analog sticks (with a dead zone), D-pad, face buttons (South/East/West/North), start/back/shoulder buttons to E16 pad bits, and wire hotplug handling and input combination inemulator/src/sdl_host.cpp.README.mdto document fullscreen behavior and controller button/stick mappings.Testing
clang-format -i) over the changed files without error.cmake -S emulator -B emulator/build && cmake --build emulator/build, but configuration failed because the environment is missing thesdl3development package (pkg-config sdl3not found), so a full build could not be completed.Codex Task