Add Steam Deck button prompts beside the Xbox and PlayStation ones (prompts = steamdeck).

The Controls tab's Button prompts row and nx2navi.ini take steamdeck: the Deck's own labels in the game's
text, action prompt and ocarina notes, which are A B X Y where an Xbox pad has them, L1 R1 L2 R2 and L3 R3,
Menu and View. The style is drawn by tools/pad_prompts.py like the others, into romfs-patches-steamdeck
and romfs-patches-steamdeck-label, and every build with button art writes them.

Pull request #107 by loteran asked for PlayStation and Steam Deck prompts; it was closed, and the tree
took the PlayStation half in another form, drawn from button art instead of redrawn font glyphs. This is
the Steam Deck half in that form, written here: the art has no Deck style, so its entry in
tools/prompt_art.py names the Xbox pictures for the face buttons, Menu, View, the d-pad and the sticks
and the PlayStation pictures for the shoulders and stick clicks. It needs four pictures of the Xbox set
that no other style used (the white letters on a light button, for the ocarina's notes); a release made
with --prompt-art copies them with the rest.

The Windows files compile and tests/launcher_test.py passes, with the prompts step's test following the
number of folders (seven now); every picture the style names is in the art used for releases. The style
was not drawn here (that needs the game's font), and --probe-cfg, which has a new check, was not run.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
chrg6
2026-11-10 06:53:30 -05:00
parent bc4ea7574f
commit 75b0dca907
21 changed files with 90 additions and 47 deletions

View File

@@ -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},

View File

@@ -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") &&

View File

@@ -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";
}

View File

@@ -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-<style>-label. The PC prompts
// follow no pad: romfs-patches-pc whatever the layout (romfs.c overlay_init serves romfs-patches-pc-<w>x<h> under that

View File

