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
6 changes: 5 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
python tools/unreal_inventory.py --phase minimal
if ($LASTEXITCODE -ne 0) { throw 'Unreal source inventory failed.' }

- name: Test Unreal integration in debug and release
- name: Test Unreal integration and fix behavior in debug and release
env:
BUILD_VERSION: ${{ steps.metadata.outputs.version }}
run: |
Expand All @@ -86,6 +86,10 @@ jobs:
if ($LASTEXITCODE -ne 0) { throw "Unreal $Mode test build failed." }
& xmake run unreal-integration-tests
if ($LASTEXITCODE -ne 0) { throw "Unreal $Mode tests failed." }
& xmake build -y -v fix-behavior-tests
if ($LASTEXITCODE -ne 0) { throw "Fix behavior $Mode test build failed." }
& xmake run fix-behavior-tests
if ($LASTEXITCODE -ne 0) { throw "Fix behavior $Mode tests failed." }
}

- name: Build and package Windows x64 release
Expand Down
10 changes: 7 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ P3RFix is a Windows x64 C++ ASI plugin for Persona 3 Reload.

- `src/dllmain.cpp` handles initialization, configuration, and game hooks; `src/helper.hpp` provides shared utilities.
- `src/unreal/Integration.hpp` exposes the focused Unreal API. Keep memory layouts and runtime internals in `src/unreal/detail/`.
- `src/render/Scaling.*` defines render-target scaling; `src/input/RawMousePacket.*` validates Windows raw-input reads and applies the existing mouse deltas.
- `tests/unreal_integration_tests.cpp` contains synthetic memory tests; `tools/unreal_inventory.py` audits integration sources.
- `tests/fix_behavior_tests.cpp` runs scaling and packet-reader cases from the adjacent test headers.
- `external/` contains pinned dependency submodules. `assets/r2-package/` holds Reloaded-II metadata; `.github/` contains workflows, issue templates, and screenshots.

## Build, Test, and Development Commands
Expand All @@ -15,15 +17,17 @@ Run from the repository root on Windows with Visual Studio 2022 C++ tools, Windo

```powershell
git submodule update --init --recursive
xmake f -y -p windows -a x64 -m debug --fix_version=1.3.0
xmake f -y -p windows -a x64 -m debug --fix_version=1.4.0
xmake build -y P3RFix
xmake build -y unreal-integration-tests
xmake run unreal-integration-tests
xmake build -y fix-behavior-tests
xmake run fix-behavior-tests
python tools/unreal_inventory.py --phase minimal
./create_release.ps1 -Version 1.3.0
./create_release.ps1 -Version 1.4.0
```

These commands initialize dependencies, configure a debug build, build the plugin, build/run tests, audit source boundaries, and package a release. Packaging creates standalone and Reloaded-II ZIPs under `build/`. Load the packaged fix with the game using the installation instructions in `README.md`.
These commands initialize dependencies, configure a debug build, build the plugin, build/run tests, audit source boundaries, and package a release. Packaging creates standalone and Reloaded-II ZIPs under `build/`, validates all thirteen license/notice inputs, and verifies each archive's combined `LICENSES` and binary paths. The maintained source license files remain in the repository. Load the packaged fix with the game using the installation instructions in `README.md`.

## Coding Style & Naming Conventions

Expand Down
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## [1.4.0] - Unreleased

### Fixed

- Base automatic menu render texture scaling on effective viewport height, retaining native quality below 1080p while honoring explicit user multipliers and rejecting invalid or overflowing dimensions.
- Ignore failed, incomplete, and inconsistent raw-input reads before parsing mouse movement; preserve the existing sensitivity and accepted mouse flags.
- Attempt independent fix installation before the optional console discovery wait on the initialization worker, including intro skipping and mouse hooks.

### Maintenance

