Files
Sylpheed/tools/re-capture/jp_difficulty_session.sh
sylph-decoder 41ad0ff50d tools: a ja capture of DIFFICULTY, to settle whether GP_DIALOG 2/3 are a language pair
The byte comparison showed 2/3 differ in 2.77 % while sharing every element name --
what a language pair looks like -- but that they are ENGLISH and JAPANESE rested on
the disc's convention rather than on this screen. This captures it in ja.

Reuses submenu_focus_sweep.py with SWEEP_TARGETS=0 rather than a new probe, so the
JP capture is taken by the same navigation that produced the English one. The locale
is restored on ANY exit including a crash, and the probe never presses A inside a
submenu, so it cannot reach SELECT DATA and the guest throw.

Committed before running.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Wuu56cE8vJGTBtn1ppsk8v
2026-08-31 04:11:47 +00:00

32 lines
1.5 KiB
Bash
Executable File

#!/usr/bin/env bash
# Capture the DIFFICULTY screen in JAPANESE, and ALWAYS put the locale back.
#
# QUESTION: GP_DIALOG entries 2/3 differ in 2.77 % of bytes while sharing every
# element name, which is what a language pair looks like -- but I have never
# captured DIFFICULTY in `ja`, so "English and Japanese" rested on the disc's
# convention rather than on this screen (dialog-0-1-is-a-duplicate.txt).
#
# ⚠️ SAFE ON THIS PATH AND ONLY THIS ONE. DIFFICULTY's forward path -- Ⓐ on a
# difficulty -> SELECT DATA -> guest throw at PC 0x82307128 -- crashes the game.
# submenu_focus_sweep.py presses Ⓐ to ENTER, one DOWN, then Ⓑ to leave, and never
# presses Ⓐ inside a submenu. Do not add one.
#
# Reuses the sweep with SWEEP_TARGETS=0 rather than a new probe, so the capture is
# taken by the same navigation that produced the English one.
set -u
export HOME=/sylph-home/re SDL_AUDIODRIVER=dummy DISPLAY=:98
SD="$(cd "$(dirname "$0")" && pwd)"
OUT="${OUT:-/sylph-home/re/jpdifficulty}"; mkdir -p "$OUT"
restore() { echo "-- restoring locale --"; python3 "$SD/set_console_language.py" en || true; }
trap restore EXIT INT TERM
python3 "$SD/set_console_language.py" ja || { echo "LOCALE SET FAILED"; exit 2; }
echo "── EFFECTIVE CONFIG ──"
echo " locale = ja (restored on ANY exit, including a crash)"
echo " out = $OUT"
echo " probe = submenu_focus_sweep.py SWEEP_TARGETS=0 (never presses A inside)"
OUT="$OUT" SWEEP="$SD/submenu_focus_sweep.py" SWEEP_TARGETS=0 \
bash "$SD/extras_focus_session.sh"