Files
PS5_RetroArch/parked/config-path.patch.py
Mihawk 8969e2eb38 Write and register the console's pad input driver, and name the two faults blocking it
src/input_ps5.cpp is a complete input_driver_t for this console: the DualSense is
read with scePadInit/scePadOpen/scePadRead and the 120-byte sample layout
../ProsperoLight verified on hardware, the pad's button words are mapped onto
RetroArch's numbering (CIRCLE is RetroArch's A, so CIRCLE confirms a menu entry),
sticks and triggers are reported as axes, and the table is registered in
input_drivers[] before input_null. tests/test_frontend.py pins the registration
from the frontend object's relocations and the button pairing by reading the map
out of the object the title links.

Two faults were found in front of it, both upstream of the driver.

RetroArch's built-in test input driver is on by default (HAVE_TEST_DRIVERS=yes in
qb/config.params.sh), and while it is on video_driver_init_input returns before
initialising any real input driver whenever the configured driver is not "test".
No input driver was ever initialised, so current_data stayed NULL and every button
read answered 0. --disable-test_drivers is now in tools/retroarch-sources.sh.

The title's -c never reached RetroArch. Content loading rebuilds argv from the
frontend's environment and kept only ["retroarch", "--menu"], so the config file
was never read at all - measured as
  probe config_parse_file: path="(null)"
  probe config_load: after parse input="null" video="ext"
This title has therefore been running on compiled defaults since it first built,
with --verbose dropped as well. A guarded one-line fix restores the title's own
config path.

That fix is parked rather than committed into patches/series: with the config
actually read, the title dies on launch with SIGSEGV, rip=0 - a call through a
null function pointer - both with input_driver="ps5" and with "null", and before
ps5_input_init is entered. Markers through drivers_init and
video_driver_init_internal show the entire video path completing, so the fault is
after driver initialisation. The change and its reasoning are in
parked/config-path.patch.py, and config/retroarch.cfg keeps input_driver="null" so
the title keeps running and showing its menu.

The pad does not work yet and the picture is still one menu frame. What is solid:
the driver exists, is registered, is unit-tested, and the two faults that were
silently blocking every input path are named with their measurements.

gates: bash tools/verify.sh -> PASS (format unit build integration evidence),
13 host tests. reproduce: bash tools/run-title.sh --watch 12.
2026-09-18 18:45:13 -04:00

41 lines
2.3 KiB
Python

(
# The title's own command line, kept.
#
# This is the fault that hid every other one: the port passed its entry
# point `-f -c /app0/retroarch.cfg --verbose --menu`, and RetroArch threw
# all of it away. Content loading rebuilds a fresh argv from the
# frontend's environment (`content_load_init_wrap`), and the frontend's
# own environment offers no `-c`, so the pair rebuilt here was
# `retroarch --menu`. With no config path, `config_load` parsed a NULL path
# and the whole title ran on compiled defaults: `input_driver` was "null"
# instead of the "ps5" the config names, so the input driver this project
# had just written was never initialised and the pad did nothing; and
# `--verbose` was dropped too, so nothing said so. The display worked
# because the video driver's *default* happened to be ps5 already.
#
# The line below restores the config path when the frontend environment
# does not name one. It is the title's own path, and the title has exactly
# one: /app0 is where the console mounts the application image, so there is
# nothing to make configurable here.
"tasks/task_content.c",
# The anchor is the last statement of the function, not its closing
# brace: upstream leaves a blank line before the brace, so an anchor that
# spans it does not match.
" if (args->flags & RARCH_MAIN_WRAP_FLAG_VERBOSE)\n"
" argv[(*argc)++] = strldup(\"-v\", sizeof(\"-v\"));\n",
" if (args->flags & RARCH_MAIN_WRAP_FLAG_VERBOSE)\n"
" argv[(*argc)++] = strldup(\"-v\", sizeof(\"-v\"));\n"
"\n"
" /* Added by this port (patches/series, 0006): the frontend's own\n"
" * environment rebuilds this argv from scratch and does not carry the\n"
" * title's `-c`, which left RetroArch parsing a NULL config path and\n"
" * running every setting at its compiled default. The title has one\n"
" * config file and one place to keep it. */\n"
" if (!args->config_path)\n"
" {\n"
" argv[(*argc)++] = strldup(\"-c\", sizeof(\"-c\"));\n"
" argv[(*argc)++] = strdup(\"/app0/retroarch.cfg\");\n"
" }\n",
"the title has exactly",
),