Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -354,9 +354,19 @@ add_executable(test_ge_renderer tests/test_ge_renderer.cpp)
target_link_libraries(test_ge_renderer PRIVATE p3p3ds_core)
add_test(NAME p3p_ge_renderer COMMAND test_ge_renderer)
# Builder (ISO -> .3dsx) pieces that run on the host and are unit-tested here.
add_library(p3p3ds_builder_core STATIC platform/pc/builder/psp_eboot.cpp platform/pc/builder/game_prep.cpp)
add_library(p3p3ds_builder_core STATIC platform/pc/builder/psp_eboot.cpp platform/pc/builder/game_prep.cpp
platform/pc/builder/update_check.cpp)
target_include_directories(p3p3ds_builder_core PUBLIC platform/pc/builder)
target_link_libraries(p3p3ds_builder_core PUBLIC p3p3ds_core)
# The Builder's version lives in one place, builder.rc (release.yml checks
# release tags against it); the update check (#67) reads it from there.
file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/platform/pc/builder/builder.rc" _builder_version_line REGEX "VALUE \"FileVersion\"")
string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" P3P3DS_BUILDER_VERSION "${_builder_version_line}")
if(NOT P3P3DS_BUILDER_VERSION)
message(FATAL_ERROR "no FileVersion in platform/pc/builder/builder.rc")
endif()
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/platform/pc/builder/builder.rc")
target_compile_definitions(p3p3ds_builder_core PRIVATE P3P3DS_BUILDER_VERSION="${P3P3DS_BUILDER_VERSION}")
# ISO -> eboot.elf for the developer setup (tools/prepare_game.py delegates to it).
# Built without game files, so a fresh checkout can prepare the ELF first.
add_executable(p3p_prepare_elf platform/pc/builder/prepare_elf_main.cpp)
Expand All @@ -367,7 +377,7 @@ endif()
if(WIN32)
enable_language(RC)
add_executable(p3p3ds_builder WIN32 platform/pc/builder/builder_main.cpp platform/pc/builder/pipeline.cpp platform/pc/builder/builder.rc)
target_link_libraries(p3p3ds_builder PRIVATE p3p3ds_builder_core p3p3ds_core comctl32 comdlg32 shell32 ole32)
target_link_libraries(p3p3ds_builder PRIVATE p3p3ds_builder_core p3p3ds_core comctl32 comdlg32 shell32 ole32 winhttp)
target_compile_definitions(p3p3ds_builder PRIVATE UNICODE _UNICODE)
if(MINGW)
target_link_options(p3p3ds_builder PRIVATE -municode -static)
Expand All @@ -380,6 +390,9 @@ endif()
set_target_properties(p3p3ds_builder PROPERTIES OUTPUT_NAME "P3P3DS-Builder")
configure_file(profiles/p3p/config/aot_layout.hpp.in generated/aot_layout.hpp @ONLY)
target_include_directories(p3p3ds_builder PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/generated")
add_executable(test_update_check tests/test_update_check.cpp)
target_link_libraries(test_update_check PRIVATE p3p3ds_builder_core)
add_test(NAME p3p_update_check COMMAND test_update_check "${P3P3DS_BUILDER_VERSION}")
add_executable(test_psp_eboot tests/test_psp_eboot.cpp)
target_link_libraries(test_psp_eboot PRIVATE p3p3ds_builder_core p3p3ds_core)
file(GLOB P3P_LOCAL_ISOS "${CMAKE_CURRENT_SOURCE_DIR}/*.iso")
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ You need:
3. Wait about 5-15 minutes: the game's code is translated to C++ and compiled for the 3DS on all CPU cores, with a progress bar, a time estimate and Persona 3 trivia. An interrupted build continues where it stopped.
4. The builder can copy everything to your SD card itself; otherwise copy as shown below.

When a newer Builder is released, the window shows **Update: Builder X.Y.Z is available** in its bottom left corner; the button opens the release page. The Windows wizard only asks GitHub for the latest release tag when it starts (nothing is downloaded or installed, no identifiers are sent); `--no-update-check` or the environment variable `P3P3DS_NO_UPDATE_CHECK=1` turns that off, and `--cli` builds never check. `P3P3DS-Builder.exe --check-update` prints the result in a console, `--version` shows the version.

On Linux the builder is a console program (`P3P3DS-Builder-<version>-linux.tar.gz`): `./P3P3DS-Builder --iso <iso> [--devkitpro <dir>] [--out <file>] [--jobs <n>]`; devkitPro is looked up in `$DEVKITPRO`, then `/opt/devkitpro`. On NixOS run it inside `p3p-3ds` from `shell.nix`, where devkitPro's prebuilt binaries work.

The builder package (about 2 MB zipped) contains no game data: only the prebuilt P3P3DS runtime for the 3DS, the code generator and the community CWCheat patch list; everything made from the game is generated on your PC. Measured clean builds on a 12-thread CPU: 4 min 23 s with 12 compiler jobs, 4 min 55 s with 7 (the builder picks the number from CPU cores and free memory).
Expand Down
10 changes: 10 additions & 0 deletions docs/CURRENT_STATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

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.

## Builder 0.3.3 release preparation (2026-11-05)

- `platform/pc/builder/builder.rc` FileVersion and ProductVersion 0.3.3 ([#69](https://github.com/endercodezz/P3P3DS/issues/69)). Contents since 0.3.2: Builder update notice (#67), texture packs (texpack converter, PPSSPP-compatible keys, replacement on the PC and in the 3DS renderer), native game preparation (#33), host time audit docs (#50), Zig BinDiff tool.
- [UNVERIFIED] Texture replacement on the New 3DS (Azahar or hardware): merged on the maintainer's decision without that check.

## Builder shows when a newer release exists (#67, 2026-11-05)

- `platform/pc/builder/update_check.cpp` (version parsing, top-level `tag_name` of a GitHub releases/latest response, comparison; no network code) and the wizard (`builder_main.cpp`): on start a detached thread GETs `https://api.github.com/repos/endercodezz/P3P3DS/releases/latest` with WinHTTP (5 s timeouts, `User-Agent: P3P3DS-Builder/<version>`), and a newer tag shows a bottom-left button that opens `https://github.com/endercodezz/P3P3DS/releases/tag/<tag>`. The page URL is built from the validated tag, never taken from the response. Off with `--no-update-check` or `P3P3DS_NO_UPDATE_CHECK`; `--cli` never checks; `--check-update` prints the result; `P3P3DS_UPDATE_URL` overrides the URL for tests. The version comes from `builder.rc` FileVersion through CMake, so a release still bumps one place.
- [VERIFIED] Windows: real API: "latest release: v0.3.2; no update" in about 1 s. Local test server returning `v9.9.9` (with a foreign `html_url` and a nested `tag_name`): banner "Update: Builder 9.9.9 is available" (window capture `.tmp/upd/banner.png`), page built from the tag. Unreachable server: no banner, `--check-update` returns after about 2 s. Server log: 0 requests from `--cli`, `--no-update-check` and `P3P3DS_NO_UPDATE_CHECK=1`. Imports: system DLLs and UCRT only, plus `WINHTTP.dll`. `test_update_check` and CTest 32/32. [UNVERIFIED] Linux console Builder: only `--version`, no check.

## Texture pack format: Rust writer and C++ reader tested together (#63, 2026-11-05)

- CTest `p3p_texpack_build_rgba8` / `p3p_texpack_build_auto` run `p3p-texpack build` on `tools/texpack/tests/fixtures` (`textures.ini` there), `p3p_texpack_roundtrip` (`tests/test_texture_pack_roundtrip.cpp`) reads both packs with the runtime's `TexturePack` and compares every texel with the fixture formulas after the format's rules (header, entry order, alignment, row order, tiling, format codes, channel packing, keep-original entry). Registered only when CMake finds `cargo` (Linux CI and local builds; not the MSYS2 Windows job).
Expand Down
3 changes: 2 additions & 1 deletion docs/NEXT_STEPS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@

Updated 2026-11-05. What is done and measured lives in [`CURRENT_STATE.md`](CURRENT_STATE.md); this file only lists what comes next, in the maintainer's priority order. Every step names how it will be verified (CLAUDE.md section 3: measure first). Each step is tracked as a [GitHub issue](https://github.com/endercodezz/P3P3DS/issues) and lands through a pull request that closes it (CLAUDE.md section 16).

## Where the project stands (0.3.2)
## Where the project stands (0.3.3)

- Whole `.text` statically recompiled, HLE kernel, VFS with the mod chain, GE executor, deterministic PC runner with scripted input; the PC route plays through the first battle (maintainer's save, local route).
- New 3DS (0.3.0/0.3.1, New 2DS XL): PICA200 renderer with a vertex shader (transform, skinning, lighting), GE back end on core 2, real-time pacing, save/load menu on the bottom screen. Dorm 28-30 fps, dialogue mostly 30, battle 16-25 fps; a user's 0.3.1 run at 97-99 % speed; no sound, no opening movie.
- 0.3.2 includes the startup logo fix (4d198db, verified in Azahar and reported working by the maintainer on console in [#5](https://github.com/endercodezz/P3P3DS/issues/5)).
- 0.3.3: texture packs made for PPSSPP convert with `tools/texpack` and replace textures on the PC ([#62](https://github.com/endercodezz/P3P3DS/pull/62)); the New 3DS path (`sdmc:/p3p3ds/textures`) is in the build but not yet tested on Azahar or hardware ([#23](https://github.com/endercodezz/P3P3DS/issues/23)). The Builder shows when a newer release exists ([#67](https://github.com/endercodezz/P3P3DS/issues/67)).
- P3P3DS Builder for Windows and Linux; releases built by GitHub Actions.

## 0. Check fades and transitions on hardware
Expand Down
8 changes: 4 additions & 4 deletions platform/pc/builder/builder.rc
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
1 RT_MANIFEST "builder.manifest"

VS_VERSION_INFO VERSIONINFO
FILEVERSION 0,3,2,0
PRODUCTVERSION 0,3,2,0
FILEVERSION 0,3,3,0
PRODUCTVERSION 0,3,3,0
FILEOS VOS_NT_WINDOWS32
FILETYPE VFT_APP
BEGIN
Expand All @@ -16,10 +16,10 @@ BEGIN
BEGIN
VALUE "CompanyName", "enderlit aka endercodezz"
VALUE "FileDescription", "P3P3DS Builder - Persona 3 Portable for New 3DS"
VALUE "FileVersion", "0.3.2"
VALUE "FileVersion", "0.3.3"
VALUE "LegalCopyright", "MIT License. Persona 3 Portable (c) ATLUS."
VALUE "ProductName", "P3P3DS Builder"
VALUE "ProductVersion", "0.3.2"
VALUE "ProductVersion", "0.3.3"
END
END
BLOCK "VarFileInfo"
Expand Down
Loading