diff --git a/README.md b/README.md index ea4395ef..39abd0f3 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ Report problems as issues, following [CONTRIBUTING.md](CONTRIBUTING.md). - In-game settings menu (F1, or Minus and Plus together on a gamepad) and performance overlay (F10) - Keyboard, mouse and gamepads with remapping, Nintendo, Xbox or PlayStation button layout, rumble and gyro; the game follows whichever connected gamepad you press, and DualShock 3 controllers are read directly when enabled -- Xbox, PlayStation and keyboard and mouse button prompts in the game's own text, drawn on your PC when the game is +- Xbox, PlayStation, Steam Deck and keyboard and mouse button prompts in the game's own text, drawn on your PC when the game is built; the keyboard prompts follow your key bindings - Stereo or 5.1 surround sound output, on the output device of your choice; the default microphone for the game's microphone input diff --git a/THIRD_PARTY_NOTICES.md b/THIRD_PARTY_NOTICES.md index 27b53c19..26317abd 100644 --- a/THIRD_PARTY_NOTICES.md +++ b/THIRD_PARTY_NOTICES.md @@ -125,7 +125,7 @@ folder's `licenses/` and in each component's own folder. | NVIDIA DLSS 310.9.1 (`nvngx_dlss.dll`, NVIDIA's own build, unmodified; pinned with its size and sha256 in `tools/dlss_pin.py`) | https://github.com/NVIDIA/DLSS @ `v310.9.1` (`lib/Windows_x86_64/rel/nvngx_dlss.dll`), Copyright NVIDIA Corporation | NVIDIA RTX SDKs License (https://github.com/NVIDIA/DLSS/blob/v310.9.1/LICENSE.txt); licensed for systems with NVIDIA GPUs only | `app//bin/` with `nvngx_dlss-NOTICE.txt`, also in the build kit's `bin/`; `tools/make_game.py` copies both beside the built game, where NGX loads the library (`runtime/vk_dlaa.c`) | | NVIDIA DLSS 310.9.1 for Linux (`libnvidia-ngx-dlss.so.310.9.1`, NVIDIA's own build, unmodified; pinned with its size and sha256 in `tools/dlss_pin.py`) | https://github.com/NVIDIA/DLSS @ `v310.9.1` (`lib/Linux_x86_64/rel/libnvidia-ngx-dlss.so.310.9.1`), Copyright NVIDIA Corporation | NVIDIA RTX SDKs License (https://github.com/NVIDIA/DLSS/blob/v310.9.1/LICENSE.txt), the one licence of the repository's Windows and Linux libraries; licensed for systems with NVIDIA GPUs only | the Linux build kit's `bin/` (the AppImage of `tools/make_appimage.py`, unless made with `--no-dlss`) with `libnvidia-ngx-dlss-NOTICE.txt`; `tools/make_game.py` copies both beside the built game, where NGX loads the library (`runtime/vk_dlaa.c`) | | NVIDIA Streamline 2.14.16 runtime (`sl.interposer.dll`, `sl.common.dll`, `sl.dlss_g.dll`, `sl.pcl.dll`, `sl.reflex.dll`, NVIDIA's own builds, unmodified) and NVIDIA DLSS Frame Generation 310.9.16 (`nvngx_dlssg.dll`, as the Streamline SDK ships it) | https://github.com/NVIDIA-RTX/Streamline, SDK release 2.14.16 (`bin/x64/`), Copyright NVIDIA Corporation | Streamline: MIT; `nvngx_dlssg.dll`: NVIDIA RTX SDKs License, licensed for systems with NVIDIA GPUs only | `app//bin/dlssg/` with both licence texts and `dlssg-NOTICE.txt` (each file's sha256), when the release is made with `tools/make_launcher.py --dlssg`, and the build kit's `bin/dlssg/` with `tools/make_kit.py --dlssg` (the SDK release pinned with its size and sha256 and each file's sha256 in `tools/streamline_pin.py`); `tools/make_game.py` copies them beside the built game, where `nx2navi_dlssg.dll` (this repository's `runtime/dlssg/`, built with the Streamline SDK's MIT headers) loads them (`runtime/vk_dlssg.c`) | -| Button prompt art: the 128x128 PNGs of the Input Prompts Pack V7 (`XGamepad`, `P5Gamepad` and `Keyboard_Mouse` styles), unmodified | the pack as licensed to the repository owner; never in this repository | the pack's licence, which allows redistributing these pictures in NX2navi's releases (confirmed by the repository owner, 2026-11-09) | `app//prompt-art/` and the build kit's `prompt-art/` when made with `--prompt-art` (`tools/prompt_art.py`); `tools/pad_prompts.py` draws the game's Xbox, PlayStation and keyboard and mouse prompts from them on the player's PC | +| Button prompt art: the 128x128 PNGs of the Input Prompts Pack V7 (`XGamepad`, `P5Gamepad` and `Keyboard_Mouse` styles), unmodified | the pack as licensed to the repository owner; never in this repository | the pack's licence, which allows redistributing these pictures in NX2navi's releases (confirmed by the repository owner, 2026-11-09) | `app//prompt-art/` and the build kit's `prompt-art/` when made with `--prompt-art` (`tools/prompt_art.py`); `tools/pad_prompts.py` draws the game's Xbox, PlayStation, Steam Deck (from the Xbox and PlayStation pictures) and keyboard and mouse prompts from them on the player's PC | Downloaded on the player's PC by the launcher, not distributed: the MSYS2 UCRT64 packages that `toolchain.lock.json` pins (clang and LLVM, Apache-2.0 with LLVM exception; GCC and binutils, GPL-3.0; the diff --git a/docs/README-BuildKit.md b/docs/README-BuildKit.md index 98b0d4d3..04cb8871 100644 --- a/docs/README-BuildKit.md +++ b/docs/README-BuildKit.md @@ -25,7 +25,7 @@ downloads included, and keeps the game up to date. This page is the same build b ``` `zbic` unpacks the game's compressed program files. It is a separate GPL-2.0 package you install yourself; the kit - only calls it. `fonttools` and `pillow` draw the Xbox, PlayStation and keyboard and mouse button prompts, when the + only calls it. `fonttools` and `pillow` draw the Xbox, PlayStation, Steam Deck and keyboard and mouse button prompts, when the kit has a `prompt-art` folder. 2. **MSYS2** from [msys2.org](https://www.msys2.org/), installed to the default `C:\msys64`. Open **MSYS2 UCRT64** from @@ -53,7 +53,7 @@ The build checks the version, unpacks the program files, packs the 26 GB RomFS i the dump's own checksums) while it turns the game's code into C and compiles it (about 6 minutes on a 16-thread Ryzen 7; longer on fewer cores), then prepares every one of the game's shaders for your graphics card (about 5 more minutes), so the game does not stop to compile shaders while you play. When the kit has a `prompt-art` folder, it -last draws the Xbox, PlayStation and keyboard and mouse button prompts from that art (about a minute) into the +last draws the Xbox, PlayStation, Steam Deck and keyboard and mouse button prompts from that art (about a minute) into the `romfs-patches-*` folders beside the game. The game it builds is for this PC's processor. You can use your PC meanwhile. If it stops, run the same command again: finished steps are skipped. @@ -150,7 +150,7 @@ beside the game. upscaling on, and the frame limit then counts the frames on screen; with no limit chosen it is the display's refresh rate), HDR (the game's picture tone mapped to your display, with its own grading rows, or Native, the game's own HDR; turn HDR on in Windows first) and the resolution. Those marked "after restart" take effect when the game starts again. -- **Controls** in the menu has Button prompts: the game's own, or Xbox, PlayStation or keyboard and mouse ones when +- **Controls** in the menu has Button prompts: the game's own, or Xbox, PlayStation, Steam Deck or keyboard and mouse ones when the build drew them (a kit with `prompt-art`). It takes effect after a restart. The keyboard and mouse prompts show the keys `nx2navi.ini` binds when the build runs: after rebinding keys, run `py -I tools\make_game.py --rebuild --out "C:\Games\Ocarina"` to draw them again (it skips everything else). diff --git a/docs/controls.md b/docs/controls.md index 8fd82b9a..a5f00305 100644 --- a/docs/controls.md +++ b/docs/controls.md @@ -23,7 +23,7 @@ letters unless *Button prompts* says otherwise (below). ## Button prompts -`NX2NAVI_PROMPTS` (`prompts`, the *Button prompts* row on the Controls tab) picks the buttons the game's prompts show: `nintendo` (default, the game's own), `xbox`, `playstation` or `pc` (*Keyboard and mouse*). It changes three things the game draws: +`NX2NAVI_PROMPTS` (`prompts`, the *Button prompts* row on the Controls tab) picks the buttons the game's prompts show: `nintendo` (default, the game's own), `xbox`, `playstation`, `steamdeck` or `pc` (*Keyboard and mouse*). It changes three things the game draws: - the button font every prompt in text uses (dialogue, the button guides, the controls screen): A B X Y, L R ZL ZR, Plus and Minus, the d-pad and the sticks with their directions become that pad's buttons (LB RB LT RT, Menu and View; L1 R1 L2 R2, Options and Create; its d-pad and sticks), or the keys. Power, Home and the console stay; - the letter in the action prompt (top right); @@ -35,13 +35,13 @@ A, B, X and Y show the button the *Button layout* presses: with `nintendo` (by p The game reads the font and the interface textures once at start, so a change shows after a restart (the row says so; the menu's Restart button restarts). A button or key remapped on this tab keeps its old prompt until the folders are made again. -The prompts live in overlay folders next to the exe, `romfs-patches-xbox`, `romfs-patches-xbox-label`, `romfs-patches-playstation` and `romfs-patches-playstation-label` (by position and by label) and `romfs-patches-pc`, which `runtime/romfs.c` loads in place of the game's files. `tools/pad_prompts.py` draws them on the player's machine from the player's own RomFS and a folder of button art, which the repository does not hold. A launcher release or build kit made with `--prompt-art` carries that art (`prompt-art`, `tools/prompt_art.py`), and `tools/make_game.py` draws every folder in its last step, again whenever the art, the tools or the `bind_` lines change (so a rebuild after rebinding keys brings the keyboard prompts up to date). By hand: +The prompts live in overlay folders next to the exe, `romfs-patches-xbox`, `romfs-patches-xbox-label`, `romfs-patches-playstation`, `romfs-patches-playstation-label`, `romfs-patches-steamdeck` and `romfs-patches-steamdeck-label` (by position and by label) and `romfs-patches-pc`, which `runtime/romfs.c` loads in place of the game's files. `tools/pad_prompts.py` draws them on the player's machine from the player's own RomFS and a folder of button art, which the repository does not hold. A launcher release or build kit made with `--prompt-art` carries that art (`prompt-art`, `tools/prompt_art.py`), and `tools/make_game.py` draws every folder in its last step, again whenever the art, the tools or the `bind_` lines change (so a rebuild after rebinding keys brings the keyboard prompts up to date). By hand: ``` python tools\pad_prompts.py --art \Source --game ``` -`--style xbox|playstation|pc` makes one style; the keys come from `\nx2navi.ini` (`--binds` names another). The art folder holds `XGamepad/Default`, `XGamepad/Light`, `P5Gamepad/Default`, `P5Gamepad/Light`, `Keyboard_Mouse/Dark` and `Keyboard_Mouse/White` with the file names of `STYLES` and `KEY_ART` in the tool; a key it has no picture of is written on `Keyboard_Mouse/Blanks`. Without the folders the row says *prompt files missing* and the Switch prompts stay; so they do when a RomFS mod replaces one of the same files (*off: a RomFS mod replaces their files*). The log has a `RomFS overlay: ... button prompts` line for the folder in use. The tool needs fontTools, Pillow and zstandard (`tools/requirements-py314.txt`). +`--style xbox|playstation|steamdeck|pc` makes one style; `steamdeck` shows the Deck's own labels (A B X Y where an Xbox pad has them, L1 R1 L2 R2 and L3 R3, Menu and View) and is drawn from the Xbox and PlayStation pictures, as the art has no Deck style; the keys come from `\nx2navi.ini` (`--binds` names another). The art folder holds `XGamepad/Default`, `XGamepad/Light`, `P5Gamepad/Default`, `P5Gamepad/Light`, `Keyboard_Mouse/Dark` and `Keyboard_Mouse/White` with the file names of `STYLES` and `KEY_ART` in the tool; a key it has no picture of is written on `Keyboard_Mouse/Blanks`. Without the folders the row says *prompt files missing* and the Switch prompts stay; so they do when a RomFS mod replaces one of the same files (*off: a RomFS mod replaces their files*). The log has a `RomFS overlay: ... button prompts` line for the folder in use. The tool needs fontTools, Pillow and zstandard (`tools/requirements-py314.txt`). The actions are the game's own, as its *Basic Controls* screen (Plus menu, System) names them: diff --git a/docs/launcher.md b/docs/launcher.md index 8b72897b..5cc12655 100644 --- a/docs/launcher.md +++ b/docs/launcher.md @@ -133,7 +133,7 @@ A path the Windows ANSI code page cannot hold breaks the MSYS2 tools, so the too 3 minutes without a count moving it says so, and that the step is still running. 4. **Draw the Button Prompts**, only when the version holds button art (`app//prompt-art`, a release made with `--prompt-art`; `build.has_prompt_art`): make_game.py's last step runs `tools/pad_prompts.py` on that art - and writes the Xbox, PlayStation and keyboard and mouse prompts into `romfs-patches-*` beside the game (about + and writes the Xbox, PlayStation, Steam Deck and keyboard and mouse prompts into `romfs-patches-*` beside the game (about 30 s), which the game's Controls > Button prompts loads. The keyboard and mouse prompts show the keys of `nx2navi.ini`'s `bind_` lines, so Rebuild the Game after rebinding keys draws them again; the step's key names all it reads (the RomFS, the art, the tools, those lines), so it runs again only when one changed or a folder is diff --git a/launcher/jobs.py b/launcher/jobs.py index 83cec210..22e17e7d 100644 --- a/launcher/jobs.py +++ b/launcher/jobs.py @@ -27,7 +27,7 @@ STEPS = { 'change are kept from the last build.'), 'shaders': ('Prepare the Shaders', "Building the game's known shaders for your graphics card ahead of time, so " 'play stops for them far less often.'), - 'prompts': ('Draw the Button Prompts', 'Drawing the Xbox, PlayStation and keyboard and mouse button prompts the ' + 'prompts': ('Draw the Button Prompts', 'Drawing the Xbox, PlayStation, Steam Deck and keyboard and mouse button prompts the ' "game's Controls menu offers under Button prompts."), 'scan': ('Check the Game Files', 'Decompressing every game file once to find damage, and standing in for damaged ' 'textures so the world still loads.'), diff --git a/nx2navi.ini.example b/nx2navi.ini.example index f9d13ccc..6169f10d 100644 --- a/nx2navi.ini.example +++ b/nx2navi.ini.example @@ -501,9 +501,10 @@ # pad with Nintendo labels, xbox for the others). The bind_ lines below apply # on top. Changes while the game runs take effect at once. 0.1.9's xbox_prompts is read as nintendo with prompts = xbox. # pad_layout = nintendo -# The buttons the game's prompts show: nintendo (the game's own), xbox (LB RB LT RT, Menu, View) or playstation (L1 R1 -# L2 R2, Options, Create), with A B X Y as the button pad_layout presses is labelled: with nintendo, A shows as B or -# circle and X as Y or triangle. pc: the key each button has (the bind_ lines below when the files are made), WASD +# The buttons the game's prompts show: nintendo (the game's own), xbox (LB RB LT RT, Menu, View), playstation (L1 R1 +# L2 R2, Options, Create) or steamdeck (the Deck's A B X Y, L1 R1 L2 R2, Menu, View), with A B X Y as the button +# pad_layout presses is labelled: with nintendo, A shows as B or circle and X as Y or triangle. pc: the key each +# button has (the bind_ lines below when the files are made), WASD # and the mouse. Read at start; their files come from tools/pad_prompts.py (docs/controls.md, "Button prompts"). # prompts = nintendo # Gamepad stick dead zone in percent of full deflection (0 to 50). Raise it for a stick that drifts: inside the circle diff --git a/runtime/cfg.c b/runtime/cfg.c index 29d49e88..e6ebc88c 100644 --- a/runtime/cfg.c +++ b/runtime/cfg.c @@ -191,7 +191,7 @@ static const CfgMeta metas[] = { {"MOTION", "1", "0|1", LIVE}, {"RUMBLE_STRENGTH", "130", "0..300", LIVE}, {"RUMBLE_CURVE", "0.6", "0.2..1.5", LIVE}, {"RUMBLE_TRIGGERS", "0", "0|1", LIVE}, {"PAD_LAYOUT", "nintendo", "auto|nintendo|xbox|playstation", LIVE}, {"DS3", "0", "0|1", LIVE}, // input_ds3_win.c ds3_read: read a DualShock 3 directly; off: no HID scan - {"PROMPTS", "nintendo", "nintendo|xbox|playstation|pc", RESTART}, + {"PROMPTS", "nintendo", "nintendo|xbox|playstation|steamdeck|pc", RESTART}, {"STICK_DEADZONE", "8", "0..50", LIVE}, {"STICK_SENS", "1", "0.1..3", LIVE}, // camera_speed.c cam_speed_tick {"LSTICK_DEADZONE", "", "0..50", LIVE}, {"RSTICK_DEADZONE", "", "0..50", LIVE}, {"MOUSE_MODE", "direct", "stick|direct", LIVE}, diff --git a/runtime/cfg_probe.c b/runtime/cfg_probe.c index 585c2f89..bf61d250 100644 --- a/runtime/cfg_probe.c +++ b/runtime/cfg_probe.c @@ -381,6 +381,13 @@ int probe_cfg(void) { input_prompts_pick("playstation", "xbox_prompts") == PROMPTS_PLAYSTATION && input_prompts_pick("ps", "nintendo") == PROMPTS_NINTENDO, "prompts: playstation in any case; an unknown value is the game's own"); + CHECK(input_prompts_pick("SteamDeck", "nintendo") == PROMPTS_STEAMDECK && + input_prompts_pick("steamdeck", "xbox_prompts") == PROMPTS_STEAMDECK && + EQ(input_prompts_folder(PROMPTS_STEAMDECK, "nintendo"), "romfs-patches-steamdeck") && + EQ(input_prompts_folder(PROMPTS_STEAMDECK, "xbox"), "romfs-patches-steamdeck-label") && + EQ(input_prompts_folder(PROMPTS_STEAMDECK, "auto"), "romfs-patches-steamdeck-label") && + EQ(input_prompts_folder(PROMPTS_STEAMDECK, NULL), "romfs-patches-steamdeck-label"), + "prompts: steamdeck in any case, its face buttons by position for the Nintendo layout, by label otherwise"); CHECK(EQ(input_prompts_folder(PROMPTS_PLAYSTATION, "nintendo"), "romfs-patches-playstation") && EQ(input_prompts_folder(PROMPTS_PLAYSTATION, "xbox_prompts"), "romfs-patches-playstation") && EQ(input_prompts_folder(PROMPTS_PLAYSTATION, "xbox"), "romfs-patches-playstation-label") && diff --git a/runtime/input_map.c b/runtime/input_map.c index 9c208f75..2b55ca87 100644 --- a/runtime/input_map.c +++ b/runtime/input_map.c @@ -299,6 +299,7 @@ int input_prompts_pick(const char *prompts, const char *pad_layout) { if (prompts && *prompts) return !strcasecmp(prompts, "xbox") ? PROMPTS_XBOX : !strcasecmp(prompts, "playstation") ? PROMPTS_PLAYSTATION + : !strcasecmp(prompts, "steamdeck") ? PROMPTS_STEAMDECK : !strcasecmp(prompts, "pc") ? PROMPTS_PC : PROMPTS_NINTENDO; return pad_layout && !strcasecmp(pad_layout, "xbox_prompts") ? PROMPTS_XBOX : PROMPTS_NINTENDO; @@ -306,11 +307,12 @@ int input_prompts_pick(const char *prompts, const char *pad_layout) { const char *input_prompts_folder(int prompts, const char *pad_layout) { if (prompts == PROMPTS_PC) return "romfs-patches-pc"; - if (prompts != PROMPTS_XBOX && prompts != PROMPTS_PLAYSTATION) return NULL; + if (prompts != PROMPTS_XBOX && prompts != PROMPTS_PLAYSTATION && prompts != PROMPTS_STEAMDECK) return NULL; // The folders are read at start, before a pad is open: auto counts as Xbox, as for a pad without Nintendo labels. // A Nintendo-labelled pad under auto plays by label too (its A is on the button labelled A), so it matches as well. int by_position = input_pad_layout_pick(pad_layout, 0) == PAD_LAYOUT_NINTENDO; if (prompts == PROMPTS_PLAYSTATION) return by_position ? "romfs-patches-playstation" : "romfs-patches-playstation-label"; + if (prompts == PROMPTS_STEAMDECK) return by_position ? "romfs-patches-steamdeck" : "romfs-patches-steamdeck-label"; return by_position ? "romfs-patches-xbox" : "romfs-patches-xbox-label"; } diff --git a/runtime/input_map.h b/runtime/input_map.h index 9718e9fe..024bfd32 100644 --- a/runtime/input_map.h +++ b/runtime/input_map.h @@ -88,17 +88,19 @@ void input_map_configure(void); // button is labelled A (a Switch Pro Controller, a GuliKit) and Xbox otherwise. int input_pad_layout_pick(const char *setting, int east_labelled_a); -// Button prompts (NX2NAVI_PROMPTS): the controller whose buttons the game's prompts show. Nintendo: the game's own. Xbox -// and PlayStation: that pad's buttons (LB RB LT RT, Menu and View; L1 R1 L2 R2, Options and Create), and the face buttons -// named by the label of the button the pad layout presses (runtime/romfs.c overlay_init, tools/pad_prompts.py). PC: -// the key or mouse button the keyboard defaults press each button with, the mouse for the right stick. -enum { PROMPTS_NINTENDO, PROMPTS_XBOX, PROMPTS_PC, PROMPTS_PLAYSTATION }; -// The prompts for a NX2NAVI_PROMPTS value ("nintendo", "xbox", "playstation" or "pc", any case). Unset or empty: Xbox -// while the pad layout setting is "xbox_prompts", else Nintendo. +// Button prompts (NX2NAVI_PROMPTS): the controller whose buttons the game's prompts show. Nintendo: the game's own. Xbox, +// PlayStation and Steam Deck: that pad's buttons (LB RB LT RT, Menu and View; L1 R1 L2 R2, Options and Create; the +// Deck's A B X Y with L1 R1 L2 R2, Menu and View), and the face buttons named by the label of the button the pad layout +// presses (runtime/romfs.c overlay_init, tools/pad_prompts.py). PC: the key or mouse button the keyboard defaults press +// each button with, the mouse for the right stick. +enum { PROMPTS_NINTENDO, PROMPTS_XBOX, PROMPTS_PC, PROMPTS_PLAYSTATION, PROMPTS_STEAMDECK }; +// The prompts for a NX2NAVI_PROMPTS value ("nintendo", "xbox", "playstation", "steamdeck" or "pc", any case). Unset or +// empty: Xbox while the pad layout setting is "xbox_prompts", else Nintendo. int input_prompts_pick(const char *prompts, const char *pad_layout); // The folder next to romfs-index.bin that holds those prompts for a NX2NAVI_PAD_LAYOUT value, NULL for the game's own. The // Nintendo layout plays a pad by position, so its folder names the face buttons the other way round -// (romfs-patches-xbox: the right button does A and is labelled B; romfs-patches-playstation: it is circle); xbox and +// (romfs-patches-xbox and romfs-patches-steamdeck: the right button does A and is labelled B; +// romfs-patches-playstation: it is circle); xbox and // auto put every Switch button on the button labelled with its letter, or on cross, circle, square and triangle in // that order (auto picks the layout per pad by its labels), so they share romfs-patches-