- Replace the release ZIPs' separate license documents and `licenses/` directory with one complete `LICENSES` file, preserving all maintained notices and existing binary destinations. Overwrite upgrades may retain earlier notice files.
- Run focused scaling and Windows packet-reader tests alongside the Unreal integration checks in debug and release builds.

## [1.3.0] - 2026-10-01

### Maintenance
Expand Down
31 changes: 19 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ Maintained by [dev-camo](https://github.com/dev-camo) and contributors, continui
- Xbox/MS Store: `XboxGames\Persona 3 Reload\Content\P3R\Binaries\WinGDK`
- `P3RFix.asi`, `P3RFix.ini` and `dsound.dll` should be alongside `P3R.exe`.

Both ZIPs include one `LICENSES` document with the project license and complete third-party notices. Overwriting an older installation can leave its previous notice files in place; `LICENSES` contains the complete notices for the new package.

### Steam Deck/Linux Additional Instructions

- Open up the game properties in Steam and add `WINEDLLOVERRIDES="dsound=n,b" %command%` to the launch options.
Expand All @@ -44,6 +46,7 @@ If you previously installed the standalone package, back up your `P3RFix.ini` se
## Configuration

- See **P3RFix.ini** to adjust settings for the fix.
- `[Render Texture Resolution].Multiplier` applies after automatic scaling based on viewport height and screen percentage. Automatic scaling keeps at least the native 1080p target quality; an explicit value below 1 can still reduce it. The combined multiplier is limited to 0.25–4.

## Screenshots

Expand All @@ -67,54 +70,58 @@ Use Windows with Visual Studio 2022's C++ build tools and Windows SDK, CMake, Po
git clone --recurse-submodules https://github.com/dev-camo/P3RFix.git
cd P3RFix
git submodule update --init --recursive
./create_release.ps1 -Version 1.3.0
./create_release.ps1 -Version 1.4.0
```

The script builds Windows x64 release binaries and creates `build/P3RFix_1.3.0.zip` and `build/P3RFix_Reloaded-II.zip`. The version is embedded in the binary and Reloaded-II metadata. Dependencies use the revisions recorded in Git; the standalone package bundles a pinned Ultimate ASI Loader download.
The script builds Windows x64 release binaries and creates `build/P3RFix_1.4.0.zip` and `build/P3RFix_Reloaded-II.zip`. The version is embedded in the binary and Reloaded-II metadata. Dependencies use the revisions recorded in Git; the standalone package bundles a pinned Ultimate ASI Loader download. Packaging combines all thirteen maintained license/notice documents into `LICENSES` and checks both archives for complete matching notices and the expected binary/configuration paths.

The [Build packages workflow](https://github.com/dev-camo/P3RFix/actions/workflows/build.yml) also builds and packages pushes and pull requests to `main`, and supports manual runs. Review its build result and downloadable artifacts before tagging a release.

### Unreal integration maintenance

Console construction and menu render texture access use the focused interface in `src/unreal/Integration.hpp`. Game memory layouts and dispatch constants live privately in `src/unreal/detail/Layouts.hpp`, with their original Dumper-7 symbols recorded beside them. The full generated SDK is no longer a build or checkout dependency. Add only the fields needed for a new feature, with provenance and a boundary test.

Run the synthetic memory tests in Windows x64 debug and release configurations:
Run the synthetic memory and fix behavior tests in Windows x64 debug and release configurations:

```powershell
xmake f -y -p windows -a x64 -m debug --fix_version=1.3.0
xmake f -y -p windows -a x64 -m debug --fix_version=1.4.0
xmake build -y unreal-integration-tests
xmake run unreal-integration-tests
xmake f -y -p windows -a x64 -m release --fix_version=1.3.0
xmake build -y fix-behavior-tests
xmake run fix-behavior-tests
xmake f -y -p windows -a x64 -m release --fix_version=1.4.0
xmake build -y unreal-integration-tests
xmake run unreal-integration-tests
xmake build -y fix-behavior-tests
xmake run fix-behavior-tests
python tools/unreal_inventory.py --phase minimal
```

These tests check layouts, reflected console calls, failure handling, name conversion, and render writes using independent byte fixtures. They do not establish compatibility with a particular game update; compare console operation and menu rendering with the baseline DLL in the actual game. Console lookup assumes the inherited signatures, registry layout, and virtual dispatch entry; render access remains available if console dependencies cannot be discovered.
The integration tests check layouts, reflected console calls, failure handling, name conversion, and render writes using independent byte fixtures. The behavior tests check scaling arithmetic, integer bounds, raw-input read failures, signed mouse deltas, and allocation failure using a controlled Windows reader. They do not establish compatibility with a particular game update; compare console operation, input, and menu rendering with the baseline DLL in the actual game. Console lookup assumes the inherited signatures, registry layout, and virtual dispatch entry; independent hook installation runs before the optional console discovery wait.

## Releasing

Commit the release changes, then push the branch and a version tag pointing at that commit:
Validate the packages and game behavior, then have a human review the branch before merging. After approval, push a new version tag pointing at the exact tested release commit:

```sh
git push origin HEAD
git tag -a 1.3.0 -m "Release 1.3.0"
git push origin 1.3.0
git tag -a 1.4.0 -m "Release 1.4.0"
git push origin 1.4.0
```

Use a new version number for each release. Tags may use `1.3.0` or `v1.3.0`. The [Publish release workflow](https://github.com/dev-camo/P3RFix/actions/workflows/release.yml) checks out the tagged commit and its submodules, builds that version and publishes both ZIP files on the matching [GitHub Release](https://github.com/dev-camo/P3RFix/releases).
Use a new version number for each release. Tags may use `1.4.0` or `v1.4.0`. The [Publish release workflow](https://github.com/dev-camo/P3RFix/actions/workflows/release.yml) checks out the tagged commit and its submodules, builds that version and publishes both ZIP files on the matching [GitHub Release](https://github.com/dev-camo/P3RFix/releases).

To retry a release for an existing tag, open **Publish release → Run workflow** in GitHub Actions and enter the tag in the `tag` field, or use GitHub CLI:

```sh
gh workflow run release.yml -f tag=1.3.0
gh workflow run release.yml -f tag=1.4.0
```

A retry rebuilds the commit referenced by that tag and replaces the release's ZIP attachments. The workflow checks the tag's commit before building and publishing.

## License and Credits

P3RFix is distributed under the [MIT License](LICENSE.md). Original copyrights and third-party attributions are preserved. See [third-party notices](THIRD_PARTY_NOTICES.md) and [license texts](licenses/) for dependency licensing and retained Unreal integration provenance.
P3RFix is distributed under the [MIT License](LICENSE.md). Original copyrights and third-party attributions are preserved. In the source checkout, see [third-party notices](THIRD_PARTY_NOTICES.md) and [license texts](licenses/) for dependency licensing and retained Unreal integration provenance. Release ZIPs ship those complete texts together in one generated `LICENSES` document; individual source notice files remain maintained here.

- Lyall for the original P3RFix implementation.
- [Ultimate ASI Loader](https://github.com/ThirteenAG/Ultimate-ASI-Loader) for ASI loading.
Expand Down
2 changes: 1 addition & 1 deletion THIRD_PARTY_NOTICES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Third-party notices

P3RFix retains its original MIT license and copyright notice in [LICENSE.md](LICENSE.md), with an additional copyright notice for current maintenance. Third-party components retain their own licenses and attribution. Both release packages include this notice and the `licenses/` directory.
P3RFix retains its original MIT license and copyright notice in [LICENSE.md](LICENSE.md), with an additional copyright notice for current maintenance. Third-party components retain their own licenses and attribution. Both release packages carry one combined `LICENSES` document containing the project license, this notice, and the complete component license texts. The linked individual license files remain maintained in the source repository.

## Components compiled into P3RFix.asi

Expand Down
Loading