@@ -787,7 +787,17 @@ static void camera_overlay(void) {
// did not load (ROMFS_PROMPTS_*). The menu compares them with the settings in effect (ui/menu.cpp prompts_note).
// romfs-patches-pc keeps that name, but at a game resolution of another shape than 16:9 its files come from pc_dir,
// romfs-patches-pc-<w>x<h> (overlay_init).
#define PROMPTS_FOLDERS 5 // Xbox and PlayStation by position and by label, then PC
#define PROMPTS_PADS 3 // the pad styles: Xbox, PlayStation, Steam Deck
#define PROMPTS_FOLDERS (PROMPTS_PADS * 2 + 1) // each pad style by position and by label, then PC
// A style's name in the log and its NX2NAVI_PROMPTS value.
static const char *prompts_style(int pick) {
return pick == PROMPTS_PC ? "keyboard and mouse" : pick == PROMPTS_PLAYSTATION ? "PlayStation"
: pick == PROMPTS_STEAMDECK ? "Steam Deck" : "Xbox";
}
static const char *prompts_value(int pick) {
return pick == PROMPTS_PC ? "pc" : pick == PROMPTS_PLAYSTATION ? "playstation"
: pick == PROMPTS_STEAMDECK ? "steamdeck" : "xbox";
}
static struct { const char *name; int ready; } prompts_folders[PROMPTS_FOLDERS];
static const char *prompts_wanted, *prompts_loaded;
static int prompts_off;
@@ -830,7 +840,7 @@ static void overlay_init(void) {
// A game resolution that is not 16:9 takes romfs-patches-<w>x<h> instead when it is there: the same overlay with
// the UI laid out for that shape (make_romfs_patches.py --aspect), when the game version has the camera aspect patch
// the layout goes with (res_wants_wide_overlay).
// With prompts = xbox or playstation, that pad's prompts folder for the pad layout in its place
// With prompts = xbox, playstation or steamdeck, that pad's prompts folder for the pad layout in its place
// (input_prompts_folder): the game's button font and interface textures with that pad's buttons drawn in
// (tools/pad_prompts.py). The game reads the font and the archives once at boot, so
// the prompts stay until restart even though the layout itself changes live. Each folder replaces romfs-patches as
@@ -857,7 +867,7 @@ static void overlay_init(void) {
}
}
static const char *const layouts[2] = {"nintendo", "xbox"}; // each pad's two folders, then the PC one
static const int pads[2] = {PROMPTS_XBOX, PROMPTS_PLAYSTATION};
static const int pads[PROMPTS_PADS] = {PROMPTS_XBOX, PROMPTS_PLAYSTATION, PROMPTS_STEAMDECK};
for (int i = 0; i < PROMPTS_FOLDERS; i++) {
int pc = i == PROMPTS_FOLDERS - 1;
const char *name = pc ? input_prompts_folder(PROMPTS_PC, 0) : input_prompts_folder(pads[i / 2], layouts[i % 2]);
@@ -873,7 +883,7 @@ static void overlay_init(void) {
}
const char *layout = cfg_value("NX2NAVI_PAD_LAYOUT");
int pick = input_prompts_pick(cfg_get("NX2NAVI_PROMPTS"), layout), shaped = wide && pick == PROMPTS_PC;
const char *style = pick == PROMPTS_PC ? "keyboard and mouse" : pick == PROMPTS_PLAYSTATION ? "PlayStation" : "Xbox";
const char *style = prompts_style(pick);
prompts_wanted = input_prompts_folder(pick, layout);
prompts_off = !prompts_wanted ? ROMFS_PROMPTS_OK
: wide && !shaped ? ROMFS_PROMPTS_SHAPE
@@ -895,7 +905,7 @@ static void overlay_init(void) {
}
} else if (prompts_wanted) {
rt_log("RomFS overlay: prompts = %s, but %s; Switch prompts stay",
pick == PROMPTS_PC ? "pc" : pick == PROMPTS_PLAYSTATION ? "playstation" : "xbox",
prompts_value(pick),
prompts_off == ROMFS_PROMPTS_SHAPE ? (shaped ? "the game resolution has no romfs-patches-pc-<w>x<h> "
"(tools/make_romfs_patches.py --prompts pc --aspect)"
: "the game resolution takes its own UI layout")

View File

@@ -1311,12 +1311,12 @@ static void tab_controls(float scale) {
static const UiTextId layout[] = {UI_MENU_PAD_LAYOUT_AUTO, UI_MENU_PAD_LAYOUT_NINTENDO, UI_MENU_PAD_LAYOUT_XBOX,
UI_MENU_PAD_LAYOUT_PLAYSTATION};
opt_choice("NX2NAVI_PAD_LAYOUT", UI_MENU_PAD_LAYOUT, layout, 4, UI_MENU_PAD_LAYOUT_DESC, pad_layout_note());
// The setting's values in their cfg.c order (nintendo, xbox, playstation, pc). The game reads its prompts at start:
// the row's note says when a restart would bring others, and the bar's Restart button does it.
// The setting's values in their cfg.c order (nintendo, xbox, playstation, steamdeck, pc). The game reads its prompts
// at start: the row's note says when a restart would bring others, and the bar's Restart button does it.
static const UiTextId prompts[] = {UI_MENU_PROMPTS_NINTENDO, UI_MENU_PROMPTS_XBOX, UI_MENU_PROMPTS_PLAYSTATION,
UI_MENU_PROMPTS_PC};
UI_MENU_PROMPTS_STEAMDECK, UI_MENU_PROMPTS_PC};
bool restart;
opt_choice("NX2NAVI_PROMPTS", UI_MENU_PROMPTS, prompts, 4, UI_MENU_PROMPTS_DESC, prompts_note(&restart));
opt_choice("NX2NAVI_PROMPTS", UI_MENU_PROMPTS, prompts, 5, UI_MENU_PROMPTS_DESC, prompts_note(&restart));
opt_toggle("NX2NAVI_MOTION", UI_MENU_MOTION, UI_MENU_MOTION_DESC);
opt_slider("NX2NAVI_RUMBLE_STRENGTH", UI_MENU_RUMBLE_STRENGTH, 0, 300, UI_MENU_RUMBLE_STRENGTH_DESC, 10, "%.0f %%");
opt_slider("NX2NAVI_RUMBLE_CURVE", UI_MENU_RUMBLE_CURVE, 0.2f, 1.5f, UI_MENU_RUMBLE_CURVE_DESC, 0.05f, "%.2f");

View File

@@ -252,8 +252,9 @@ static const char *const text_en[UI_TEXT_COUNT] = {
[UI_MENU_PAD_LAYOUT_IN_USE] = "in use: %s",
[UI_MENU_PROMPTS] = "Button prompts",
[UI_MENU_PROMPTS_DESC] = "Which buttons the game's prompts show, in text, in the action prompt and on the "
"ocarina's notes. Nintendo: the game's own. Xbox and PlayStation: that pad's buttons (LB, "
"RB, LT, RT, Menu, View; L1, R1, L2, R2, Options, Create), and A, B, X and Y as the "
"ocarina's notes. Nintendo: the game's own. Xbox, PlayStation and Steam Deck: that pad's "
"buttons (LB, RB, LT, RT, Menu, View; L1, R1, L2, R2, Options, Create; the Deck's A, B, X, "
"Y with L1, R1, L2, R2, Menu, View), and A, B, X and Y as the "
"button the layout above presses (with Nintendo (A right) the right button does A, so the "
"prompts for A show B, or circle). Keyboard and mouse: the key each button has (E, Ctrl, "
"Space, left click...), WASD for moving and the mouse for the camera. The prompt files "
@@ -262,7 +263,8 @@ static const char *const text_en[UI_TEXT_COUNT] = {
"are part of the game's files, so a button you remap in Controls keeps its old prompt on "
"screen until the files are made again.",
[UI_MENU_PROMPTS_NINTENDO] = "Nintendo", [UI_MENU_PROMPTS_XBOX] = "Xbox",
[UI_MENU_PROMPTS_PLAYSTATION] = "PlayStation", [UI_MENU_PROMPTS_PC] = "Keyboard and mouse",
[UI_MENU_PROMPTS_PLAYSTATION] = "PlayStation", [UI_MENU_PROMPTS_STEAMDECK] = "Steam Deck",
[UI_MENU_PROMPTS_PC] = "Keyboard and mouse",
[UI_MENU_PROMPTS_MISSING] = "prompt files missing: tools/pad_prompts.py makes them",
[UI_MENU_PROMPTS_FAILED] = "prompt files damaged: make them again with tools/pad_prompts.py",
[UI_MENU_PROMPTS_RESTART] = "prompts change after restart",
@@ -816,7 +818,8 @@ static const char *const text_ru[UI_TEXT_COUNT] = {
"перезапуска. Подсказки записаны в файлах игры, поэтому у кнопки, переназначенной на "
"вкладке управления, на экране остаётся прежняя подсказка, пока файлы не созданы заново.",
[UI_MENU_PROMPTS_NINTENDO] = "Nintendo", [UI_MENU_PROMPTS_XBOX] = "Xbox",
[UI_MENU_PROMPTS_PLAYSTATION] = "PlayStation", [UI_MENU_PROMPTS_PC] = "Клавиатура и мышь",
[UI_MENU_PROMPTS_PLAYSTATION] = "PlayStation", [UI_MENU_PROMPTS_STEAMDECK] = "Steam Deck",
[UI_MENU_PROMPTS_PC] = "Клавиатура и мышь",
[UI_MENU_PROMPTS_MISSING] = "нет файлов подсказок: их создаёт tools/pad_prompts.py",
[UI_MENU_PROMPTS_FAILED] = "файлы подсказок повреждены: создайте их снова tools/pad_prompts.py",
[UI_MENU_PROMPTS_RESTART] = "подсказки сменятся после перезапуска",

View File

@@ -107,7 +107,7 @@ typedef enum {
UI_MENU_PAD_LAYOUT, UI_MENU_PAD_LAYOUT_DESC, UI_MENU_PAD_LAYOUT_AUTO, UI_MENU_PAD_LAYOUT_NINTENDO,
UI_MENU_PAD_LAYOUT_XBOX, UI_MENU_PAD_LAYOUT_PLAYSTATION, UI_MENU_PAD_LAYOUT_IN_USE,
UI_MENU_PROMPTS, UI_MENU_PROMPTS_DESC, UI_MENU_PROMPTS_NINTENDO, UI_MENU_PROMPTS_XBOX, UI_MENU_PROMPTS_PLAYSTATION,
UI_MENU_PROMPTS_PC,
UI_MENU_PROMPTS_STEAMDECK, UI_MENU_PROMPTS_PC,
// the notes under the prompts: their files are missing or damaged, they change after restart, or why they are off
UI_MENU_PROMPTS_MISSING, UI_MENU_PROMPTS_FAILED, UI_MENU_PROMPTS_RESTART, UI_MENU_PROMPTS_OFF_SHAPE,
UI_MENU_PROMPTS_OFF_MODS, UI_MENU_PROMPTS_OFF_PATCHES,