diff --git a/.agents/skills/n3ds-platform/SKILL.md b/.agents/skills/n3ds-platform/SKILL.md index eb9791ad..cb75304a 100644 --- a/.agents/skills/n3ds-platform/SKILL.md +++ b/.agents/skills/n3ds-platform/SKILL.md @@ -80,7 +80,7 @@ osSetSpeedupEnable(true); // Boost CPU to 804 MHz and enable L2 cache `/msys2/usr/bin/bash.exe -lc "export DEVKITPRO=/opt/devkitpro DEVKITARM=/opt/devkitpro/devkitARM; cd && make -C build/3ds -j10"` (first time: `cmake -S platform/3ds -B build/3ds -G 'Unix Makefiles' -DCMAKE_TOOLCHAIN_FILE=/opt/devkitpro/cmake/3DS.cmake -DCMAKE_BUILD_TYPE=Release`, plus `-DPython3_EXECUTABLE=` if msys2 has none). - Code size is the constraint (docs/3DS_PLATFORM.md 8.5). Never add a define that changes `Runtime`'s layout to only some targets; a define that changes compile flags of `p3p_aot` rebuilds all 237 units (~9 min) — put runtime-only defines on `psprecomp_runtime`. -- Test in Azahar (New 3DS mode) with the ISO in its virtual `sdmc/p3p3ds/`. A run that is killed never writes its final report, so put an empty `sdmc/p3p3ds/report_live.txt` there first (report every 5 s), or quit with START+SELECT. Read `sdmc/p3p3ds/report.txt`: `stage`, heap size/in use, and `failed alloc: from `; resolve the address with `arm-none-eabi-addr2line -f -C -i -e build/3ds/p3p3ds.elf `. The maintainer may be running Azahar too: do not kill an instance you did not start, and do not trust a report without checking its build id and timestamp. Screenshot of the Azahar window: `powershell -NoProfile -ExecutionPolicy Bypass -File .claude/skills/n3ds-platform/scripts/azahar_shot.ps1 -Out .tmp/azahar/shot.png`. A crash photo of the Luma exception screen gives PC and LR: resolve both with addr2line on the ELF of exactly that build (`build ` in the report). +- Test in Azahar (New 3DS mode) with the ISO in its virtual `sdmc/p3p3ds/`. Unattended runs use `sdmc/p3p3ds/autotest/` (`input.txt`, `stop.txt`, `dump_every.txt`, `ms0/`); PC input scripts need other timings there, see `docs/CURRENT_STATE.md`. A run that is killed never writes its final report, so put an empty `sdmc/p3p3ds/report_live.txt` there first (report every 5 s), or quit with START+SELECT. Read `sdmc/p3p3ds/report.txt`: `stage`, heap size/in use, and `failed alloc: from `; resolve the address with `arm-none-eabi-addr2line -f -C -i -e build/3ds/p3p3ds.elf `. The maintainer may be running Azahar too: do not kill an instance you did not start, and do not trust a report without checking its build id and timestamp. Screenshot of the Azahar window: `powershell -NoProfile -ExecutionPolicy Bypass -File .claude/skills/n3ds-platform/scripts/azahar_shot.ps1 -Out .tmp/azahar/shot.png`. A crash photo of the Luma exception screen gives PC and LR: resolve both with addr2line on the ELF of exactly that build (`build ` in the report). - Never write `sdmc` or emulator paths of the maintainer's machine into tracked files. ## 3b. P3P3DS Builder release diff --git a/.claude/skills/n3ds-platform/SKILL.md b/.claude/skills/n3ds-platform/SKILL.md index eb9791ad..cb75304a 100644 --- a/.claude/skills/n3ds-platform/SKILL.md +++ b/.claude/skills/n3ds-platform/SKILL.md @@ -80,7 +80,7 @@ osSetSpeedupEnable(true); // Boost CPU to 804 MHz and enable L2 cache `/msys2/usr/bin/bash.exe -lc "export DEVKITPRO=/opt/devkitpro DEVKITARM=/opt/devkitpro/devkitARM; cd && make -C build/3ds -j10"` (first time: `cmake -S platform/3ds -B build/3ds -G 'Unix Makefiles' -DCMAKE_TOOLCHAIN_FILE=/opt/devkitpro/cmake/3DS.cmake -DCMAKE_BUILD_TYPE=Release`, plus `-DPython3_EXECUTABLE=` if msys2 has none). - Code size is the constraint (docs/3DS_PLATFORM.md 8.5). Never add a define that changes `Runtime`'s layout to only some targets; a define that changes compile flags of `p3p_aot` rebuilds all 237 units (~9 min) — put runtime-only defines on `psprecomp_runtime`. -- Test in Azahar (New 3DS mode) with the ISO in its virtual `sdmc/p3p3ds/`. A run that is killed never writes its final report, so put an empty `sdmc/p3p3ds/report_live.txt` there first (report every 5 s), or quit with START+SELECT. Read `sdmc/p3p3ds/report.txt`: `stage`, heap size/in use, and `failed alloc: from `; resolve the address with `arm-none-eabi-addr2line -f -C -i -e build/3ds/p3p3ds.elf `. The maintainer may be running Azahar too: do not kill an instance you did not start, and do not trust a report without checking its build id and timestamp. Screenshot of the Azahar window: `powershell -NoProfile -ExecutionPolicy Bypass -File .claude/skills/n3ds-platform/scripts/azahar_shot.ps1 -Out .tmp/azahar/shot.png`. A crash photo of the Luma exception screen gives PC and LR: resolve both with addr2line on the ELF of exactly that build (`build ` in the report). +- Test in Azahar (New 3DS mode) with the ISO in its virtual `sdmc/p3p3ds/`. Unattended runs use `sdmc/p3p3ds/autotest/` (`input.txt`, `stop.txt`, `dump_every.txt`, `ms0/`); PC input scripts need other timings there, see `docs/CURRENT_STATE.md`. A run that is killed never writes its final report, so put an empty `sdmc/p3p3ds/report_live.txt` there first (report every 5 s), or quit with START+SELECT. Read `sdmc/p3p3ds/report.txt`: `stage`, heap size/in use, and `failed alloc: from `; resolve the address with `arm-none-eabi-addr2line -f -C -i -e build/3ds/p3p3ds.elf `. The maintainer may be running Azahar too: do not kill an instance you did not start, and do not trust a report without checking its build id and timestamp. Screenshot of the Azahar window: `powershell -NoProfile -ExecutionPolicy Bypass -File .claude/skills/n3ds-platform/scripts/azahar_shot.ps1 -Out .tmp/azahar/shot.png`. A crash photo of the Luma exception screen gives PC and LR: resolve both with addr2line on the ELF of exactly that build (`build ` in the report). - Never write `sdmc` or emulator paths of the maintainer's machine into tracked files. ## 3b. P3P3DS Builder release diff --git a/README.md b/README.md index 412e3415..4d24653c 100644 --- a/README.md +++ b/README.md @@ -382,7 +382,7 @@ build/cpk/bin/p3p-cpk check-trace game.iso .tmp/io-trace.csv ms0:/PSP/P3P=.tmp/m - `list` prints directory and name, offset, stored and extracted size, and whether the file is CRILAYLA-compressed; the optional last argument is a case-insensitive substring of `dir/name`. An archive it can't read fully is an error, which makes it a quick check of a community `mod.cpk`. - `extract` writes files under their CPK directories and decompresses them. All output paths are checked before the first write: `..`, absolute paths and names that are unsafe on Windows stop the extraction. - `diff` shows what a `mod.cpk`, a `bind/` folder or an Aemulus package does to the game's archives: each file is `added`, `changed` or `same`, by extracted content, so a stored copy of a compressed file counts as the same. A file under a folder named after a game file, such as `data/init/a.tmx` for `data/init.bin`, is `in-container`: a mod manager has to build it into that file first. Names match without regard to case, and a match that differs in case is marked `case-differs`. -- `bind` makes a mod usable without Aemulus: it writes a `bind/` folder with the changed files and rebuilds the game's containers around the `in-container` files. A file it can't place, such as one inside an `.spr`, is listed as `unresolved`, and the exit code is 1. +- `bind` makes a mod usable without Aemulus: it writes a `bind/` folder with the changed files and rebuilds the game's containers around the `in-container` files. Copy that folder to `sdmc:/p3p3ds/mods/bind/`; this was tested in Azahar, not yet on a console. A file it can't place, such as one inside an `.spr`, is listed as `unresolved`, and the exit code is 1. - `patch ` applies the VCDIFF patches that mods ship, such as an EBOOT patch, and checks their checksums; `p3p-bindiff --elf` then shows what changed. - `check-trace` verifies `p3p_pc_bootstrap --io-trace`: each read of a `.cpk` must be metadata or lie inside one file with the same FNV-1a 64. diff --git a/docs/CURRENT_STATE.md b/docs/CURRENT_STATE.md index 9f400062..eb356034 100644 --- a/docs/CURRENT_STATE.md +++ b/docs/CURRENT_STATE.md @@ -2,6 +2,13 @@ This is the current source of truth, newest entries first. Evidence concerns ULUS-10512; each section says whether it was measured on the PC runner, in Azahar or on a real New 3DS. +## Mods run on the New 3DS build in Azahar (#23, 2026-11-06) + +- [VERIFIED] Azahar, the New 3DS build with no change: a `bind/` folder from `p3p-cpk bind` (1,552 files, 29 MB, the fan translation used as a test mod) in `sdmc:/p3p3ds/mods/bind/`, unattended run to vblank 9900. The first dialogue shows the mod's text. +- [VERIFIED] No slowdown from the mod files in that window: last 12 seconds at 92-100 % speed, `io` 0-1 %, whole run 94 %, `linear free` 3,253 KiB. Azahar's SD says nothing about a real card. +- [VERIFIED] `profiles/p3p/input/new_game.txt` does not reach NEW GAME on the 3DS build: the title accepts a button only from about vblank 8300 there, so its START at 7900 is lost. Input that worked: `8600 CROSS 6`, `8950 UP 6`, `9050 CROSS 6`. +- [UNVERIFIED] Hardware: `sceIoGetstat` on `bind/` paths cost 83 ms per call on a real card (2026-10-04 entry), and this mod adds 1,552 files. + ## Russian translation runs on the PC runner, without Aemulus (#87, #23, 2026-11-06) - `tools/cpk`: `bind ` writes a `bind/` folder: changed files, and the game's containers (nested ones too) with the mod's files put in. `tools/cpk/src/pak.zig` reads and rebuilds the two PAK layouts of the game. diff --git a/docs/NEXT_STEPS.md b/docs/NEXT_STEPS.md index 63fa0689..eac0d00a 100644 --- a/docs/NEXT_STEPS.md +++ b/docs/NEXT_STEPS.md @@ -44,7 +44,7 @@ Reproduced in unit tests or confirmed in code, not yet seen to change P3P's beha - **Saves**: compatibility with PSP/PPSSPP saves ([#20](https://github.com/endercodezz/P3P3DS/issues/20)). - **Opening movie**: H.264 + ATRAC3plus decoding ([#19](https://github.com/endercodezz/P3P3DS/issues/19), plan below); until then the movie is skipped. - **`.cia` packaging** from the Builder ([#21](https://github.com/endercodezz/P3P3DS/issues/21)). -- **Mods**: fan translations on the 3DS and texture replacement ([#23](https://github.com/endercodezz/P3P3DS/issues/23)); a 60 fps patch only as a separate mod (the game paces itself with `WaitVblankStartMultiCB(2)` and its logic is per frame [INFERRED]). +- **Mods**: mods from `p3p-cpk bind` run in Azahar; still open are a hardware test, `.spr` files, EBOOT patches in the Builder and texture replacement ([#23](https://github.com/endercodezz/P3P3DS/issues/23)); a 60 fps patch only as a separate mod (the game paces itself with `WaitVblankStartMultiCB(2)` and its logic is per frame [INFERRED]). - Builder: detection of devkitPro installs in other places ([#22](https://github.com/endercodezz/P3P3DS/issues/22)). ## Planned, but not soon: Old 3DS / 2DS — [#24](https://github.com/endercodezz/P3P3DS/issues/24)