mirror of
https://github.com/TheBozos/TMB_Recomp.git
synced 2026-11-30 18:23:18 -10:00
Compare commits
283
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c00c238331 | ||
|
|
14027a5026 | ||
|
|
2e37b81b0d | ||
|
|
13a63bcafd | ||
|
|
3f6623f47e | ||
|
|
f0806c5ef0 | ||
|
|
6db6a16b0d | ||
|
|
7ccc02b050 | ||
|
|
8d808aaf2a | ||
|
|
06d323c49d | ||
|
|
80ba27ab07 | ||
|
|
254f994459 | ||
|
|
f620ab163b | ||
|
|
ce069120c1 | ||
|
|
b84fefaf95 | ||
|
|
159d4a5de3 | ||
|
|
979544ce35 | ||
|
|
7f3a59ce5b | ||
|
|
d1e53a845c | ||
|
|
8dbb7b0c23 | ||
|
|
09e8c8b45f | ||
|
|
6e27203fcc | ||
|
|
894a16a651 | ||
|
|
9cea4513b1 | ||
|
|
38ff9f8ea3 | ||
|
|
d003ced242 | ||
|
|
6043791a00 | ||
|
|
dbb8c73b23 | ||
|
|
de1f627801 | ||
|
|
ad371920d7 | ||
|
|
5531425daf | ||
|
|
56e2f2e932 | ||
|
|
3b05396300 | ||
|
|
2a7eff7a3a | ||
|
|
de7bfb32aa | ||
|
|
89d530697c | ||
|
|
28159632e2 | ||
|
|
c821465d6a | ||
|
|
a0d9386896 | ||
|
|
0aedf924ed | ||
|
|
e1797b1315 | ||
|
|
ccd52e8401 | ||
|
|
ae2ac42953 | ||
|
|
153336ae0c | ||
|
|
b1aa812ed7 | ||
|
|
cd5262a7a0 | ||
|
|
4eddae4fa3 | ||
|
|
fb17656603 | ||
|
|
a67b0cd9fe | ||
|
|
a58a702260 | ||
|
|
8d971a3f3d | ||
|
|
280f1855d5 | ||
|
|
60c90259bb | ||
|
|
de7941263b | ||
|
|
e05ff6b93e | ||
|
|
50e7052a6e | ||
|
|
7439f7778e | ||
|
|
a9b68c9e17 | ||
|
|
388ced5206 | ||
|
|
ab52b55073 | ||
|
|
c1a35042b2 | ||
|
|
bd387fcd8e | ||
|
|
27dda815d7 | ||
|
|
65db7e4c89 | ||
|
|
99e51f0983 | ||
|
|
e25bafb110 | ||
|
|
2e8b9929fe | ||
|
|
b5375c9b1e | ||
|
|
bc4c16996a | ||
|
|
9a10e59096 | ||
|
|
d1c9116ddf | ||
|
|
777f9647d5 | ||
|
|
80450ea784 | ||
|
|
404738f590 | ||
|
|
857bc004e1 | ||
|
|
0239a547df | ||
|
|
672e7ed1b2 | ||
|
|
b8b63c1ef0 | ||
|
|
391206dda1 | ||
|
|
363eb61acd | ||
|
|
eb2ee14258 | ||
|
|
c6d7787140 | ||
|
|
9f80bfe6ab | ||
|
|
0fb62aa91f | ||
|
|
f2eb2f9686 | ||
|
|
24ef197926 | ||
|
|
0413fe523c | ||
|
|
eec7c3c30a | ||
|
|
06764432cd | ||
|
|
11f46a2669 | ||
|
|
8cd62cd4b9 | ||
|
|
242498bee9 | ||
|
|
3c65abe6a0 | ||
|
|
14ea3480ec | ||
|
|
fa84a39b98 | ||
|
|
c5a225198e | ||
|
|
366c6b2408 | ||
|
|
b852b3ed7e | ||
|
|
eefb1518e5 | ||
|
|
cb229340da | ||
|
|
4847649ef6 | ||
|
|
34c7363870 | ||
|
|
2d3c0f4413 | ||
|
|
a8ee999ecb | ||
|
|
e1cf66974f | ||
|
|
924b277776 | ||
|
|
c4a4fac1f7 | ||
|
|
5aae7226db | ||
|
|
8f0fdf3870 | ||
|
|
162f3e9926 | ||
|
|
75e7827be6 | ||
|
|
6903c90e5d | ||
|
|
1f22318dc4 | ||
|
|
2d955238b9 | ||
|
|
c265cfda01 | ||
|
|
4252d9835d | ||
|
|
71e5997e9f | ||
|
|
f9fa811743 | ||
|
|
2b4f79be08 | ||
|
|
d3fc24e4a0 | ||
|
|
7627a523dc | ||
|
|
607cb2d080 | ||
|
|
027357a694 | ||
|
|
b08b9c45b4 | ||
|
|
e298f208bd | ||
|
|
b71f6c3178 | ||
|
|
ba9f83ea76 | ||
|
|
45ed78cc2a | ||
|
|
17bc13a536 | ||
|
|
d9a54c7a27 | ||
|
|
bb685156ff | ||
|
|
cacb8b9c16 | ||
|
|
7b715046f5 | ||
|
|
ebea3f6454 | ||
|
|
7e19e2bbf1 | ||
|
|
b3a9b77819 | ||
|
|
9daca2b6f4 | ||
|
|
315b91cb9a | ||
|
|
9057db28e9 | ||
|
|
ca4a8058cd | ||
|
|
e7893ce259 | ||
|
|
aadc76bd52 | ||
|
|
448755193b | ||
|
|
5135b43c84 | ||
|
|
ce16d68b70 | ||
|
|
3e3740ff7c | ||
|
|
1cf43a4f91 | ||
|
|
4d863cdaad | ||
|
|
eb383881aa | ||
|
|
145964b12a | ||
|
|
1b09c45aaf | ||
|
|
cafd3f7124 | ||
|
|
65c46972ab | ||
|
|
2ee3dc9f62 | ||
|
|
a779181569 | ||
|
|
555f9b33d1 | ||
|
|
44a65a52c3 | ||
|
|
2d25eb2323 | ||
|
|
5c48a618c5 | ||
|
|
94ad67d0b7 | ||
|
|
96015971c0 | ||
|
|
79acf148a0 | ||
|
|
eff76e3be9 | ||
|
|
9298010a7c | ||
|
|
498f93894b | ||
|
|
99efa7f95c | ||
|
|
b7a26374d2 | ||
|
|
bd12a90f79 | ||
|
|
e3d7dda618 | ||
|
|
c7c798e585 | ||
|
|
7107924b1b | ||
|
|
a36c634449 | ||
|
|
9bcc54240b | ||
|
|
a2905f2bfc | ||
|
|
ec9feba867 | ||
|
|
c5888d2629 | ||
|
|
783b4fb417 | ||
|
|
1067036f29 | ||
|
|
d014351e10 | ||
|
|
00b7414b75 | ||
|
|
e818cae146 | ||
|
|
81d72db999 | ||
|
|
256aef3f26 | ||
|
|
0bf979a90e | ||
|
|
87bd01df70 | ||
|
|
f1118f479c | ||
|
|
ad5169b914 | ||
|
|
0d51802ca2 | ||
|
|
0de15ebac0 | ||
|
|
dc687d6dbd | ||
|
|
017908b7b1 | ||
|
|
907f8e1f43 | ||
|
|
9156063b6d | ||
|
|
2fbfea6742 | ||
|
|
199d9a6753 | ||
|
|
8282d51d4e | ||
|
|
571020ea64 | ||
|
|
8456027b2e | ||
|
|
c4afff2dc6 | ||
|
|
ddb161136f | ||
|
|
279e3a12e8 | ||
|
|
6a190b0276 | ||
|
|
e7cdaff01a | ||
|
|
0f70ad94a6 | ||
|
|
c0d2fc7549 | ||
|
|
9daed27724 | ||
|
|
a29c09f8c5 | ||
|
|
20703fceee | ||
|
|
b3d03f6f99 | ||
|
|
df60a500cc | ||
|
|
9a8e69827a | ||
|
|
57414f68ae | ||
|
|
4b36de291c | ||
|
|
807de7adfa | ||
|
|
90c9e219ee | ||
|
|
d91b938e7c | ||
|
|
75b6b3597a | ||
|
|
581690018b | ||
|
|
4a65a8bcf7 | ||
|
|
889b086d47 | ||
|
|
582099259a | ||
|
|
e5158e488a | ||
|
|
f946958da6 | ||
|
|
311ca059d0 | ||
|
|
6341d9bdf9 | ||
|
|
26f5275333 | ||
|
|
3fd4257f6a | ||
|
|
f556f00a4e | ||
|
|
165c6f2bfe | ||
|
|
ce7df104ff | ||
|
|
a415f4279d | ||
|
|
53afc88139 | ||
|
|
39b55f619b | ||
|
|
9d7372f116 | ||
|
|
a5b11695fa | ||
|
|
31f54d1a23 | ||
|
|
21c7daa6e2 | ||
|
|
ce7eb9f60a | ||
|
|
ee920b0c53 | ||
|
|
92a7cfbc8f | ||
|
|
74fe9e545d | ||
|
|
74fd638c09 | ||
|
|
659ef01e02 | ||
|
|
5b5cd5785d | ||
|
|
0ec0919cd3 | ||
|
|
fac4832771 | ||
|
|
16a2fcb5bc | ||
|
|
382e1bbb18 | ||
|
|
839c5093f8 | ||
|
|
c736d9ceec | ||
|
|
478a6b6560 | ||
|
|
0215b07d60 | ||
|
|
0f43f931ba | ||
|
|
59be1873d8 | ||
|
|
eea175219b | ||
|
|
a2df8d5bf3 | ||
|
|
faa3473262 | ||
|
|
d9504a3bbc | ||
|
|
80d028269a | ||
|
|
c92c4cf3a2 | ||
|
|
c2a6d301af | ||
|
|
fe0f21a281 | ||
|
|
b9c42cb332 | ||
|
|
4e43adcc40 | ||
|
|
75c24362f5 | ||
|
|
e65ac1ed3b | ||
|
|
6e1d224cc5 | ||
|
|
f04a154be1 | ||
|
|
03b6a2fd5f | ||
|
|
9a6d4a35ab | ||
|
|
816a03de06 | ||
|
|
3845b42d07 | ||
|
|
79f0f7636b | ||
|
|
2b020b531d | ||
|
|
d7966c41f3 | ||
|
|
6edb484721 | ||
|
|
829e39605b | ||
|
|
5c27e14a9c | ||
|
|
a5c96286b9 | ||
|
|
c1da396ef4 | ||
|
|
03b04bf734 | ||
|
|
68409d1283 | ||
|
|
7f508eb520 |
No files matched your search
@@ -0,0 +1,49 @@
|
||||
name: CI
|
||||
on: [push, pull_request, workflow_dispatch]
|
||||
permissions:
|
||||
contents: read
|
||||
jobs:
|
||||
release-tools:
|
||||
strategy:
|
||||
matrix:
|
||||
os: [windows-latest, ubuntu-latest]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.14'
|
||||
- name: The BozoEngine release cmake/bozo_engine.json pins (the RecompLauncher settings check reads it)
|
||||
run: cmake -P cmake/bozo_engine_fetch.cmake
|
||||
- name: Release, migration and timing checks
|
||||
run: python -m unittest discover -s tests -v
|
||||
- name: Python syntax
|
||||
run: python -m compileall -q tools
|
||||
- name: Shell syntax
|
||||
shell: bash
|
||||
run: for file in scripts/*.sh; do bash -n "$file" || exit; done
|
||||
native-shader:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [windows-latest, ubuntu-latest]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: msys2/setup-msys2@v2
|
||||
if: runner.os == 'Windows'
|
||||
with:
|
||||
msystem: UCRT64
|
||||
update: false
|
||||
install: mingw-w64-ucrt-x86_64-gcc
|
||||
- name: Shader comparisons without game data (Windows)
|
||||
if: runner.os == 'Windows'
|
||||
shell: msys2 {0}
|
||||
run: |
|
||||
g++ -std=c++20 -O2 -mavx2 -mfma -Iruntime tests/native_shader_tests.cpp -o shader-tests.exe
|
||||
./shader-tests.exe
|
||||
- name: Shader comparisons without game data (Linux)
|
||||
if: runner.os == 'Linux'
|
||||
run: |
|
||||
g++ -std=c++20 -O2 -mavx2 -mfma -Iruntime tests/native_shader_tests.cpp -o shader-tests
|
||||
./shader-tests
|
||||
@@ -1,11 +1,17 @@
|
||||
# The release: built only when the owner asks for one, never on an ordinary push or a pull request.
|
||||
# The release of the BozoEngine build: built only when the owner asks for one, never on an ordinary push or a pull
|
||||
# request.
|
||||
#
|
||||
# git tag v0.1.0 && git push origin v0.1.0 (or Actions > Release > Run workflow, with the tag)
|
||||
#
|
||||
# On a version tag it makes the build kit from the pinned MSYS2 packages (tools/build_kit_packages.json), the release
|
||||
# zip, its SHA-256 and the sources zip with tools/make_release.py, checks them without any game data, and creates a
|
||||
# DRAFT GitHub release with CHANGELOG.md's section for the version as its body. Nothing is ever published by this
|
||||
# workflow: the owner runs docs/RELEASE_CHECKLIST.md on a clean PC, then publishes the draft by hand.
|
||||
# zips TMB_Recomp-<version>-bozo.zip (folder TMB_Recomp_Bozo) and TMB_Recomp-<version>.zip (folder TMB_Recomp for
|
||||
# the previous updater). Both carry BozoEngine. It adds hashes and corresponding sources, checks without game data, and creates a DRAFT
|
||||
# GitHub release with CHANGELOG.md's section for the version as its body. Nothing is ever published by this workflow:
|
||||
# the owner runs docs/RELEASE_CHECKLIST.md on a clean PC, then publishes the draft by hand.
|
||||
#
|
||||
# Run by hand without a tag (Actions > Release > Run workflow on a branch, or gh workflow run release.yml --ref
|
||||
# <branch>): a test build of that branch (version 0.0.0-test.<run number> unless given), the same kit, zip and checks,
|
||||
# no sources zip and no draft release; the zips are the run's artifacts.
|
||||
#
|
||||
# Every step is a thin call into tools/make_build_kit.py or tools/make_release.py, so the same commands run on a
|
||||
# developer's PC (README, "Making a release").
|
||||
@@ -20,8 +26,14 @@ on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
tag:
|
||||
description: 'The version tag to release (already pushed), e.g. v0.1.0'
|
||||
required: true
|
||||
description: 'The version tag to release (already pushed), e.g. v0.1.0; empty: a test build of the branch'
|
||||
required: false
|
||||
default: ''
|
||||
type: string
|
||||
version:
|
||||
description: 'A test build only: its version (default 0.0.0-test.<run number>)'
|
||||
required: false
|
||||
default: ''
|
||||
type: string
|
||||
release:
|
||||
types: [published]
|
||||
@@ -41,34 +53,49 @@ jobs:
|
||||
permissions:
|
||||
contents: write # the draft release and its files
|
||||
env:
|
||||
TAG: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref_name }}
|
||||
TAG: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || (github.event_name == 'push' && github.ref_name || '') }}
|
||||
TEST_VERSION: ${{ inputs.version }}
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
steps:
|
||||
- name: Version from the tag
|
||||
- name: Version from the tag (or a test build's)
|
||||
run: |
|
||||
set -eu
|
||||
if ! printf '%s' "$TAG" | grep -Eq '^v[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?$'; then
|
||||
echo "::error::$TAG is not a version tag (vMAJOR.MINOR.PATCH or vMAJOR.MINOR.PATCH-pre)"
|
||||
exit 1
|
||||
if [ -n "$TAG" ]; then
|
||||
if ! printf '%s' "$TAG" | grep -Eq '^v[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?$'; then
|
||||
echo "::error::$TAG is not a version tag (vMAJOR.MINOR.PATCH or vMAJOR.MINOR.PATCH-pre)"
|
||||
exit 1
|
||||
fi
|
||||
echo "VERSION=${TAG#v}" >> "$GITHUB_ENV"
|
||||
echo "TEST_BUILD=" >> "$GITHUB_ENV"
|
||||
else
|
||||
v="${TEST_VERSION:-0.0.0-test.$GITHUB_RUN_NUMBER}"
|
||||
if ! printf '%s' "$v" | grep -Eq '^[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?$'; then
|
||||
echo "::error::$v is not a version (MAJOR.MINOR.PATCH or MAJOR.MINOR.PATCH-pre)"
|
||||
exit 1
|
||||
fi
|
||||
echo "VERSION=$v" >> "$GITHUB_ENV"
|
||||
echo "TEST_BUILD=1" >> "$GITHUB_ENV"
|
||||
fi
|
||||
echo "VERSION=${TAG#v}" >> "$GITHUB_ENV"
|
||||
echo "WORK=$(cygpath -m "$RUNNER_TEMP")/tmb" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Check out the tag (and the PS2Recomp submodule at its recorded commit)
|
||||
- name: Check out the tag or the branch
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: refs/tags/${{ env.TAG }}
|
||||
submodules: true
|
||||
ref: ${{ env.TAG != '' && format('refs/tags/{0}', env.TAG) || '' }}
|
||||
persist-credentials: false
|
||||
|
||||
- name: The BozoEngine release cmake/bozo_engine.json pins (SHA-256 checked; the kit reads its library pins)
|
||||
run: cmake -P cmake/bozo_engine_fetch.cmake
|
||||
|
||||
- name: Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.14'
|
||||
|
||||
- name: The changelog has this version
|
||||
if: env.TEST_BUILD == ''
|
||||
run: python tools/make_release.py --check-changelog --version "$VERSION"
|
||||
|
||||
- name: MSYS2 (pacman, and sh for FFmpeg's configure; the toolchain itself comes from the pins)
|
||||
@@ -79,12 +106,12 @@ jobs:
|
||||
update: false
|
||||
install: diffutils
|
||||
|
||||
- name: Cache the downloads (pinned MSYS2 packages, FFmpeg, Python, MSYS2 sources, the font)
|
||||
- name: Cache the downloads (pinned MSYS2 packages, FFmpeg, Python, SDL3, ImGui, MSYS2 sources, the font)
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ${{ runner.temp }}/tmb/downloads
|
||||
key: tmb-downloads-${{ hashFiles('tools/build_kit_packages.json', 'tools/make_build_kit.py') }}
|
||||
restore-keys: tmb-downloads-
|
||||
key: tmb-bozo-downloads-${{ hashFiles('tools/build_kit_packages.json', 'tools/make_build_kit.py') }}
|
||||
restore-keys: tmb-bozo-downloads-
|
||||
|
||||
- name: Cache the kit's FFmpeg (by the pins and make_build_kit.py)
|
||||
id: ffmpeg
|
||||
@@ -95,44 +122,51 @@ jobs:
|
||||
${{ runner.temp }}/tmb/kit/sources
|
||||
${{ runner.temp }}/tmb/kit/licenses/ffmpeg
|
||||
${{ runner.temp }}/tmb/kit/.parts/ffmpeg.json
|
||||
key: tmb-ffmpeg-${{ hashFiles('tools/build_kit_packages.json', 'tools/make_build_kit.py') }}
|
||||
key: tmb-bozo-ffmpeg-${{ hashFiles('tools/build_kit_packages.json', 'tools/make_build_kit.py') }}
|
||||
|
||||
- name: Install the pinned MSYS2 packages (exact files, SHA-256 checked)
|
||||
env:
|
||||
MSYS2_ROOT: ${{ steps.msys2.outputs.msys2-location }}
|
||||
run: python tools/make_build_kit.py --install-packages --msys "$MSYS2_ROOT" --downloads "$WORK/downloads"
|
||||
|
||||
- name: Build kit
|
||||
- name: Build kit (toolchain, Python, SDL3 and ImGui sources, FFmpeg, Real-ESRGAN)
|
||||
env:
|
||||
MSYS2_ROOT: ${{ steps.msys2.outputs.msys2-location }}
|
||||
FFMPEG_CACHED: ${{ steps.ffmpeg.outputs.cache-hit }}
|
||||
run: |
|
||||
set -eu
|
||||
steps="--only toolchain --only python --only deps"
|
||||
steps="--only toolchain --only python --only deps --only realesrgan"
|
||||
if [ "$FFMPEG_CACHED" != true ]; then steps="$steps --only ffmpeg"; fi
|
||||
python tools/make_build_kit.py --out "$WORK/kit" --msys "$MSYS2_ROOT" --downloads "$WORK/downloads" \
|
||||
--work "$WORK/kit-work" $steps --only tools --only manifest
|
||||
--work "$WORK/kit-work" $steps --only manifest
|
||||
|
||||
- name: Make the release (zip, .sha256, sources zip, notes from CHANGELOG.md)
|
||||
env:
|
||||
MSYS2_ROOT: ${{ steps.msys2.outputs.msys2-location }}
|
||||
run: |
|
||||
set -eu
|
||||
if [ -n "$TEST_BUILD" ]; then extra="--allow-missing-changelog"; else extra="--with-sources"; fi
|
||||
python tools/make_release.py --version "$VERSION" --kit "$WORK/kit" --msys "$MSYS2_ROOT" \
|
||||
--out "$WORK/release" --downloads "$WORK/downloads" --with-sources
|
||||
--out "$WORK/release" --downloads "$WORK/downloads" $extra
|
||||
|
||||
- name: Smoke checks (no game data anywhere)
|
||||
run: |
|
||||
set -eu
|
||||
rel="$WORK/release"
|
||||
name="TMB_Recomp-$VERSION"
|
||||
name="TMB_Recomp-$VERSION-bozo"
|
||||
# The zip: no game file, the files a release needs; the hashes.
|
||||
python tools/make_release.py --verify-zip "$rel/$name.zip"
|
||||
(cd "$rel" && sha256sum -c "$name.zip.sha256" && sha256sum -c "$name-sources.zip.sha256")
|
||||
(cd "$rel" && sha256sum -c "$name.zip.sha256")
|
||||
(cd "$rel" && sha256sum -c "TMB_Recomp-$VERSION.zip.sha256")
|
||||
python -c 'import sys; sys.path.insert(0, "tools"); from make_release import verify_zip; p = verify_zip(sys.argv[1], top="TMB_Recomp"); print(p); sys.exit(bool(p))' "$rel/TMB_Recomp-$VERSION.zip"
|
||||
if [ -z "$TEST_BUILD" ]; then (cd "$rel" && sha256sum -c "$name-sources.zip.sha256"); fi
|
||||
# Unzipped as a player would.
|
||||
t="$WORK/smoke"
|
||||
t="$WORK/smoke/Jérôme Games"
|
||||
rm -rf "$t" && mkdir -p "$t/user"
|
||||
python -I -c 'import sys, zipfile; zipfile.ZipFile(sys.argv[1]).extractall(sys.argv[2])' "$rel/$name.zip" "$t"
|
||||
app="$t/TMB_Recomp"
|
||||
app="$t/TMB_Recomp_Bozo"
|
||||
# A real static C++ link through an accented kit path, without any game data or installed developer tools.
|
||||
"$app/kit/python/python.exe" -I "$app/source/tools/check_toolchain.py" --toolchain "$app/kit/ucrt64" --out "$WORK/compiler-check"
|
||||
head -c 1048576 /dev/zero > "$t/not_a_disc.iso"
|
||||
# tmb_build with the kit's own Python refuses a file that is not a disc.
|
||||
if "$app/kit/python/python.exe" -I -X utf8 "$app/source/tools/tmb_build.py" --check \
|
||||
@@ -150,7 +184,24 @@ jobs:
|
||||
cat "$t/self-check.txt"
|
||||
grep -q "^version $VERSION$" "$t/self-check.txt"
|
||||
|
||||
- name: Draft GitHub release (never published here)
|
||||
- name: Keep the zips (the run's artifacts)
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: TMB_Recomp-${{ env.VERSION }}-bozo
|
||||
path: |
|
||||
${{ runner.temp }}/tmb/release/TMB_Recomp-${{ env.VERSION }}-bozo.zip
|
||||
${{ runner.temp }}/tmb/release/TMB_Recomp-${{ env.VERSION }}-bozo.zip.sha256
|
||||
${{ runner.temp }}/tmb/release/TMB_Recomp-${{ env.VERSION }}.zip
|
||||
${{ runner.temp }}/tmb/release/TMB_Recomp-${{ env.VERSION }}.zip.sha256
|
||||
${{ runner.temp }}/tmb/release/TMB_Recomp-${{ env.VERSION }}-bozo-sources.zip
|
||||
${{ runner.temp }}/tmb/release/TMB_Recomp-${{ env.VERSION }}-bozo-sources.zip.sha256
|
||||
${{ runner.temp }}/tmb/release/RELEASE_NOTES.md
|
||||
if-no-files-found: error
|
||||
retention-days: 14
|
||||
compression-level: 0
|
||||
|
||||
- name: Draft GitHub release (never published here; tags only)
|
||||
if: env.TEST_BUILD == ''
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: python tools/make_release.py --version "$VERSION" --out "$WORK/release" --publish-only
|
||||
@@ -159,10 +210,14 @@ jobs:
|
||||
if: always()
|
||||
run: |
|
||||
{
|
||||
echo "## TMB_Recomp $VERSION"
|
||||
echo "## TMB_Recomp $VERSION (BozoEngine)"
|
||||
echo
|
||||
if [ -f "$WORK/release/RELEASE_NOTES.md" ]; then
|
||||
echo "A **draft** release was created if every step passed: run docs/RELEASE_CHECKLIST.md on a clean PC, then publish it."
|
||||
if [ -n "$TEST_BUILD" ]; then
|
||||
echo "A test build: the zip is this run's artifact; no release was made."
|
||||
else
|
||||
echo "A **draft** release was created if every step passed: run docs/RELEASE_CHECKLIST.md on a clean PC, then publish it."
|
||||
fi
|
||||
echo
|
||||
cat "$WORK/release/RELEASE_NOTES.md"
|
||||
else
|
||||
|
||||
+8
-1
@@ -17,7 +17,11 @@ SLUS_*
|
||||
*.irx
|
||||
*.IMG
|
||||
|
||||
# PS2Recomp is a git submodule; local build trees live here
|
||||
# The BozoEngine release cmake/bozo_engine.json pins (cmake/bozo_engine_fetch.cmake)
|
||||
/BozoEngine/
|
||||
/.BozoEngine-unpack/
|
||||
|
||||
# Local build trees
|
||||
build/
|
||||
out/
|
||||
cmake-build-*/
|
||||
@@ -41,3 +45,6 @@ ps2_log.txt
|
||||
# Debug UI layout the runtime writes in the working directory
|
||||
imgui.ini
|
||||
__pycache__/
|
||||
|
||||
# Retired local checkout (not a dependency; preserves untracked local files during migration)
|
||||
/PS2Recomp/
|
||||
@@ -1,3 +0,0 @@
|
||||
[submodule "PS2Recomp"]
|
||||
path = PS2Recomp
|
||||
url = https://github.com/TheBozos/PS2Recomp.git
|
||||
+3
-3
@@ -11,8 +11,8 @@
|
||||
"project": "TMB_Recomp",
|
||||
"status": "released",
|
||||
"targets": ["Windows"],
|
||||
"toolchain": "Ps2recomp",
|
||||
"approach": "Static recompilation with a PS2Recomp fork; native PC renderer, sound and timing, no GS, VU or SPU2 emulation in the default mode.",
|
||||
"toolchain": "BozoEngine",
|
||||
"approach": "Static recompilation with BozoEngine; native PC renderer, sound, input and timing, with no PS2Recomp dependency or IOP, GS, VIF or VU interpreter in the player build.",
|
||||
"started": "2026-10-22",
|
||||
"maintainers": [
|
||||
{ "name": "boubou666", "link": "https://github.com/boubou666" },
|
||||
@@ -27,5 +27,5 @@
|
||||
"Testing on high-refresh monitors (the experimental smoothed frame rate)",
|
||||
"Testing on Linux"
|
||||
],
|
||||
"notes": "Playable at 60 fps on Windows, built by the launcher from the player's own USA disc. Every Challenge arena played, split screen for 2 to 4 players, memory card saves, rebindable controls including keyboard and mouse, video settings and cheats. Next: story levels 2 to 8 checked to the end, widescreen."
|
||||
"notes": "Playable at a 60 Hz target on Windows, built by the launcher from the player's own USA disc. BozoEngine replaces the previous runtime; native 1P with bots, four-player split screen, level 20, card writes and restart/readback are validated. Rebindable controls, video settings, cheats and default-on heat haze. Next: full campaign endings, every arena rechecked on BozoEngine, physical-controller/clean-OS acceptance and widescreen."
|
||||
}
|
||||
+196
-1
@@ -7,6 +7,194 @@ under "Unreleased" as they land, then move them under the new version's heading
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [0.7.3] - 2026-12-01
|
||||
|
||||
### Added
|
||||
|
||||
- **RecompLauncher support.** Releases carry a `recomplauncher.json`, so [RecompLauncher](https://recomplauncher.com)
|
||||
can install TMB_Recomp, check the disc against the USA dump, prepare the game with the release's own build, start
|
||||
it, show the video settings (display mode, widescreen, frame rate, render scale, anti-aliasing, texture smoothing)
|
||||
on the game's page and back up the memory cards. A game set up there keeps its saves, settings and logs in its
|
||||
`recompdata` folder.
|
||||
- Preparing again without a disc image uses the one the earlier preparation kept in the game folder, so an update can
|
||||
be built after the original image was deleted.
|
||||
|
||||
## [0.7.2] - 2026-11-30
|
||||
|
||||
### Changed
|
||||
|
||||
- **BozoEngine comes from its releases instead of a git submodule.** `cmake/bozo_engine.json` pins a release by
|
||||
version and SHA-256 (0.4.0, the same code as the commit pinned before), and configuring fetches it into
|
||||
`BozoEngine/` (`cmake/bozo_engine_fetch.cmake`, the scheme SoulCaliburIII_Recomp uses). A player's release still
|
||||
ships the engine's source in `source\BozoEngine` and builds offline; `release.ini` now stamps `engine_version`. To
|
||||
work on the engine and TMB together, point `BOZO_ENGINE_DIR` (or `tmb_build.py --engine`) at a BozoEngine checkout.
|
||||
- **BozoEngine 0.6.0** (from 0.4.0). In the window, the sound is held to the real time without clicks (engine PR #164),
|
||||
and a render scale over 1 averages the pixels under each window pixel instead of picking one (#168). The rest
|
||||
(SPU2 output interrupts, the movie library's work-area layout, the disc stream, ReferSemaStatus,
|
||||
sceSifGetOtherData and opt-in library answers for other ports) leaves TMB's runs unchanged: the 1P and 4P replay
|
||||
routes give the same record on every frame.
|
||||
|
||||
## [0.7.1] - 2026-11-30
|
||||
|
||||
### Fixed
|
||||
|
||||
- **A release unzipped by hand no longer trips the build on its file times.** The zip dates every file at its
|
||||
commit's time, which an unzip reads as local time: west of UTC, within hours of a release, the files were in the
|
||||
future and Prepare stopped with ninja's "manifest 'build.ninja' still dirty after 100 tries"; and an update unzipped
|
||||
over a game built after its commit could leave a changed file uncompiled. `tools/tmb_build.py` now settles the times
|
||||
before configuring: nothing in the source or the kit stays in the future, and with a record of each source and kit
|
||||
dependency file (`<work folder>/source_times.json`) a changed or new file is dated now and an unchanged one keeps its
|
||||
old time. A git checkout is left alone; the launcher's Update was not affected.
|
||||
|
||||
## [0.7.0] - 2026-11-27
|
||||
|
||||
### Added
|
||||
|
||||
- **Save states.** F5 saves and F7 loads the current slot, F6 / Shift+F6 pick the slot (0 to 9), and F2 has a
|
||||
**Save states** tab listing them with a picture of each. They go to `states/slot<n>.state` in the user folder (about
|
||||
40 MB each). A state loads only into the build that wrote it, and a save waits while a movie plays. For scripted
|
||||
runs: `--save-state FILE --save-state-at N` and `--load-state FILE`.
|
||||
- **PC SETTINGS in the game's own Options screen.** A ninth line under SAVE SETTINGS TO MEMORY CARD opens pages
|
||||
drawn in the game's font and steered with the pad: **Video** (display mode, resolution, render scale, frame rate,
|
||||
anti-aliasing, texture smoothing, upscaling and its filter, texture pack, pause in background, fast forward; APPLY
|
||||
AND SAVE writes `video.ini`), **Cheats** (unlock everything, infinite health / ammo / energy, no AI, weak enemies;
|
||||
at once) and **Save states** (the slot, LOAD, SAVE, as F5 / F7). Triangle or Circle goes back. The controls stay in
|
||||
F2.
|
||||
- **PC SETTINGS in the pause menu** too: a fifth line under RESUME, QUIT, SET VIBRATION and ADJUST REAR VIEW (a
|
||||
fourth with several players) opens the same pages in the pause menu's style, on the pausing player's pad.
|
||||
- **QUIT GAME** at the bottom of PC SETTINGS: Cross, then Cross again, ends the game and closes the window.
|
||||
- **Widescreen (16:9)**, off by default: in F2's Video tab, PC SETTINGS → Video, or `widescreen = on` in `video.ini`
|
||||
(`PS2X_WIDESCREEN=1`). In one-player and two-player matches the game draws a 16:9 picture: it shows more at the
|
||||
sides (its own views made wider, culling and all), nothing is stretched, and the HUD keeps its shape. The menus,
|
||||
movies and loading screens stay 4:3, centred, and three- and four-player split screens stay 4:3. The pause menu and
|
||||
the other dialogs over a match (results, won, lost) are shown 4:3 and centred. The HUD goes to the 16:9 edges: the
|
||||
radar, name and health to the left, the weapons, energy and lives to the right; the markers over the cars stay
|
||||
on them.
|
||||
|
||||
### Fixed
|
||||
|
||||
- Quitting a match from the pause menu no longer leaves the match's music playing over the menus (BozoEngine's
|
||||
989SND driver now stops a bank's sounds when the game unloads it).
|
||||
|
||||
## [0.6.0] - 2026-11-11
|
||||
|
||||
### Added
|
||||
|
||||
- **Enhanced textures (AI), made on your PC from your own disc.** In the launcher's Settings, **Make enhanced
|
||||
textures** reads every arena and car from your disc, including the cars' player versions, and upscales their
|
||||
textures 4x with Real-ESRGAN. It takes about 5 to 15 minutes with a recent graphics card and about 700 MB, and
|
||||
needs a Vulkan graphics driver. It shows its progress; **Stop** keeps what is done for next time, and **Remove**
|
||||
deletes the result. Switch the pack on or off there or in the game (F2, Video tab, Texture pack). Real-ESRGAN now
|
||||
comes in the build kit, with its licences in `kit\licenses\realesrgan`. Nothing of the game is downloaded,
|
||||
shipped or sent anywhere.
|
||||
- **Texture upscaling** (off by default): the game's own textures can be drawn from 2x or 4x copies with an
|
||||
edge-directed or smooth filter, in F2's Video tab or with `texture_upscale` / `texture_filter` in `video.ini`. It is
|
||||
BozoEngine's renderer option, from the Soulcalibur III port. Replays are unchanged by it.
|
||||
- Loading the pack or the upscaled copies never holds up a frame. One-player, four-player and the story arenas keep
|
||||
their frame rate with the full pack and 4x upscaling (timing in
|
||||
[`docs/TEXTURE_UPSCALING.md`](docs/TEXTURE_UPSCALING.md)).
|
||||
|
||||
### Fixed
|
||||
|
||||
- The launcher's Settings no longer reset the game's frame rate and texture upscaling in `video.ini` when they
|
||||
saved the window.
|
||||
|
||||
### Changed
|
||||
|
||||
- BozoEngine is updated to `a36a4d2`. Native callbacks now run on the game's own thread stack instead of a fixed
|
||||
area at the top of RAM. TMB declares where its code uses the stack pointer as data (`hierTraverseAsm`,
|
||||
`sysSetSp`/`sysRestoreSp`), so a callback taken there still finds the real stack. One-player and four-player
|
||||
replays match the previous build on every frame's draws, scratchpad, calls, threads and timing. Sound differs on
|
||||
four menu frames only, with equal sample counts.
|
||||
|
||||
### Developer changes
|
||||
|
||||
- `TMB_TEXTURE_DUMP=1|<folder>` writes each texture the renderer receives as a PNG named by its identity, and every
|
||||
250 frames every texture of the loaded levels' objects, drawn or not.
|
||||
- `tools/tmb_texture_dump_all.py` dumps every arena, AI car and player car in headless runs (2,289 textures on the
|
||||
USA disc). `tools/tmb_texture_upscale.py` (Python) and `tmb-texture-pack` (native, built and staged with the game)
|
||||
turn the dump into a pack; `tools/tmb_texture_enhance.py` is the launcher's driver for both.
|
||||
- Larger texture copies go to the GPU at most 4 MB per frame, and a copy already there is shared when the game moves
|
||||
the texture in its VRAM (BozoEngine).
|
||||
|
||||
### Known limits
|
||||
|
||||
- Only the USA disc is supported. Windows is the validated player target; the migrated Linux player build is not yet
|
||||
validated.
|
||||
- Enhanced textures need a Vulkan graphics driver and were only tested on one NVIDIA card. The menus and the font
|
||||
are left to the engine's upscaling, because the AI model garbles small lettering.
|
||||
- Full campaign endings, a fresh standard-user Windows installation and four physical controllers still need
|
||||
player/hardware acceptance. Widescreen is not implemented; presentation above 60 Hz remains experimental for
|
||||
effects that update at game rate.
|
||||
|
||||
## [0.5.0] - 2026-11-09
|
||||
|
||||
### Changed
|
||||
|
||||
- **The game's 3D math runs natively.** Every inventoried coordinate transform (269 forward and 134 inverse uses)
|
||||
now runs as native C++. So do the hierarchy, collision, terrain, particle, camera, weapon and HUD calculations
|
||||
built on them; none of them goes through the recompiled vector-unit helper any more. Generated tests compare
|
||||
every one against the original arithmetic. Recorded one-player and four-player replays match the previous build
|
||||
on every frame's calls, draws, sound and timing. The only differences found were in unused scratch memory.
|
||||
- More of the graphics path is native: HUD and menu image builders, mesh shader parameters, screen and weather
|
||||
projection, texture inputs and upload completion. The game no longer emits per-object shader packets.
|
||||
- BozoEngine is updated to `4a8f70a`.
|
||||
|
||||
### Fixed
|
||||
|
||||
- **Rare hang when leaving a menu movie** (seen once on vehicle select): a movie could freeze after a long frame, and
|
||||
the next menu choice then waited for its decoder forever. The movie player's vblank handler now runs natively.
|
||||
|
||||
### Developer changes
|
||||
|
||||
- The native-math caller suite covers about 191,000 generated sequences (9,952 whole-memory comparisons). They span
|
||||
four rounding modes, denormal flushing, RAM aliases and arbitrary W payloads, with full-owner entries for each
|
||||
call site.
|
||||
- `docs/HANDOFF.md` links one qualification document per batch: test coverage, replay comparison and window runs.
|
||||
|
||||
### Known limits
|
||||
|
||||
- Only the USA disc is supported. Windows is the validated player target; the migrated Linux player build is not yet validated.
|
||||
- Full campaign endings, a fresh standard-user Windows installation and four physical controllers still need player/hardware acceptance.
|
||||
Widescreen is not implemented; presentation above 60 Hz remains experimental for effects that update at game rate.
|
||||
|
||||
## [0.4.0] - 2026-11-06
|
||||
|
||||
### Changed
|
||||
|
||||
- **BozoEngine is now the only recompiler and runtime.** The PS2Recomp submodule, legacy build targets and IOP
|
||||
recompilation steps are removed. TMB and BozoEngine are MIT; release packages retain every third-party licence.
|
||||
- The launcher uses SDL3 and Dear ImGui; the game uses BozoEngine's native window, input, renderer, sound and movie
|
||||
services. Existing memory-card files and settings remain usable.
|
||||
- Two installation ZIPs contain the same BozoEngine build: `-bozo.zip` installs beside the previous port, while the
|
||||
ZIP without that suffix preserves the old launcher's in-place update path. Both use BozoEngine.
|
||||
|
||||
### Fixed
|
||||
|
||||
- **Original heat haze enabled by default** around fire and explosions. `BOZO_HEAT_HAZE=0` disables it for comparisons
|
||||
with the previous PC build.
|
||||
- Menu and movie pacing always uses the native clock. An old `TMB_NATIVE_FRAMES=0` setting can no longer select an
|
||||
unpaced path. Timing checks now measure menu ticks and movie picture cadence independently of the FPS counter.
|
||||
- Match-start sound and lens-flare presentation stalls are fixed in the pinned BozoEngine revision.
|
||||
- Building from folders with spaces and accents now keeps GCC's startup objects and static libraries on the
|
||||
safe path and disables unused C++ module scanning. In-place updates remove the retired runtime's source folder
|
||||
without following directory links. Launcher self-tests fail when preparing or starting the game fails.
|
||||
- Native Windows executables use UTF-8 file paths. A changed toolchain invalidates stale configure checks before
|
||||
retrying, and release source exports drain tar padding so they cannot hang waiting for `git archive`.
|
||||
|
||||
### Developer changes
|
||||
|
||||
- All build/run shortcuts use the disc-to-game BozoEngine pipeline. Release audits reject the retired runtime.
|
||||
- Added Windows/Linux CI and regression checks for timing, package contents and the migration ZIP layout.
|
||||
|
||||
### Known limits
|
||||
|
||||
- Only the USA disc is supported. Windows is the validated player target; the migrated Linux player build is not yet validated.
|
||||
- Full campaign endings, a fresh standard-user Windows installation and four physical controllers still need player/hardware acceptance.
|
||||
Widescreen is not implemented; presentation above 60 Hz remains experimental for effects that update at game rate.
|
||||
- Exact native sound-model/sample equality and the old test-only save-cheat replay remain reference-test limitations.
|
||||
Native story progression, card writes, restart/readback and actual four-player play pass; see `docs/HANDOFF.md` for the evidence.
|
||||
|
||||
## [0.3.2] - 2026-11-02
|
||||
|
||||
### Added
|
||||
@@ -123,7 +311,14 @@ The first release. You build the game on your own PC from your own USA disc; not
|
||||
- Technical: built from TMB_Recomp's code and the PS2Recomp fork (`native/renderer`) with the build kit's GCC 16.2,
|
||||
FFmpeg 9.0.2 and Python 3.14; the default mode has no GS, VU or SPU2 emulation and no IOP hardware model.
|
||||
|
||||
[Unreleased]: https://github.com/TheBozos/TMB_Recomp/compare/v0.3.2...HEAD
|
||||
[Unreleased]: https://github.com/TheBozos/TMB_Recomp/compare/v0.7.3...HEAD
|
||||
[0.7.3]: https://github.com/TheBozos/TMB_Recomp/compare/v0.7.2...v0.7.3
|
||||
[0.7.2]: https://github.com/TheBozos/TMB_Recomp/compare/v0.7.1...v0.7.2
|
||||
[0.7.1]: https://github.com/TheBozos/TMB_Recomp/compare/v0.7.0...v0.7.1
|
||||
[0.7.0]: https://github.com/TheBozos/TMB_Recomp/compare/v0.6.0...v0.7.0
|
||||
[0.6.0]: https://github.com/TheBozos/TMB_Recomp/compare/v0.5.0...v0.6.0
|
||||
[0.5.0]: https://github.com/TheBozos/TMB_Recomp/compare/v0.4.0...v0.5.0
|
||||
[0.4.0]: https://github.com/TheBozos/TMB_Recomp/compare/v0.3.2...v0.4.0
|
||||
[0.3.2]: https://github.com/TheBozos/TMB_Recomp/compare/v0.3.1...v0.3.2
|
||||
[0.3.1]: https://github.com/TheBozos/TMB_Recomp/compare/v0.3.0...v0.3.1
|
||||
[0.3.0]: https://github.com/TheBozos/TMB_Recomp/compare/v0.2.0...v0.3.0
|
||||
|
||||
+4
-135
@@ -1,139 +1,8 @@
|
||||
cmake_minimum_required(VERSION 3.21)
|
||||
project(TMB_Recomp LANGUAGES C CXX)
|
||||
|
||||
# Twisted Metal: Black (USA, SCUS-97101) static recompilation on top of PS2Recomp.
|
||||
#
|
||||
# Build the tools first (scripts/build_tools.sh), generate code (scripts/recomp.sh),
|
||||
# then configure this project to get the `ps2EntryRunner` executable with the
|
||||
# recompiled game linked in.
|
||||
# The port uses no C++ modules. GCC's module mapper cannot represent canonical Windows kit paths with spaces.
|
||||
set(CMAKE_CXX_SCAN_FOR_MODULES OFF)
|
||||
|
||||
set(TMB_GENERATED_DIR "${CMAKE_SOURCE_DIR}/generated" CACHE PATH
|
||||
"Directory containing the output of ps2_recomp for the game ELF")
|
||||
|
||||
# Only the runtime is needed here; the recompiler/analyzer are built separately.
|
||||
set(PS2X_BUILD_RECOMP OFF CACHE BOOL "" FORCE)
|
||||
set(PS2X_BUILD_ANALYZER OFF CACHE BOOL "" FORCE)
|
||||
set(PS2X_BUILD_TEST OFF CACHE BOOL "" FORCE)
|
||||
set(PS2X_BUILD_STUDIO OFF CACHE BOOL "" FORCE)
|
||||
|
||||
# The runner as a PC game (the fork's ps2_app.h): its window title, the per-user folder (%APPDATA%\TMB_Recomp,
|
||||
# $XDG_DATA_HOME/tmb_recomp) for the memory cards, input.ini, video.ini, the log and crash reports, and with no argument
|
||||
# the game data in game/ next to the runner (or in the user folder). No console window (a GUI-subsystem runner: the
|
||||
# output goes to the log, and to the terminal it was started from).
|
||||
set(PS2X_APP_TITLE "Twisted Metal: Black" CACHE STRING "" FORCE)
|
||||
set(PS2X_APP_FOLDER "TMB_Recomp" CACHE STRING "" FORCE)
|
||||
set(PS2X_APP_XDG_FOLDER "tmb_recomp" CACHE STRING "" FORCE)
|
||||
set(PS2X_APP_BOOT_ELF "SCUS_971.01" CACHE STRING "" FORCE)
|
||||
set(PS2X_APP_DATA_FOLDER "game" CACHE STRING "" FORCE)
|
||||
set(PS2X_SHOW_WINDOWS_CONSOLE OFF CACHE BOOL "" FORCE)
|
||||
|
||||
add_subdirectory(PS2Recomp)
|
||||
|
||||
# The runner's icon and version information (runtime/app: a placeholder icon, no game art).
|
||||
if(WIN32)
|
||||
enable_language(RC)
|
||||
target_sources(ps2EntryRunner PRIVATE "${CMAKE_SOURCE_DIR}/runtime/app/tmb.rc")
|
||||
endif()
|
||||
|
||||
file(GLOB TMB_GENERATED_SOURCES CONFIGURE_DEPENDS "${TMB_GENERATED_DIR}/*.cpp")
|
||||
if(NOT TMB_GENERATED_SOURCES)
|
||||
message(FATAL_ERROR
|
||||
"No generated sources in ${TMB_GENERATED_DIR}. Run scripts/recomp.sh first.")
|
||||
endif()
|
||||
|
||||
# The runtime ships a placeholder register_functions.cpp that defines the same
|
||||
# function-table globals as the generated one; drop it from the runner.
|
||||
get_target_property(_runner_sources ps2EntryRunner SOURCES)
|
||||
list(FILTER _runner_sources EXCLUDE REGEX "src/runner/register_functions\\.cpp$")
|
||||
set_property(TARGET ps2EntryRunner PROPERTY SOURCES ${_runner_sources})
|
||||
|
||||
file(GLOB TMB_RUNTIME_SOURCES CONFIGURE_DEPENDS "${CMAKE_SOURCE_DIR}/runtime/*.cpp")
|
||||
# The native texture pack scripts/recomp.sh converts from the disc (runtime/tmb_textures.cpp loads it).
|
||||
target_compile_definitions(ps2EntryRunner PRIVATE TMB_TEXTURE_PACK="${TMB_GENERATED_DIR}/tmb_textures.pack")
|
||||
# The native mesh pack it converts from the disc's NGP files (tools/tmb_mesh_pack.py).
|
||||
target_compile_definitions(ps2EntryRunner PRIVATE TMB_MESH_PACK="${TMB_GENERATED_DIR}/tmb_meshes.pack")
|
||||
|
||||
# IOP modules recompiled to native C++ by the fork's tools/iop_recomp.py (989snd, libsd; PS2X_IOP_NATIVE=1 runs them;
|
||||
# scripts/iop_recomp.sh writes them, derived from the game's IRX files like the rest of generated/): their own object
|
||||
# library, outside the unity batches (each file's names are its own), without debug info.
|
||||
file(GLOB TMB_IOP_NATIVE_SOURCES CONFIGURE_DEPENDS "${TMB_GENERATED_DIR}/iop/*.cpp")
|
||||
if(TMB_IOP_NATIVE_SOURCES)
|
||||
add_library(tmb_iop_native OBJECT ${TMB_IOP_NATIVE_SOURCES})
|
||||
target_link_libraries(tmb_iop_native PRIVATE ps2x::iop)
|
||||
set_target_properties(tmb_iop_native PROPERTIES UNITY_BUILD OFF)
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
|
||||
target_compile_options(tmb_iop_native PRIVATE -O2 -g0)
|
||||
endif()
|
||||
target_sources(ps2EntryRunner PRIVATE $<TARGET_OBJECTS:tmb_iop_native>)
|
||||
endif()
|
||||
# The host OS layer includes <windows.h>, which clashes with raylib names: outside the unity batches and the PCH.
|
||||
set_source_files_properties("${CMAKE_SOURCE_DIR}/runtime/tmb_host.cpp" PROPERTIES
|
||||
SKIP_UNITY_BUILD_INCLUSION ON SKIP_PRECOMPILE_HEADERS ON)
|
||||
|
||||
# VU1 microcode compiled ahead of time by ps2_vu_aot (scripts/recomp.sh): an object library both executables
|
||||
# link, so it compiles once. -O3 unrolls the operand loops over each pair's constexpr decode; debug info is of no
|
||||
# use for it and triples its build time. Each file takes GCC several GB: at most 4 compile at once.
|
||||
file(GLOB TMB_VU1_AOT_SOURCES CONFIGURE_DEPENDS "${TMB_GENERATED_DIR}/vu1/*.cpp")
|
||||
if(TMB_VU1_AOT_SOURCES)
|
||||
set_property(GLOBAL APPEND PROPERTY JOB_POOLS tmb_vu1_aot=4)
|
||||
# With it, microcode loops lifted to native code by hand (runtime/vu1, VU1Interpreter::registerLiftedEntry).
|
||||
file(GLOB TMB_VU1_LIFTED_SOURCES CONFIGURE_DEPENDS "${CMAKE_SOURCE_DIR}/runtime/vu1/*.cpp")
|
||||
add_library(tmb_vu1_aot OBJECT ${TMB_VU1_AOT_SOURCES} ${TMB_VU1_LIFTED_SOURCES})
|
||||
target_link_libraries(tmb_vu1_aot PRIVATE ps2_runtime)
|
||||
set_target_properties(tmb_vu1_aot PROPERTIES UNITY_BUILD OFF JOB_POOL_COMPILE tmb_vu1_aot)
|
||||
# TMB_VU1_AOT_LINES=ON: line tables only (-g1), so a profile of the replay maps samples to the jit helpers.
|
||||
option(TMB_VU1_AOT_LINES "Line tables in the compiled VU1 microcode, for profiling" OFF)
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
|
||||
if(TMB_VU1_AOT_LINES)
|
||||
target_compile_options(tmb_vu1_aot PRIVATE -O3 -g1)
|
||||
else()
|
||||
target_compile_options(tmb_vu1_aot PRIVATE -O3 -g0)
|
||||
endif()
|
||||
endif()
|
||||
target_sources(ps2EntryRunner PRIVATE $<TARGET_OBJECTS:tmb_vu1_aot>)
|
||||
endif()
|
||||
|
||||
target_sources(ps2EntryRunner PRIVATE ${TMB_GENERATED_SOURCES} ${TMB_RUNTIME_SOURCES})
|
||||
target_include_directories(ps2EntryRunner PRIVATE "${TMB_GENERATED_DIR}")
|
||||
|
||||
list(LENGTH TMB_GENERATED_SOURCES _tmb_count)
|
||||
message(STATUS "TMB_Recomp: linking ${_tmb_count} generated source files from ${TMB_GENERATED_DIR}")
|
||||
|
||||
# The VU1 replay tool with the compiled microcode linked in: checks it against runs recorded with
|
||||
# PS2X_VU1_RECORD (build/game/tmb_vu1_replay <trace> [repeat]).
|
||||
if(TMB_VU1_AOT_SOURCES)
|
||||
add_executable(tmb_vu1_replay PS2Recomp/ps2xRuntime/tools/ps2_vu1_replay.cpp $<TARGET_OBJECTS:tmb_vu1_aot>)
|
||||
target_link_libraries(tmb_vu1_replay PRIVATE ps2_runtime)
|
||||
if(WIN32)
|
||||
# PS2X_PROFILE=<seconds>: the fork's sampling profiler, to see where the compiled microcode spends its time.
|
||||
target_sources(tmb_vu1_replay PRIVATE PS2Recomp/ps2xRuntime/src/profiling/sampling_profiler.cpp)
|
||||
target_link_libraries(tmb_vu1_replay PRIVATE raylib winmm) # raylib first: winmm has a PlaySound too
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Profile-guided optimization (GCC) of the runtime, the IOP and the compiled VU1 microcode, the code the frame time
|
||||
# goes to; the generated game code keeps its flags (it would all rebuild). scripts/pgo.sh: GENERATE, a training run
|
||||
# into the match, then USE. The profile is specific to this build tree and machine, never committed.
|
||||
set(TMB_PGO "OFF" CACHE STRING "Profile-guided optimization: OFF, GENERATE or USE (scripts/pgo.sh)")
|
||||
set_property(CACHE TMB_PGO PROPERTY STRINGS OFF GENERATE USE)
|
||||
set(TMB_PGO_DIR "${CMAKE_BINARY_DIR}/pgo-profile" CACHE PATH "Where TMB_PGO=GENERATE writes the profile USE reads")
|
||||
if(NOT TMB_PGO STREQUAL "OFF" AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
if(TMB_PGO STREQUAL "GENERATE")
|
||||
set(_tmb_pgo_flags "-fprofile-generate=${TMB_PGO_DIR}" -fprofile-update=atomic)
|
||||
target_link_options(ps2EntryRunner PRIVATE "-fprofile-generate=${TMB_PGO_DIR}")
|
||||
target_sources(ps2EntryRunner PRIVATE "${CMAKE_SOURCE_DIR}/runtime/pgo/tmb_pgo_train.cpp")
|
||||
set_source_files_properties("${CMAKE_SOURCE_DIR}/runtime/pgo/tmb_pgo_train.cpp" PROPERTIES
|
||||
SKIP_UNITY_BUILD_INCLUSION ON SKIP_PRECOMPILE_HEADERS ON)
|
||||
else()
|
||||
set(_tmb_pgo_flags "-fprofile-use=${TMB_PGO_DIR}" -fprofile-partial-training -fprofile-correction -Wno-missing-profile)
|
||||
endif()
|
||||
foreach(_tmb_pgo_target ps2_runtime ps2_iop tmb_vu1_aot)
|
||||
if(TARGET ${_tmb_pgo_target})
|
||||
target_compile_options(${_tmb_pgo_target} PRIVATE ${_tmb_pgo_flags})
|
||||
endif()
|
||||
endforeach()
|
||||
if(TMB_PGO STREQUAL "GENERATE" AND TARGET tmb_vu1_replay)
|
||||
target_link_options(tmb_vu1_replay PRIVATE "-fprofile-generate=${TMB_PGO_DIR}")
|
||||
endif()
|
||||
message(STATUS "TMB_Recomp: profile-guided optimization ${TMB_PGO} (${TMB_PGO_DIR})")
|
||||
endif()
|
||||
# The port is built only on BozoEngine. The pre-migration build remains in the v0.3.2 tag.
|
||||
include(cmake/bozo.cmake)
|
||||
@@ -23,9 +23,8 @@ SOFTWARE.
|
||||
---
|
||||
|
||||
This licence covers TMB_Recomp's own files. It does not cover:
|
||||
- PS2Recomp/ (the runtime and recompiler, a separate project): GPL-3.0, see PS2Recomp/LICENSE.
|
||||
The game executable a player builds links that runtime, so that build is a GPL-3.0 combined work.
|
||||
- BozoEngine/ (the recompiler and runtime, a separate MIT project, fetched from its releases): see BozoEngine/LICENSE.
|
||||
- Anything from Twisted Metal: Black. No game data, code or art is in this repository or its releases;
|
||||
players build the port from their own disc.
|
||||
- Third-party components with their own licences (raylib, Dear ImGui, the Exo 2 font, and the build
|
||||
- Third-party components with their own licences (SDL3, Dear ImGui, the Exo 2 font, and the build
|
||||
kit's GCC, binutils, CMake, Ninja, FFmpeg, Python); a release lists them in LICENSES\.
|
||||
-1
Submodule PS2Recomp deleted from 3eb40ffffd.
@@ -0,0 +1,157 @@
|
||||
// tmb-check: BozoEngine's call-log checker (bozo-run: BozoEngine's tools/run/README.md) with TMB's overrides running
|
||||
// natively (BozoEngine's kernel.md section 3b), each call checked against the reference's log:
|
||||
// tmb-check <log.clg> --pinned --ref <run.ref> [--iso <image>] [--pad-script <file>] [--overrides log] ...
|
||||
// The ELF defaults to the one this build was generated from.
|
||||
//
|
||||
// --window (builds with TMB_WINDOW): the same pinned run, its frames shown in a window as they are made (BozoEngine's
|
||||
// window, the renderer's present), to capture the pictures of chosen frames (milestone M5's pixel comparison):
|
||||
// tmb-check <log.clg> ... --window --capture-frames n,n,... [--capture-dir dir] [--width w --height h]
|
||||
// [--render-scale s] [--aspect a] [--hidden]
|
||||
// --capture-frames n: the picture once n frames have ended, i.e. the reference record n - 1's frame (frame_<n>.png). The
|
||||
// run is held at that frame's end until the window has read it back, so the picture is exactly that frame's. The window
|
||||
// is 640x448 at render scale 1 by default; --aspect is the picture's shape inside it (4:3 by default, letterboxed).
|
||||
// --hidden: the window is never shown, and the captures read the game's offscreen picture (the same pixels).
|
||||
#include "run_main.h"
|
||||
|
||||
#if TMB_CHECK_WINDOW
|
||||
#include "bozo/app/determinism.h"
|
||||
#include "bozo/app/window.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <chrono>
|
||||
#include <condition_variable>
|
||||
#include <mutex>
|
||||
#include <set>
|
||||
#include <sstream>
|
||||
#endif
|
||||
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#ifndef BOZO_RUN_DEFAULT_ELF
|
||||
#define BOZO_RUN_DEFAULT_ELF ""
|
||||
#endif
|
||||
|
||||
#if TMB_CHECK_WINDOW
|
||||
namespace
|
||||
{
|
||||
// The run held at a capture frame's end until the window read that frame's picture back.
|
||||
struct CaptureGate
|
||||
{
|
||||
std::mutex mutex;
|
||||
std::condition_variable wake;
|
||||
std::set<uint64_t> frames;
|
||||
uint64_t captured = 0; // the last frame count the window captured at
|
||||
bool closing = false;
|
||||
};
|
||||
|
||||
CaptureGate &gate()
|
||||
{
|
||||
static CaptureGate s_gate;
|
||||
return s_gate;
|
||||
}
|
||||
|
||||
int runWindowed(const std::vector<char *> &args)
|
||||
{
|
||||
bozo::app::WindowOptions window;
|
||||
window.title = "Twisted Metal: Black (BozoEngine, pinned)";
|
||||
window.width = 640;
|
||||
window.height = 448;
|
||||
window.renderScale = 1.0f;
|
||||
window.aspect = 4.0f / 3.0f; // the picture's shape, letterboxed in the window (as the fork's window and tmb)
|
||||
window.panel = false;
|
||||
window.stats = false;
|
||||
static std::vector<char *> rest;
|
||||
for (size_t k = 0; k < args.size(); ++k)
|
||||
{
|
||||
const std::string a = args[k];
|
||||
auto value = [&]() -> std::string { return k + 1 < args.size() ? args[++k] : ""; };
|
||||
if (a == "--window")
|
||||
continue;
|
||||
if (a == "--capture-frames")
|
||||
{
|
||||
std::stringstream list(value());
|
||||
for (std::string item; std::getline(list, item, ',');)
|
||||
if (!item.empty())
|
||||
window.captureFrames.push_back(std::stoull(item));
|
||||
}
|
||||
else if (a == "--capture-dir")
|
||||
window.captureDir = value();
|
||||
else if (a == "--width")
|
||||
window.width = std::stoi(value());
|
||||
else if (a == "--height")
|
||||
window.height = std::stoi(value());
|
||||
else if (a == "--render-scale")
|
||||
window.renderScale = std::stof(value());
|
||||
else if (a == "--aspect")
|
||||
window.aspect = std::stof(value());
|
||||
else if (a == "--hidden")
|
||||
window.hidden = true;
|
||||
else
|
||||
rest.push_back(args[k]);
|
||||
}
|
||||
|
||||
gate().frames.insert(window.captureFrames.begin(), window.captureFrames.end());
|
||||
bozo::run::setFrameHook([](uint64_t framesEnded) {
|
||||
CaptureGate &g = gate();
|
||||
std::unique_lock<std::mutex> lock(g.mutex);
|
||||
if (!g.frames.count(framesEnded))
|
||||
return;
|
||||
// Held until the window has shown and read back this frame (30 s at most: a closed window lets it go).
|
||||
if (!g.wake.wait_for(lock, std::chrono::seconds(30), [&] { return g.closing || g.captured >= framesEnded; }))
|
||||
std::fprintf(stderr, "tmb-check: no capture of frame %llu within 30 s\n", static_cast<unsigned long long>(framesEnded));
|
||||
});
|
||||
window.onCaptured = [](uint64_t frames) {
|
||||
CaptureGate &g = gate();
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(g.mutex);
|
||||
g.captured = std::max(g.captured, frames);
|
||||
}
|
||||
g.wake.notify_all();
|
||||
};
|
||||
|
||||
bozo::app::Game game;
|
||||
game.run = [] { return bozo::run::main(static_cast<int>(rest.size()), rest.data()); };
|
||||
game.stop = [] {
|
||||
CaptureGate &g = gate();
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(g.mutex);
|
||||
g.closing = true;
|
||||
}
|
||||
g.wake.notify_all();
|
||||
};
|
||||
game.framesEnded = [] { return bozo::det::frame(); };
|
||||
return bozo::app::runWindow(window, game, nullptr);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
std::vector<char *> args(argv, argv + argc);
|
||||
bool hasElf = false, windowed = false;
|
||||
for (int i = 1; i < argc; ++i)
|
||||
{
|
||||
hasElf = hasElf || std::strcmp(argv[i], "--elf") == 0;
|
||||
windowed = windowed || std::strcmp(argv[i], "--window") == 0;
|
||||
}
|
||||
static char elfFlag[] = "--elf";
|
||||
static std::string elf = BOZO_RUN_DEFAULT_ELF;
|
||||
if (!hasElf && !elf.empty() && argc >= 2)
|
||||
{
|
||||
args.push_back(elfFlag);
|
||||
args.push_back(elf.data());
|
||||
}
|
||||
if (windowed)
|
||||
{
|
||||
#if TMB_CHECK_WINDOW
|
||||
return runWindowed(args);
|
||||
#else
|
||||
std::fprintf(stderr, "tmb-check: --window needs a build with TMB_WINDOW\n");
|
||||
return 2;
|
||||
#endif
|
||||
}
|
||||
return bozo::run::main(static_cast<int>(args.size()), args.data());
|
||||
}
|
||||
@@ -0,0 +1,256 @@
|
||||
// tmb-headless: Twisted Metal: Black on BozoEngine with no window (phase 4, milestone M0). Every library native, the
|
||||
// disc image read, BozoEngine's own timing (free mode), TMB's overrides native; the native renderer records its frames.
|
||||
//
|
||||
// tmb-headless [--frames n] [--elf SCUS_971.01] [--iso image] [--pad-script [n=]file]... [--card-dir dir]
|
||||
// [--out run.ref] [--report n] [--quiet] [--wav file [--wav-frames a-b]] [--no-sound]
|
||||
// [--save-state file --save-state-at n] [--load-state file [--load-state-at n]] [--dump-ram file]
|
||||
//
|
||||
// --pad-script n=file: player n's frame-keyed script (1 when omitted; players 2-4 are the multitap's slots, as the
|
||||
// reference's PS2X_PAD2_SCRIPT..PS2X_PAD4_SCRIPT).
|
||||
//
|
||||
// --wav: the sound the mixer made (48 kHz stereo, 16-bit), from game frame a to b (all of it by default); --no-sound:
|
||||
// the mixer is not brought up at the frames' ends (as before milestone M3).
|
||||
// --save-state / --load-state: BozoEngine's save states (BozoEngine/docs/save-states.md): the whole run written when n
|
||||
// frames have ended, or loaded before the first frame (or when n frames have ended). --dump-ram: EE RAM at the run's end.
|
||||
// Every --report frames (500 by default) and at the end: the frame, the EE clock, the function that waited for the
|
||||
// frame's end (the game's loop: uiTitle_Main__Fv at the title), the Shell (the menus' object, gp - 0x4148) and the
|
||||
// overrides that ran.
|
||||
#include "tmb_host.h"
|
||||
#include "tmb_port.h"
|
||||
#include "tmb_state.h"
|
||||
|
||||
#include "bozo/app/determinism.h"
|
||||
#include "bozo/audio/wav.h"
|
||||
#include "bozo/ee/dispatcher.h"
|
||||
#include "bozo/host/free_host.h"
|
||||
#include "tmb_scene.h"
|
||||
#include "bozo/render/renderer.h"
|
||||
|
||||
#include <chrono>
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
#include <filesystem>
|
||||
#include <map>
|
||||
#include <string>
|
||||
|
||||
#ifndef BOZO_RUN_DEFAULT_ELF
|
||||
#define BOZO_RUN_DEFAULT_ELF ""
|
||||
#endif
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
bozo::host::FreeOptions opt;
|
||||
opt.elf = BOZO_RUN_DEFAULT_ELF;
|
||||
uint64_t report = 500;
|
||||
std::string wavPath, dumpRam;
|
||||
uint64_t wavFrom = 0, wavTo = UINT64_MAX;
|
||||
for (int k = 1; k < argc; ++k)
|
||||
{
|
||||
const std::string a = argv[k];
|
||||
auto value = [&]() -> std::string { return k + 1 < argc ? argv[++k] : ""; };
|
||||
if (a == "--frames")
|
||||
opt.frames = static_cast<uint32_t>(std::stoul(value()));
|
||||
else if (a == "--elf")
|
||||
opt.elf = value();
|
||||
else if (a == "--iso")
|
||||
opt.iso = value();
|
||||
else if (a == "--pad-script")
|
||||
{
|
||||
std::string v = value();
|
||||
int player = 1;
|
||||
if (v.size() > 2 && v[1] == '=' && v[0] >= '1' && v[0] <= '4')
|
||||
{
|
||||
player = v[0] - '0';
|
||||
v = v.substr(2);
|
||||
}
|
||||
(player == 1 ? opt.padScript : opt.playerScripts[static_cast<size_t>(player - 2)]) = v;
|
||||
}
|
||||
else if (a == "--card-dir")
|
||||
opt.cardDir = value();
|
||||
else if (a == "--out")
|
||||
opt.out = value();
|
||||
else if (a == "--report")
|
||||
report = std::stoull(value());
|
||||
else if (a == "--quiet")
|
||||
opt.quiet = true;
|
||||
else if (a == "--print")
|
||||
opt.printGameOutput = true;
|
||||
else if (a == "--wav")
|
||||
wavPath = value();
|
||||
else if (a == "--wav-frames")
|
||||
{
|
||||
const std::string range = value();
|
||||
const size_t dash = range.find('-');
|
||||
wavFrom = std::stoull(range.substr(0, dash));
|
||||
if (dash != std::string::npos && dash + 1 < range.size())
|
||||
wavTo = std::stoull(range.substr(dash + 1));
|
||||
}
|
||||
else if (a == "--no-sound")
|
||||
opt.sound = false;
|
||||
else if (a == "--save-state")
|
||||
opt.saveState = value();
|
||||
else if (a == "--save-state-at")
|
||||
opt.saveStateFrame = static_cast<uint32_t>(std::stoull(value()));
|
||||
else if (a == "--load-state")
|
||||
opt.loadState = value();
|
||||
else if (a == "--load-state-at")
|
||||
opt.loadStateFrame = static_cast<uint32_t>(std::stoull(value()));
|
||||
else if (a == "--dump-ram")
|
||||
dumpRam = value();
|
||||
else
|
||||
{
|
||||
std::fprintf(stderr, "usage: tmb-headless [--frames n] [--elf path] [--iso image] [--pad-script [n=]file]... [--card-dir dir] "
|
||||
"[--out run.ref] [--report n] [--print] [--quiet] [--wav file [--wav-frames a-b]] [--no-sound] "
|
||||
"[--save-state file --save-state-at n] [--load-state file [--load-state-at n]] [--dump-ram file]\n");
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
if (opt.elf.empty())
|
||||
{
|
||||
std::fprintf(stderr, "tmb-headless: no ELF (--elf)\n");
|
||||
return 2;
|
||||
}
|
||||
tmb::host::setElfDirectory(std::filesystem::path(opt.elf).parent_path().string());
|
||||
if (opt.iso.empty())
|
||||
opt.iso = tmb::findDiscImage(std::filesystem::path(opt.elf).parent_path().string(), "SCUS_971.01");
|
||||
if (opt.iso.empty())
|
||||
{
|
||||
std::fprintf(stderr, "tmb-headless: no disc image (--iso, TMB_ISO, or an .iso beside the ELF)\n");
|
||||
return 2;
|
||||
}
|
||||
// Headless: no host clock reaches the game (determinism.h).
|
||||
bozo::det::setEnabled(true);
|
||||
|
||||
const bozo::port::Port *port = bozo::port::port();
|
||||
bozo::port::Registry registry;
|
||||
port->install(registry);
|
||||
const std::vector<uint32_t> missing = bozo::port::undeclared(registry, tmb_external_table, tmb_external_count);
|
||||
if (!missing.empty())
|
||||
{
|
||||
std::fprintf(stderr, "%zu registered overrides are not externals of the generated code (regenerate):", missing.size());
|
||||
for (uint32_t a : missing)
|
||||
std::fprintf(stderr, " 0x%x", a);
|
||||
std::fprintf(stderr, "\n");
|
||||
return 2;
|
||||
}
|
||||
|
||||
opt.gameTag = "SCUS-97101";
|
||||
bozo::host::FreeHost host(opt);
|
||||
host.onStateMessage = [](bool, const std::string &message) { std::printf("[state] %s\n", message.c_str()); };
|
||||
bozo::ee::Dispatcher d(host);
|
||||
tmb::scene::Binding scene(&d.runtime());
|
||||
tmb::addStateSection(host, &d.runtime());
|
||||
d.setFunctions(tmb_function_table, tmb_function_count, tmb_resume_table, tmb_resume_count);
|
||||
std::string error;
|
||||
if (!host.setUp(d, tmb_external_table, tmb_external_count, ®istry, error))
|
||||
{
|
||||
std::fprintf(stderr, "tmb-headless: %s\n", error.c_str());
|
||||
return 2;
|
||||
}
|
||||
std::printf("tmb-headless: %s, %zu overrides, ELF %s, disc %s\n", port->title, registry.functions().size(), opt.elf.c_str(),
|
||||
opt.iso.c_str());
|
||||
|
||||
// What the game is doing at a frame's end.
|
||||
std::string waiter;
|
||||
uint32_t shell = 0;
|
||||
// The shell's screen: gp - 0x3d2c, which uiMain__Fv switches on through its table at 0x4eae90 (case 0, 0x18ee14,
|
||||
// calls uiTitle_Main__Fv), and the frame it last changed at; -1 outside the shell's loop.
|
||||
int32_t screen = -1;
|
||||
uint64_t screenSince = 0;
|
||||
std::map<int32_t, uint64_t> screens; // frames per screen
|
||||
const auto t0 = std::chrono::steady_clock::now();
|
||||
std::map<std::string, uint64_t> waiters; // the frames each loop function ended
|
||||
auto state = [&](uint64_t frame) {
|
||||
const double secs = std::chrono::duration<double>(std::chrono::steady_clock::now() - t0).count();
|
||||
const bozo::render::Renderer &r = bozo::render::Renderer::instance();
|
||||
const auto published = r.published();
|
||||
const auto overlay = r.publishedOverlay();
|
||||
std::printf("frame %llu: EE cycle %llu (%llu vblanks), loop %s, Shell 0x%x, screen %d%s since frame %llu; renderer: 3D "
|
||||
"%zu batches, 2D %zu batches, movie picture %s; %.1f s\n",
|
||||
static_cast<unsigned long long>(frame), static_cast<unsigned long long>(d.now()),
|
||||
static_cast<unsigned long long>(d.kernel().vblankCount()), waiter.c_str(), shell, screen,
|
||||
screen == 0 ? " (uiTitle_Main__Fv)" : "", static_cast<unsigned long long>(screenSince),
|
||||
published ? published->batches.size() : 0u, overlay ? overlay->batches.size() : 0u,
|
||||
r.backdrop() ? "yes" : "no", secs);
|
||||
std::fflush(stdout);
|
||||
};
|
||||
host.onFrame = [&](uint64_t frame, const R5900Context *ctx) {
|
||||
if (ctx)
|
||||
{
|
||||
// The function that called the frame's end (timer1Handler's caller, or sceGsSyncV's): the game's loop.
|
||||
waiter = host.functionAt(ctx->r[31].uw[0]);
|
||||
const std::string fn = waiter.substr(0, waiter.find('+'));
|
||||
++waiters[fn];
|
||||
const uint32_t gp = ctx->r[28].uw[0];
|
||||
int32_t now = -1;
|
||||
if (gp)
|
||||
{
|
||||
std::memcpy(&shell, d.runtime().memory.ram() + ((gp - 0x4148u) & 0x1FFFFFCu), 4);
|
||||
if (fn == "uiMain__Fv")
|
||||
std::memcpy(&now, d.runtime().memory.ram() + ((gp - 0x3D2Cu) & 0x1FFFFFCu), 4);
|
||||
}
|
||||
if (now != screen)
|
||||
{
|
||||
screen = now;
|
||||
screenSince = frame;
|
||||
}
|
||||
++screens[now];
|
||||
}
|
||||
if (report && (frame + 1) % report == 0 && !opt.quiet)
|
||||
state(frame + 1);
|
||||
};
|
||||
bozo::audio::WavWriter wav;
|
||||
if (!wavPath.empty())
|
||||
{
|
||||
if (!wav.open(wavPath))
|
||||
{
|
||||
std::fprintf(stderr, "tmb-headless: cannot write %s\n", wavPath.c_str());
|
||||
return 2;
|
||||
}
|
||||
host.onAudio = [&](uint64_t frame, const int16_t *samples, size_t count) {
|
||||
if (frame >= wavFrom && frame <= wavTo)
|
||||
wav.write(samples, count);
|
||||
};
|
||||
}
|
||||
const uint64_t frames = host.run();
|
||||
if (!dumpRam.empty())
|
||||
if (FILE *f = std::fopen(dumpRam.c_str(), "wb"))
|
||||
{
|
||||
std::fwrite(d.runtime().memory.ram(), 1, 0x2000000u, f);
|
||||
std::fclose(f);
|
||||
}
|
||||
if (wav.isOpen())
|
||||
{
|
||||
std::printf("wav: %s, %.1f s of sound\n", wavPath.c_str(), wav.frames() / 48000.0);
|
||||
wav.close();
|
||||
}
|
||||
state(frames);
|
||||
const bozo::host::FreeStats &s = host.stats();
|
||||
std::printf("end: %s; %llu frames; %llu library calls, %llu kernel calls, %llu override calls, %llu VU0 programs, %llu "
|
||||
"hardware accesses (%llu to registers the I/O model does not know)\n",
|
||||
host.endReason().empty() ? "every thread ended" : host.endReason().c_str(), static_cast<unsigned long long>(frames),
|
||||
static_cast<unsigned long long>(s.libraryCalls), static_cast<unsigned long long>(s.kernelCalls),
|
||||
static_cast<unsigned long long>(s.overrideCalls), static_cast<unsigned long long>(s.vu0Calls),
|
||||
static_cast<unsigned long long>(s.ioAccesses), static_cast<unsigned long long>(s.ioUnknown));
|
||||
std::printf("frame ends by loop function:");
|
||||
for (const auto &[fn, n] : waiters)
|
||||
std::printf(" %s %llu;", fn.c_str(), static_cast<unsigned long long>(n));
|
||||
std::printf("\nframes per shell screen (-1: outside the shell's loop):");
|
||||
for (const auto &[sc, n] : screens)
|
||||
std::printf(" %d: %llu;", sc, static_cast<unsigned long long>(n));
|
||||
std::printf("\noverride calls:");
|
||||
for (const auto &[a, n] : host.overrideCalls())
|
||||
std::printf(" 0x%x:%llu", a, static_cast<unsigned long long>(n));
|
||||
std::printf("\n");
|
||||
// The pads the game found and read: each socket's reads (port.slot), and whether the multitap was open.
|
||||
const bozo::libs::PadState &pads = host.libraries().pad;
|
||||
std::printf("pad reads (port.slot: reads; multitap %s):", pads.multitap ? "open" : "closed");
|
||||
for (int p = 0; p < 2; ++p)
|
||||
for (int sl = 0; sl < 4; ++sl)
|
||||
std::printf(" %d.%d: %llu;", p + 1, sl, static_cast<unsigned long long>(pads.socketReads[p][sl]));
|
||||
std::printf("\n");
|
||||
for (const auto &[name, n] : s.unanswered)
|
||||
std::printf("no native answer: %s (%llu)\n", name.c_str(), static_cast<unsigned long long>(n));
|
||||
return host.endReason().rfind("FAULT", 0) == 0 ? 1 : 0;
|
||||
}
|
||||
@@ -0,0 +1,829 @@
|
||||
// tmb-texture-pack: a texture replacement pack made from a texture dump with Real-ESRGAN, on the player's PC from their
|
||||
// own disc (docs/TEXTURE_UPSCALING.md). The native counterpart of tools/tmb_texture_upscale.py, for the launcher's
|
||||
// "Enhance textures" step: no Python packages, built with the game.
|
||||
//
|
||||
// tmb-texture-pack <dump folder> <pack folder> --esrgan <realesrgan-ncnn-vulkan.exe> [--models <folder>]
|
||||
// [--model realesrgan-x4plus] [--min-size 32] [--detail 1.0] [--skip SHELL1,FONT] [--jobs N]
|
||||
// [--work <folder>]
|
||||
//
|
||||
// Per texture (index.tsv's rows, <identity>.png, GS alpha as the dump wrote it):
|
||||
// - colour: transparent texels take their visible neighbours' colour, then Real-ESRGAN 4x over a 16-texel border taken
|
||||
// from the opposite edges (repeating textures stay seamless); the original's high frequencies (bicubic minus its
|
||||
// Gaussian blur, sigma 3 at the output size) added back, since the model flattens gravel and rust;
|
||||
// - alpha: one value kept; two values cut at the midpoint of a bicubic; otherwise the visible shape (bicubic of the
|
||||
// visible mask cut at half) keeps everything outside it at 0, a few levels (<= 4) snapped to the nearest one;
|
||||
// - flat areas (a texel equal to its 8 neighbours) kept exactly; menus and font (--skip) and textures under --min-size
|
||||
// left to the engine's own upscaling.
|
||||
// Files already in the pack are kept (a run can be resumed). Output for the launcher: "step <name>", "progress <done>
|
||||
// <total>", "error <text>", "done <count>" lines on stdout.
|
||||
|
||||
#include "bozo/render/png_read.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
#include <atomic>
|
||||
#include <chrono>
|
||||
#include <cmath>
|
||||
#include <cstdint>
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
#include <filesystem>
|
||||
#include <fstream>
|
||||
#include <mutex>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <thread>
|
||||
#include <unordered_set>
|
||||
#include <vector>
|
||||
|
||||
#if defined(_WIN32)
|
||||
#ifndef WIN32_LEAN_AND_MEAN
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#endif
|
||||
#include <windows.h>
|
||||
#else
|
||||
#include <sys/wait.h>
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
namespace fs = std::filesystem;
|
||||
|
||||
namespace
|
||||
{
|
||||
constexpr int kScale = 4, kPad = 16;
|
||||
|
||||
std::mutex g_out;
|
||||
void say(const std::string &line)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(g_out);
|
||||
std::fputs((line + "\n").c_str(), stdout);
|
||||
std::fflush(stdout);
|
||||
}
|
||||
|
||||
// ---- PNG writing: zlib with LZ77 (hash chains) and the fixed Huffman code (RFC 1950 / 1951) ----
|
||||
|
||||
struct BitWriter
|
||||
{
|
||||
std::vector<uint8_t> out;
|
||||
uint32_t buffer = 0;
|
||||
int count = 0;
|
||||
void put(uint32_t bits, int n)
|
||||
{
|
||||
buffer |= bits << count;
|
||||
count += n;
|
||||
while (count >= 8)
|
||||
{
|
||||
out.push_back(static_cast<uint8_t>(buffer));
|
||||
buffer >>= 8;
|
||||
count -= 8;
|
||||
}
|
||||
}
|
||||
void putReversed(uint32_t code, int n) // Huffman codes go most significant bit first
|
||||
{
|
||||
uint32_t r = 0;
|
||||
for (int i = 0; i < n; ++i)
|
||||
r |= ((code >> i) & 1u) << (n - 1 - i);
|
||||
put(r, n);
|
||||
}
|
||||
void flush()
|
||||
{
|
||||
if (count > 0)
|
||||
out.push_back(static_cast<uint8_t>(buffer));
|
||||
buffer = 0;
|
||||
count = 0;
|
||||
}
|
||||
};
|
||||
|
||||
void literal(BitWriter &w, int v)
|
||||
{
|
||||
if (v < 144)
|
||||
w.putReversed(0x30 + v, 8);
|
||||
else if (v < 256)
|
||||
w.putReversed(0x190 + v - 144, 9);
|
||||
else if (v < 280)
|
||||
w.putReversed(v - 256, 7);
|
||||
else
|
||||
w.putReversed(0xc0 + v - 280, 8);
|
||||
}
|
||||
|
||||
constexpr uint16_t kLengthBase[29] = {3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
|
||||
35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258};
|
||||
constexpr uint8_t kLengthExtra[29] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0};
|
||||
constexpr uint16_t kDistBase[30] = {1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
|
||||
257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577};
|
||||
constexpr uint8_t kDistExtra[30] = {0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13};
|
||||
|
||||
std::vector<uint8_t> deflate(const std::vector<uint8_t> &data)
|
||||
{
|
||||
BitWriter w;
|
||||
w.put(0x78, 8);
|
||||
w.put(0x01, 8);
|
||||
w.put(1, 1); // the last (only) block
|
||||
w.put(1, 2); // fixed Huffman codes
|
||||
constexpr int kHashBits = 15, kWindow = 32768, kChain = 32;
|
||||
std::vector<int32_t> head(1u << kHashBits, -1), prev(data.size(), -1);
|
||||
const auto hash = [&](size_t i) { return ((data[i] << 10) ^ (data[i + 1] << 5) ^ data[i + 2]) & ((1u << kHashBits) - 1u); };
|
||||
size_t i = 0;
|
||||
while (i < data.size())
|
||||
{
|
||||
int bestLen = 0, bestDist = 0;
|
||||
if (i + 3 <= data.size())
|
||||
{
|
||||
const uint32_t h = hash(i);
|
||||
int32_t candidate = head[h];
|
||||
for (int chain = 0; candidate >= 0 && chain < kChain && static_cast<int>(i) - candidate <= kWindow; ++chain)
|
||||
{
|
||||
const size_t limit = std::min<size_t>(258, data.size() - i);
|
||||
size_t len = 0;
|
||||
while (len < limit && data[candidate + len] == data[i + len])
|
||||
++len;
|
||||
if (static_cast<int>(len) > bestLen)
|
||||
{
|
||||
bestLen = static_cast<int>(len);
|
||||
bestDist = static_cast<int>(i) - candidate;
|
||||
if (len == limit)
|
||||
break;
|
||||
}
|
||||
candidate = prev[candidate];
|
||||
}
|
||||
prev[i] = head[h];
|
||||
head[h] = static_cast<int32_t>(i);
|
||||
}
|
||||
if (bestLen >= 3)
|
||||
{
|
||||
int s = 0;
|
||||
while (s < 28 && kLengthBase[s + 1] <= bestLen)
|
||||
++s;
|
||||
literal(w, 257 + s);
|
||||
w.put(static_cast<uint32_t>(bestLen - kLengthBase[s]), kLengthExtra[s]);
|
||||
int d = 0;
|
||||
while (d < 29 && kDistBase[d + 1] <= bestDist)
|
||||
++d;
|
||||
w.putReversed(static_cast<uint32_t>(d), 5);
|
||||
w.put(static_cast<uint32_t>(bestDist - kDistBase[d]), kDistExtra[d]);
|
||||
for (size_t k = 1; k < static_cast<size_t>(bestLen); ++k) // the matched bytes join the hash chains
|
||||
if (i + k + 3 <= data.size())
|
||||
{
|
||||
const uint32_t h = hash(i + k);
|
||||
prev[i + k] = head[h];
|
||||
head[h] = static_cast<int32_t>(i + k);
|
||||
}
|
||||
i += static_cast<size_t>(bestLen);
|
||||
}
|
||||
else
|
||||
literal(w, data[i++]);
|
||||
}
|
||||
literal(w, 256);
|
||||
w.flush();
|
||||
uint32_t a = 1, b = 0;
|
||||
for (uint8_t c : data)
|
||||
{
|
||||
a = (a + c) % 65521u;
|
||||
b = (b + a) % 65521u;
|
||||
}
|
||||
for (int s = 24; s >= 0; s -= 8)
|
||||
w.out.push_back(static_cast<uint8_t>(((b << 16) | a) >> s));
|
||||
return w.out;
|
||||
}
|
||||
|
||||
uint32_t crc32(const uint8_t *p, size_t n, uint32_t c = 0)
|
||||
{
|
||||
static const std::array<uint32_t, 256> table = []
|
||||
{
|
||||
std::array<uint32_t, 256> t{};
|
||||
for (uint32_t k = 0; k < 256; ++k)
|
||||
{
|
||||
uint32_t v = k;
|
||||
for (int j = 0; j < 8; ++j)
|
||||
v = (v & 1u) ? 0xedb88320u ^ (v >> 1) : v >> 1;
|
||||
t[k] = v;
|
||||
}
|
||||
return t;
|
||||
}();
|
||||
c = ~c;
|
||||
for (size_t k = 0; k < n; ++k)
|
||||
c = table[(c ^ p[k]) & 0xffu] ^ (c >> 8);
|
||||
return ~c;
|
||||
}
|
||||
|
||||
void be32(std::vector<uint8_t> &o, uint32_t v)
|
||||
{
|
||||
for (int s = 24; s >= 0; s -= 8)
|
||||
o.push_back(static_cast<uint8_t>(v >> s));
|
||||
}
|
||||
|
||||
void chunk(std::vector<uint8_t> &o, const char *type, const std::vector<uint8_t> &d)
|
||||
{
|
||||
be32(o, static_cast<uint32_t>(d.size()));
|
||||
const size_t at = o.size();
|
||||
o.insert(o.end(), type, type + 4);
|
||||
o.insert(o.end(), d.begin(), d.end());
|
||||
be32(o, crc32(o.data() + at, o.size() - at));
|
||||
}
|
||||
|
||||
// channels 3 (RGB) or 4 (RGBA), rows top-down; each row filtered with Sub (a good choice for photographs).
|
||||
bool writePng(const fs::path &path, const uint8_t *pixels, int width, int height, int channels)
|
||||
{
|
||||
std::vector<uint8_t> raw;
|
||||
raw.reserve((static_cast<size_t>(width) * channels + 1) * height);
|
||||
for (int y = 0; y < height; ++y)
|
||||
{
|
||||
raw.push_back(1);
|
||||
const uint8_t *row = pixels + static_cast<size_t>(y) * width * channels;
|
||||
for (int x = 0; x < width * channels; ++x)
|
||||
raw.push_back(static_cast<uint8_t>(row[x] - (x >= channels ? row[x - channels] : 0)));
|
||||
}
|
||||
std::vector<uint8_t> png = {0x89, 'P', 'N', 'G', '\r', '\n', 0x1a, '\n'}, header;
|
||||
be32(header, static_cast<uint32_t>(width));
|
||||
be32(header, static_cast<uint32_t>(height));
|
||||
header.insert(header.end(), {8, static_cast<uint8_t>(channels == 4 ? 6 : 2), 0, 0, 0});
|
||||
chunk(png, "IHDR", header);
|
||||
chunk(png, "IDAT", deflate(raw));
|
||||
chunk(png, "IEND", {});
|
||||
const fs::path temp = path.string() + ".part";
|
||||
{
|
||||
std::ofstream out(temp, std::ios::binary);
|
||||
out.write(reinterpret_cast<const char *>(png.data()), static_cast<std::streamsize>(png.size()));
|
||||
if (!out)
|
||||
return false;
|
||||
}
|
||||
std::error_code ec;
|
||||
fs::rename(temp, path, ec); // whole files only: an interrupted run leaves no half-written replacement
|
||||
return !ec;
|
||||
}
|
||||
|
||||
// ---- images ----
|
||||
|
||||
struct Image // float channels, row-major
|
||||
{
|
||||
int w = 0, h = 0, c = 0;
|
||||
std::vector<float> v;
|
||||
float &at(int x, int y, int k) { return v[(static_cast<size_t>(y) * w + x) * c + k]; }
|
||||
float at(int x, int y, int k) const { return v[(static_cast<size_t>(y) * w + x) * c + k]; }
|
||||
};
|
||||
|
||||
int wrap(int v, int n) { return ((v % n) + n) % n; }
|
||||
|
||||
// A border of `pad` texels taken from the opposite edges.
|
||||
Image wrapPad(const Image &in, int pad)
|
||||
{
|
||||
Image out{in.w + 2 * pad, in.h + 2 * pad, in.c, {}};
|
||||
out.v.resize(static_cast<size_t>(out.w) * out.h * out.c);
|
||||
for (int y = 0; y < out.h; ++y)
|
||||
for (int x = 0; x < out.w; ++x)
|
||||
for (int k = 0; k < in.c; ++k)
|
||||
out.at(x, y, k) = in.at(wrap(x - pad, in.w), wrap(y - pad, in.h), k);
|
||||
return out;
|
||||
}
|
||||
|
||||
// Bicubic (Keys, a = -0.5, as Pillow's) by `scale`, pixel centres aligned; edges clamped.
|
||||
float cubic(float t)
|
||||
{
|
||||
t = std::fabs(t);
|
||||
if (t < 1.0f)
|
||||
return (1.5f * t - 2.5f) * t * t + 1.0f;
|
||||
if (t < 2.0f)
|
||||
return ((-0.5f * t + 2.5f) * t - 4.0f) * t + 2.0f;
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
Image bicubic(const Image &in, int scale)
|
||||
{
|
||||
Image mid{in.w * scale, in.h, in.c, {}};
|
||||
mid.v.assign(static_cast<size_t>(mid.w) * mid.h * mid.c, 0.0f);
|
||||
for (int x = 0; x < mid.w; ++x)
|
||||
{
|
||||
const float s = (x + 0.5f) / scale - 0.5f;
|
||||
const int base = static_cast<int>(std::floor(s));
|
||||
float wsum = 0, wt[4];
|
||||
for (int t = 0; t < 4; ++t)
|
||||
wsum += wt[t] = cubic(s - static_cast<float>(base - 1 + t));
|
||||
for (int y = 0; y < in.h; ++y)
|
||||
for (int k = 0; k < in.c; ++k)
|
||||
{
|
||||
float acc = 0;
|
||||
for (int t = 0; t < 4; ++t)
|
||||
acc += wt[t] * in.at(std::clamp(base - 1 + t, 0, in.w - 1), y, k);
|
||||
mid.at(x, y, k) = acc / wsum;
|
||||
}
|
||||
}
|
||||
Image out{mid.w, in.h * scale, in.c, {}};
|
||||
out.v.assign(static_cast<size_t>(out.w) * out.h * out.c, 0.0f);
|
||||
for (int y = 0; y < out.h; ++y)
|
||||
{
|
||||
const float s = (y + 0.5f) / scale - 0.5f;
|
||||
const int base = static_cast<int>(std::floor(s));
|
||||
float wsum = 0, wt[4];
|
||||
for (int t = 0; t < 4; ++t)
|
||||
wsum += wt[t] = cubic(s - static_cast<float>(base - 1 + t));
|
||||
for (int x = 0; x < out.w; ++x)
|
||||
for (int k = 0; k < in.c; ++k)
|
||||
{
|
||||
float acc = 0;
|
||||
for (int t = 0; t < 4; ++t)
|
||||
acc += wt[t] * mid.at(x, std::clamp(base - 1 + t, 0, mid.h - 1), k);
|
||||
out.at(x, y, k) = acc / wsum;
|
||||
}
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
Image gaussian(const Image &in, float sigma)
|
||||
{
|
||||
const int r = static_cast<int>(std::ceil(sigma * 3.0f));
|
||||
std::vector<float> kernel(2 * r + 1);
|
||||
float sum = 0;
|
||||
for (int i = -r; i <= r; ++i)
|
||||
sum += kernel[i + r] = std::exp(-(i * i) / (2.0f * sigma * sigma));
|
||||
for (float &k : kernel)
|
||||
k /= sum;
|
||||
Image tmp = in, out = in;
|
||||
for (int y = 0; y < in.h; ++y)
|
||||
for (int x = 0; x < in.w; ++x)
|
||||
for (int k = 0; k < in.c; ++k)
|
||||
{
|
||||
float acc = 0;
|
||||
for (int i = -r; i <= r; ++i)
|
||||
acc += kernel[i + r] * in.at(std::clamp(x + i, 0, in.w - 1), y, k);
|
||||
tmp.at(x, y, k) = acc;
|
||||
}
|
||||
for (int y = 0; y < in.h; ++y)
|
||||
for (int x = 0; x < in.w; ++x)
|
||||
for (int k = 0; k < in.c; ++k)
|
||||
{
|
||||
float acc = 0;
|
||||
for (int i = -r; i <= r; ++i)
|
||||
acc += kernel[i + r] * tmp.at(x, std::clamp(y + i, 0, in.h - 1), k);
|
||||
out.at(x, y, k) = acc;
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
// ---- the steps ----
|
||||
|
||||
struct Texture
|
||||
{
|
||||
std::string identity;
|
||||
uint32_t w = 0, h = 0;
|
||||
std::vector<uint32_t> rgba; // GS alpha, R in the low byte
|
||||
Image rgb; // colour with transparent texels filled from their neighbours
|
||||
};
|
||||
|
||||
Image bleed(const Texture &t)
|
||||
{
|
||||
Image rgb{static_cast<int>(t.w), static_cast<int>(t.h), 3, {}};
|
||||
rgb.v.resize(static_cast<size_t>(t.w) * t.h * 3);
|
||||
std::vector<uint8_t> known(t.rgba.size());
|
||||
bool any = false, all = true;
|
||||
for (size_t i = 0; i < t.rgba.size(); ++i)
|
||||
{
|
||||
for (int k = 0; k < 3; ++k)
|
||||
rgb.v[i * 3 + k] = static_cast<float>((t.rgba[i] >> (8 * k)) & 0xffu);
|
||||
known[i] = (t.rgba[i] >> 24) != 0u;
|
||||
any |= known[i] != 0;
|
||||
all &= known[i] != 0;
|
||||
}
|
||||
if (!any || all)
|
||||
return rgb;
|
||||
const int w = rgb.w, h = rgb.h;
|
||||
for (int pass = 0; pass < 16; ++pass)
|
||||
{
|
||||
std::vector<uint8_t> next = known;
|
||||
bool grew = false, done = true;
|
||||
for (int y = 0; y < h; ++y)
|
||||
for (int x = 0; x < w; ++x)
|
||||
{
|
||||
const size_t i = static_cast<size_t>(y) * w + x;
|
||||
if (known[i])
|
||||
continue;
|
||||
float acc[3] = {0, 0, 0};
|
||||
int n = 0;
|
||||
for (int dy = -1; dy <= 1; ++dy)
|
||||
for (int dx = -1; dx <= 1; ++dx)
|
||||
{
|
||||
const size_t j = static_cast<size_t>(wrap(y + dy, h)) * w + wrap(x + dx, w);
|
||||
if ((dx || dy) && known[j])
|
||||
{
|
||||
for (int k = 0; k < 3; ++k)
|
||||
acc[k] += rgb.v[j * 3 + k];
|
||||
++n;
|
||||
}
|
||||
}
|
||||
if (n)
|
||||
{
|
||||
for (int k = 0; k < 3; ++k)
|
||||
rgb.v[i * 3 + k] = acc[k] / static_cast<float>(n);
|
||||
next[i] = 1;
|
||||
grew = true;
|
||||
}
|
||||
else
|
||||
done = false;
|
||||
}
|
||||
known.swap(next);
|
||||
if (done || !grew)
|
||||
break;
|
||||
}
|
||||
return rgb;
|
||||
}
|
||||
|
||||
std::vector<uint8_t> upscaleAlpha(const Texture &t)
|
||||
{
|
||||
const int w = static_cast<int>(t.w), h = static_cast<int>(t.h), W = w * kScale, H = h * kScale;
|
||||
std::vector<uint8_t> values;
|
||||
Image a{w, h, 1, {}}, mask{w, h, 1, {}};
|
||||
a.v.resize(t.rgba.size());
|
||||
mask.v.resize(t.rgba.size());
|
||||
for (size_t i = 0; i < t.rgba.size(); ++i)
|
||||
{
|
||||
const uint8_t v = static_cast<uint8_t>(t.rgba[i] >> 24);
|
||||
a.v[i] = v;
|
||||
mask.v[i] = v ? 255.0f : 0.0f;
|
||||
values.push_back(v);
|
||||
}
|
||||
std::sort(values.begin(), values.end());
|
||||
values.erase(std::unique(values.begin(), values.end()), values.end());
|
||||
std::vector<uint8_t> out(static_cast<size_t>(W) * H, values[0]);
|
||||
if (values.size() == 1)
|
||||
return out;
|
||||
const auto up = [&](const Image &img)
|
||||
{
|
||||
const Image big = bicubic(wrapPad(img, kPad), kScale);
|
||||
Image crop{W, H, 1, {}};
|
||||
crop.v.resize(static_cast<size_t>(W) * H);
|
||||
for (int y = 0; y < H; ++y)
|
||||
for (int x = 0; x < W; ++x)
|
||||
crop.at(x, y, 0) = big.at(x + kPad * kScale, y + kPad * kScale, 0);
|
||||
return crop;
|
||||
};
|
||||
const Image big = up(a);
|
||||
if (values.size() == 2)
|
||||
{
|
||||
const float mid = (values[0] + values[1]) / 2.0f;
|
||||
for (size_t i = 0; i < out.size(); ++i)
|
||||
out[i] = big.v[i] >= mid ? values[1] : values[0];
|
||||
return out;
|
||||
}
|
||||
const bool hasZero = values[0] == 0;
|
||||
const Image shape = hasZero ? up(mask) : Image{};
|
||||
std::vector<uint8_t> visible(values.begin() + (hasZero ? 1 : 0), values.end());
|
||||
const bool has128 = std::binary_search(values.begin(), values.end(), uint8_t{128});
|
||||
for (size_t i = 0; i < out.size(); ++i)
|
||||
{
|
||||
if (hasZero && shape.v[i] < 128.0f)
|
||||
{
|
||||
out[i] = 0;
|
||||
continue;
|
||||
}
|
||||
float v = std::clamp(big.v[i], static_cast<float>(visible.front()), static_cast<float>(visible.back()));
|
||||
if (values.size() <= 4)
|
||||
{
|
||||
uint8_t best = visible[0];
|
||||
for (uint8_t level : visible)
|
||||
if (std::fabs(level - v) < std::fabs(best - v))
|
||||
best = level;
|
||||
v = best;
|
||||
}
|
||||
else if (has128 && std::fabs(v - 128.0f) <= 2.0f)
|
||||
v = 128.0f;
|
||||
out[i] = static_cast<uint8_t>(std::lround(v));
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
// Texels equal to their 8 neighbours (colour and alpha within 1, wrap-around).
|
||||
std::vector<uint8_t> flatTexels(const Texture &t)
|
||||
{
|
||||
const int w = static_cast<int>(t.w), h = static_cast<int>(t.h);
|
||||
std::vector<uint8_t> flat(t.rgba.size(), 1);
|
||||
for (int y = 0; y < h; ++y)
|
||||
for (int x = 0; x < w; ++x)
|
||||
{
|
||||
const uint32_t c = t.rgba[static_cast<size_t>(y) * w + x];
|
||||
for (int dy = -1; dy <= 1 && flat[static_cast<size_t>(y) * w + x]; ++dy)
|
||||
for (int dx = -1; dx <= 1; ++dx)
|
||||
{
|
||||
const uint32_t d = t.rgba[static_cast<size_t>(wrap(y + dy, h)) * w + wrap(x + dx, w)];
|
||||
bool same = true;
|
||||
for (int k = 0; k < 4; ++k)
|
||||
same &= std::abs(static_cast<int>((c >> (8 * k)) & 0xffu) - static_cast<int>((d >> (8 * k)) & 0xffu)) <= 1;
|
||||
if (!same)
|
||||
{
|
||||
flat[static_cast<size_t>(y) * w + x] = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return flat;
|
||||
}
|
||||
|
||||
bool load(const fs::path &dump, const std::string &identity, Texture &t, std::string &why)
|
||||
{
|
||||
t.identity = identity;
|
||||
if (!bozo::render::readPng((dump / (identity + ".png")).string(), t.w, t.h, t.rgba, &why))
|
||||
return false;
|
||||
t.rgb = bleed(t);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool finish(const fs::path &dump, const std::string &identity, const fs::path &esrganOut, const fs::path &pack, float detail,
|
||||
std::string &why)
|
||||
{
|
||||
Texture t;
|
||||
if (!load(dump, identity, t, why))
|
||||
return false;
|
||||
uint32_t ow = 0, oh = 0;
|
||||
std::vector<uint32_t> model;
|
||||
if (!bozo::render::readPng(esrganOut.string(), ow, oh, model, &why))
|
||||
return false;
|
||||
const int w = static_cast<int>(t.w), h = static_cast<int>(t.h), W = w * kScale, H = h * kScale;
|
||||
if (ow != static_cast<uint32_t>((w + 2 * kPad) * kScale) || oh != static_cast<uint32_t>((h + 2 * kPad) * kScale))
|
||||
{
|
||||
why = "Real-ESRGAN's output has another size";
|
||||
return false;
|
||||
}
|
||||
Image hf;
|
||||
if (detail != 0.0f)
|
||||
{
|
||||
const Image big = bicubic(wrapPad(t.rgb, kPad), kScale);
|
||||
const Image blur = gaussian(big, 3.0f);
|
||||
hf = big;
|
||||
for (size_t i = 0; i < hf.v.size(); ++i)
|
||||
hf.v[i] = big.v[i] - blur.v[i];
|
||||
}
|
||||
const std::vector<uint8_t> alpha = upscaleAlpha(t), flat = flatTexels(t);
|
||||
std::vector<uint8_t> pixels(static_cast<size_t>(W) * H * 4);
|
||||
for (int y = 0; y < H; ++y)
|
||||
for (int x = 0; x < W; ++x)
|
||||
{
|
||||
uint8_t *p = &pixels[(static_cast<size_t>(y) * W + x) * 4];
|
||||
const size_t src = static_cast<size_t>(y / kScale) * w + x / kScale;
|
||||
if (flat[src])
|
||||
{
|
||||
for (int k = 0; k < 4; ++k)
|
||||
p[k] = static_cast<uint8_t>(t.rgba[src] >> (8 * k));
|
||||
continue;
|
||||
}
|
||||
const uint32_t m = model[static_cast<size_t>(y + kPad * kScale) * ow + x + kPad * kScale];
|
||||
for (int k = 0; k < 3; ++k)
|
||||
{
|
||||
float v = static_cast<float>((m >> (8 * k)) & 0xffu);
|
||||
if (detail != 0.0f)
|
||||
v += detail * hf.at(x + kPad * kScale, y + kPad * kScale, k);
|
||||
p[k] = static_cast<uint8_t>(std::clamp(std::lround(v), 0L, 255L));
|
||||
}
|
||||
p[3] = alpha[static_cast<size_t>(y) * W + x];
|
||||
}
|
||||
if (!writePng(pack / (t.identity + ".png"), pixels.data(), W, H, 4))
|
||||
{
|
||||
why = "cannot write the replacement";
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// Real-ESRGAN over a folder; progress from its output folder while it runs.
|
||||
int runEsrgan(const fs::path &exe, const fs::path &models, const std::string &model, const fs::path &in, const fs::path &out,
|
||||
size_t total)
|
||||
{
|
||||
std::vector<std::string> args = {exe.string(), "-i", in.string(), "-o", out.string(), "-n", model, "-m", models.string(),
|
||||
"-s", std::to_string(kScale), "-f", "png"};
|
||||
const auto count = [&]
|
||||
{
|
||||
size_t n = 0;
|
||||
std::error_code ec;
|
||||
for (fs::directory_iterator it(out, ec), end; !ec && it != end; it.increment(ec))
|
||||
++n;
|
||||
return n;
|
||||
};
|
||||
#if defined(_WIN32)
|
||||
std::wstring command;
|
||||
for (const std::string &a : args)
|
||||
{
|
||||
const std::wstring wa = fs::path(a).wstring();
|
||||
command += L"\"" + wa + L"\" ";
|
||||
}
|
||||
STARTUPINFOW si{};
|
||||
si.cb = sizeof(si);
|
||||
si.dwFlags = STARTF_USESTDHANDLES;
|
||||
si.hStdOutput = si.hStdError = CreateFileW(L"NUL", GENERIC_WRITE, FILE_SHARE_WRITE, nullptr, OPEN_EXISTING, 0, nullptr);
|
||||
si.hStdInput = GetStdHandle(STD_INPUT_HANDLE);
|
||||
PROCESS_INFORMATION pi{};
|
||||
if (!CreateProcessW(nullptr, command.data(), nullptr, nullptr, TRUE, CREATE_NO_WINDOW | BELOW_NORMAL_PRIORITY_CLASS,
|
||||
nullptr, nullptr, &si, &pi))
|
||||
{
|
||||
CloseHandle(si.hStdOutput);
|
||||
return -1;
|
||||
}
|
||||
while (WaitForSingleObject(pi.hProcess, 500) == WAIT_TIMEOUT)
|
||||
say("progress " + std::to_string(count()) + " " + std::to_string(total));
|
||||
DWORD code = 1;
|
||||
GetExitCodeProcess(pi.hProcess, &code);
|
||||
CloseHandle(pi.hThread);
|
||||
CloseHandle(pi.hProcess);
|
||||
CloseHandle(si.hStdOutput);
|
||||
return static_cast<int>(code);
|
||||
#else
|
||||
const pid_t pid = fork();
|
||||
if (pid == 0)
|
||||
{
|
||||
std::vector<char *> argv;
|
||||
for (std::string &a : args)
|
||||
argv.push_back(a.data());
|
||||
argv.push_back(nullptr);
|
||||
if (std::freopen("/dev/null", "w", stdout) && std::freopen("/dev/null", "w", stderr))
|
||||
execv(argv[0], argv.data());
|
||||
_exit(127);
|
||||
}
|
||||
if (pid < 0)
|
||||
return -1;
|
||||
int status = 0;
|
||||
while (waitpid(pid, &status, WNOHANG) == 0)
|
||||
{
|
||||
say("progress " + std::to_string(count()) + " " + std::to_string(total));
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||
}
|
||||
return WIFEXITED(status) ? WEXITSTATUS(status) : 1;
|
||||
#endif
|
||||
}
|
||||
|
||||
std::vector<std::string> split(const std::string &s, char c)
|
||||
{
|
||||
std::vector<std::string> out;
|
||||
std::stringstream in(s);
|
||||
for (std::string part; std::getline(in, part, c);)
|
||||
out.push_back(part);
|
||||
return out;
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
std::vector<std::string> positional;
|
||||
fs::path esrgan, models, work;
|
||||
std::string model = "realesrgan-x4plus", skipList = "SHELL1,FONT";
|
||||
int minSize = 32;
|
||||
float detail = 1.0f;
|
||||
unsigned jobs = std::max(1u, std::thread::hardware_concurrency() / 2);
|
||||
for (int i = 1; i < argc; ++i)
|
||||
{
|
||||
const std::string a = argv[i];
|
||||
const auto next = [&]() -> std::string { return i + 1 < argc ? argv[++i] : std::string(); };
|
||||
if (a == "--esrgan")
|
||||
esrgan = fs::path(next());
|
||||
else if (a == "--models")
|
||||
models = fs::path(next());
|
||||
else if (a == "--model")
|
||||
model = next();
|
||||
else if (a == "--min-size")
|
||||
minSize = std::atoi(next().c_str());
|
||||
else if (a == "--detail")
|
||||
detail = static_cast<float>(std::atof(next().c_str()));
|
||||
else if (a == "--skip")
|
||||
skipList = next();
|
||||
else if (a == "--jobs")
|
||||
jobs = static_cast<unsigned>(std::max(1, std::atoi(next().c_str())));
|
||||
else if (a == "--work")
|
||||
work = fs::path(next());
|
||||
else
|
||||
positional.push_back(a);
|
||||
}
|
||||
if (positional.size() != 2 || esrgan.empty())
|
||||
{
|
||||
std::fprintf(stderr, "usage: tmb-texture-pack <dump folder> <pack folder> --esrgan <realesrgan-ncnn-vulkan> [--models <folder>] "
|
||||
"[--model realesrgan-x4plus] [--min-size 32] [--detail 1.0] [--skip SHELL1,FONT] [--jobs N] [--work <folder>]\n");
|
||||
return 2;
|
||||
}
|
||||
const fs::path dump = fs::path(positional[0]), pack = fs::path(positional[1]);
|
||||
if (models.empty())
|
||||
models = esrgan.parent_path() / "models";
|
||||
if (work.empty())
|
||||
work = pack.parent_path() / (pack.filename().string() + ".work");
|
||||
std::vector<std::string> skip;
|
||||
for (std::string s : split(skipList, ','))
|
||||
if (!s.empty())
|
||||
{
|
||||
std::transform(s.begin(), s.end(), s.begin(), [](char c) { return static_cast<char>(std::toupper(static_cast<unsigned char>(c))); });
|
||||
skip.push_back(s.substr(0, s.find('.')));
|
||||
}
|
||||
|
||||
std::ifstream index(dump / "index.tsv");
|
||||
if (!index)
|
||||
{
|
||||
say("error no texture dump in " + dump.string() + " (index.tsv)");
|
||||
return 1;
|
||||
}
|
||||
std::error_code ec;
|
||||
fs::create_directories(pack, ec);
|
||||
fs::remove_all(work, ec);
|
||||
fs::create_directories(work / "in", ec);
|
||||
fs::create_directories(work / "out", ec);
|
||||
|
||||
// ---- the textures to make: padded colour into the model's folder ----
|
||||
say("step prepare");
|
||||
// One row per identity: the dump's parallel runs can each list a texture they all load, and two threads writing
|
||||
// the same file into the model's folder would collide.
|
||||
std::vector<std::string> rows;
|
||||
std::unordered_set<std::string> seen;
|
||||
std::string line;
|
||||
std::getline(index, line); // the header
|
||||
while (std::getline(index, line))
|
||||
{
|
||||
if (!line.empty() && line.back() == '\r')
|
||||
line.pop_back();
|
||||
if (!line.empty() && seen.insert(line.substr(0, line.find('\t'))).second)
|
||||
rows.push_back(line);
|
||||
}
|
||||
std::vector<std::string> todo; // identities (re-read when finished: a whole dump does not stay in memory)
|
||||
std::mutex todoMutex;
|
||||
std::atomic<size_t> next{0}, prepared{0};
|
||||
std::atomic<bool> failed{false};
|
||||
std::string failure;
|
||||
const auto prepare = [&]
|
||||
{
|
||||
for (size_t r; (r = next++) < rows.size();)
|
||||
{
|
||||
const std::vector<std::string> f = split(rows[r], '\t');
|
||||
if (f.size() < 5)
|
||||
continue;
|
||||
const std::string file = f[4].substr(0, f[4].find('#'));
|
||||
const std::string base = file.substr(0, file.find('.'));
|
||||
if (std::find(skip.begin(), skip.end(), base) != skip.end() || std::atoi(f[1].c_str()) < minSize ||
|
||||
std::atoi(f[2].c_str()) < minSize || fs::exists(pack / (f[0] + ".png")))
|
||||
continue;
|
||||
Texture t;
|
||||
std::string why;
|
||||
if (!load(dump, f[0], t, why))
|
||||
continue;
|
||||
const Image padded = wrapPad(t.rgb, kPad);
|
||||
std::vector<uint8_t> bytes(padded.v.size());
|
||||
for (size_t i = 0; i < bytes.size(); ++i)
|
||||
bytes[i] = static_cast<uint8_t>(std::clamp(std::lround(padded.v[i]), 0L, 255L));
|
||||
if (!writePng(work / "in" / (t.identity + ".png"), bytes.data(), padded.w, padded.h, 3))
|
||||
{
|
||||
failed = true;
|
||||
continue;
|
||||
}
|
||||
std::lock_guard<std::mutex> lock(todoMutex);
|
||||
todo.push_back(t.identity);
|
||||
++prepared;
|
||||
}
|
||||
};
|
||||
{
|
||||
std::vector<std::thread> pool;
|
||||
for (unsigned j = 0; j < jobs; ++j)
|
||||
pool.emplace_back(prepare);
|
||||
for (std::thread &t : pool)
|
||||
t.join();
|
||||
}
|
||||
if (failed)
|
||||
{
|
||||
say("error cannot write to " + work.string());
|
||||
return 1;
|
||||
}
|
||||
if (todo.empty())
|
||||
{
|
||||
say("done 0");
|
||||
fs::remove_all(work, ec);
|
||||
return 0;
|
||||
}
|
||||
|
||||
// ---- the model ----
|
||||
say("step upscale");
|
||||
const int code = runEsrgan(esrgan, models, model, work / "in", work / "out", todo.size());
|
||||
if (code != 0)
|
||||
{
|
||||
say("error Real-ESRGAN stopped (exit code " + std::to_string(code) + "): it needs a Vulkan graphics driver");
|
||||
return 1;
|
||||
}
|
||||
|
||||
// ---- the replacements ----
|
||||
say("step finish");
|
||||
next = 0;
|
||||
std::atomic<size_t> finished{0}, errors{0};
|
||||
const auto finishAll = [&]
|
||||
{
|
||||
for (size_t i; (i = next++) < todo.size();)
|
||||
{
|
||||
std::string why;
|
||||
if (!finish(dump, todo[i], work / "out" / (todo[i] + ".png"), pack, detail, why))
|
||||
{
|
||||
++errors;
|
||||
say("warning " + todo[i] + ": " + why);
|
||||
}
|
||||
const size_t n = ++finished;
|
||||
if (n % 16 == 0 || n == todo.size())
|
||||
say("progress " + std::to_string(n) + " " + std::to_string(todo.size()));
|
||||
}
|
||||
};
|
||||
{
|
||||
std::vector<std::thread> pool;
|
||||
for (unsigned j = 0; j < jobs; ++j)
|
||||
pool.emplace_back(finishAll);
|
||||
for (std::thread &t : pool)
|
||||
t.join();
|
||||
}
|
||||
fs::remove_all(work, ec);
|
||||
say("done " + std::to_string(todo.size() - errors));
|
||||
return errors == todo.size() ? 1 : 0;
|
||||
}
|
||||
@@ -0,0 +1,302 @@
|
||||
// tmb: Twisted Metal: Black on BozoEngine in a window, in real time (phase 4, milestones M1 and M2). The free host as
|
||||
// tmb-headless runs it (every library native, the disc image read, TMB's overrides native), with the host's clock: the
|
||||
// game's frames held to the field rate (TMB's native frame end, bozo::app::FramePacer), each one presented in an SDL3
|
||||
// window through OpenGL 3.3 (bozo::app::runWindow). The players' pads: the keyboard, mouse and up to four gamepads
|
||||
// through input.ini's bindings (bozo::app::DevicePad; with the game's multitap, players 2-4 are its slots), or the
|
||||
// frame-keyed scripts given.
|
||||
//
|
||||
// tmb [--iso image] [--elf SCUS_971.01] [--card-dir dir] [--width w --height h] [--fullscreen] [--no-vsync]
|
||||
// [--render-scale s] [--capture-dir dir] [--capture-frames n,n,...] [--quit-after n] [--pad-script [n=]file]...
|
||||
// [--no-sound] [--audio-latency ms] [--audio-stats] [--wav file] [--hidden] [--capture-scene]
|
||||
// [--save-state file --save-state-at n] [--load-state file [--load-state-at n]]
|
||||
//
|
||||
// --hidden: a test run that shows nothing (the window is never shown; --capture-frames reads the game's offscreen
|
||||
// picture). --capture-scene: captures read that picture (no overlays) in a shown window too.
|
||||
//
|
||||
// The user folder (%APPDATA%\TMB_Recomp, as the fork's TMB; PS2X_USER_DIR overrides it) holds input.ini, the memory
|
||||
// cards (mc0, mc1; --card-dir overrides) and the logs (logs/TMB_Recomp.log). Without --elf the game data is looked for
|
||||
// as the fork's TMB did (<exe>/game/SCUS_971.01, then the same in the user folder).
|
||||
//
|
||||
// Milestone M4, as the fork's TMB: F2 the settings window (Controls: input.ini; Video: video.ini in the user folder,
|
||||
// --width / --height / --fullscreen (borderless) / --render-scale over it; Cheats: runtime/tmb_cheats.cpp; Video,
|
||||
// Cheats and Save states also in the game's Options screen, PC SETTINGS: runtime/tmb_menu.cpp), F3 the
|
||||
// frame rate counter (PS2X_SHOW_FPS=1 from the start), F8 a capture sequence (PS2X_CAPTURE_SEQUENCE presents,
|
||||
// PS2X_CAPTURE_SEQUENCE_AT seconds), F9 a burst of captures, ten a second; --capture-frames saves the game's picture at
|
||||
// the first present after each of those game frames. The captures go to --capture-dir, else PS2X_CAPTURE_WINDOW_DIR,
|
||||
// else <user folder>/captures. F11 / Alt+Enter: between the window and the last full-screen mode. --quit-after: close
|
||||
// after that many frames. PS2X_FRAME_STATS=1: the frames' work times every 2 s (the FramePacer).
|
||||
//
|
||||
// Sound (milestone M3): the mixer's samples, made on the EE clock at each frame's end, go to the default playback device
|
||||
// (bozo::app::AudioDevice: a queue of --audio-latency ms, 32 by default, plus the device's buffer). --audio-stats: the
|
||||
// queue, latency and underruns every 2 s. --wav (or PS2X_AUDIO_RECORD): what the mixer made, also to a WAV file.
|
||||
#include "tmb_state.h"
|
||||
#include "tmb_host.h"
|
||||
#include "tmb_menu.h"
|
||||
#include "tmb_port.h"
|
||||
|
||||
#include "bozo/app/app.h"
|
||||
#include "bozo/app/audio_device.h"
|
||||
#include "bozo/app/determinism.h"
|
||||
#include "bozo/audio/wav.h"
|
||||
#include "bozo/app/device_pad.h"
|
||||
#include "bozo/app/input_bindings.h"
|
||||
#include "bozo/app/panel.h"
|
||||
#include "bozo/app/video_settings.h"
|
||||
#include "bozo/app/window.h"
|
||||
#include "bozo/ee/dispatcher.h"
|
||||
#include "bozo/host/free_host.h"
|
||||
#include "tmb_scene.h"
|
||||
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <filesystem>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
|
||||
#ifndef BOZO_RUN_DEFAULT_ELF
|
||||
#define BOZO_RUN_DEFAULT_ELF ""
|
||||
#endif
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
// The fork's TMB identity (its PS2X_APP_* CMake values): the same user folder, so the cards and input.ini carry over.
|
||||
bozo::app::Identity identity;
|
||||
identity.title = "Twisted Metal: Black";
|
||||
identity.folder = "TMB_Recomp";
|
||||
identity.xdgFolder = "tmb_recomp";
|
||||
identity.bootElf = "SCUS_971.01";
|
||||
identity.dataFolder = "game";
|
||||
bozo::app::setIdentity(identity);
|
||||
bozo::app::startLogging();
|
||||
bozo::app::installCrashHandler();
|
||||
|
||||
bozo::host::FreeOptions opt;
|
||||
opt.elf = BOZO_RUN_DEFAULT_ELF;
|
||||
opt.realTime = true;
|
||||
opt.quiet = true;
|
||||
bozo::app::WindowOptions window;
|
||||
window.title = "Twisted Metal: Black (BozoEngine)";
|
||||
bozo::app::AudioOptions audio;
|
||||
bool sound = true;
|
||||
std::string wavPath;
|
||||
if (const char *record = std::getenv("PS2X_AUDIO_RECORD"); record && *record)
|
||||
wavPath = record;
|
||||
// The command line's window options, over video.ini (applied once the user folder is known, below).
|
||||
int width = 0, height = 0;
|
||||
bool fullscreen = false;
|
||||
float renderScale = 0.0f;
|
||||
for (int k = 1; k < argc; ++k)
|
||||
{
|
||||
const std::string a = argv[k];
|
||||
auto value = [&]() -> std::string { return k + 1 < argc ? argv[++k] : ""; };
|
||||
if (a == "--elf")
|
||||
opt.elf = value();
|
||||
else if (a == "--iso")
|
||||
opt.iso = value();
|
||||
else if (a == "--card-dir")
|
||||
opt.cardDir = value();
|
||||
else if (a == "--pad-script")
|
||||
{
|
||||
// [n=]file: player n's script (1 when omitted; players 2-4: the multitap's slots)
|
||||
std::string v = value();
|
||||
int player = 1;
|
||||
if (v.size() > 2 && v[1] == '=' && v[0] >= '1' && v[0] <= '4')
|
||||
{
|
||||
player = v[0] - '0';
|
||||
v = v.substr(2);
|
||||
}
|
||||
(player == 1 ? opt.padScript : opt.playerScripts[static_cast<size_t>(player - 2)]) = v;
|
||||
}
|
||||
else if (a == "--width")
|
||||
width = std::stoi(value());
|
||||
else if (a == "--height")
|
||||
height = std::stoi(value());
|
||||
else if (a == "--fullscreen")
|
||||
fullscreen = true;
|
||||
else if (a == "--no-vsync")
|
||||
window.vsync = false;
|
||||
else if (a == "--render-scale")
|
||||
renderScale = std::stof(value());
|
||||
else if (a == "--capture-dir")
|
||||
window.captureDir = value();
|
||||
else if (a == "--capture-frames")
|
||||
{
|
||||
std::stringstream list(value());
|
||||
for (std::string item; std::getline(list, item, ',');)
|
||||
if (!item.empty())
|
||||
window.captureFrames.push_back(std::stoull(item));
|
||||
}
|
||||
else if (a == "--hidden")
|
||||
window.hidden = true; // a test run that shows nothing: captures read the game's offscreen picture
|
||||
else if (a == "--capture-scene")
|
||||
window.captureScene = true; // captures read the game's picture (no overlays) even in a shown window
|
||||
else if (a == "--quit-after")
|
||||
window.quitAfterFrames = std::stoull(value());
|
||||
else if (a == "--print")
|
||||
opt.printGameOutput = true;
|
||||
else if (a == "--no-sound")
|
||||
sound = false;
|
||||
else if (a == "--audio-latency")
|
||||
audio.latencyMs = std::stod(value());
|
||||
else if (a == "--audio-stats")
|
||||
audio.stats = true;
|
||||
else if (a == "--wav")
|
||||
wavPath = value();
|
||||
else if (a == "--save-state")
|
||||
opt.saveState = value();
|
||||
else if (a == "--save-state-at")
|
||||
opt.saveStateFrame = static_cast<uint32_t>(std::stoull(value()));
|
||||
else if (a == "--load-state")
|
||||
opt.loadState = value();
|
||||
else if (a == "--load-state-at")
|
||||
opt.loadStateFrame = static_cast<uint32_t>(std::stoull(value()));
|
||||
else
|
||||
{
|
||||
std::fprintf(stderr, "usage: tmb [--iso image] [--elf path] [--card-dir dir] [--width w] [--height h] [--fullscreen] "
|
||||
"[--no-vsync] [--render-scale s] [--capture-dir dir] [--capture-frames n,n,...] [--quit-after n] [--hidden] [--capture-scene] "
|
||||
"[--pad-script [n=]file]... [--print] [--no-sound] [--audio-latency ms] [--audio-stats] [--wav file] "
|
||||
"[--save-state file --save-state-at n] [--load-state file [--load-state-at n]]\n");
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
// The window as the player set it (video.ini in the user folder, the fork's file; PS2X_WINDOW_SIZE / _MODE,
|
||||
// PS2X_RENDER_SCALE over it), then the command line over both.
|
||||
bozo::app::video::loadAtStartup(window.width, window.height);
|
||||
{
|
||||
bozo::app::video::Settings &v = bozo::app::video::edited();
|
||||
if (width > 0 && height > 0)
|
||||
v.width = width, v.height = height;
|
||||
if (fullscreen)
|
||||
v.mode = bozo::app::video::WindowMode::Borderless;
|
||||
if (renderScale > 0.0f)
|
||||
v.renderScale = renderScale;
|
||||
}
|
||||
window.videoSettings = true;
|
||||
std::error_code ec;
|
||||
if (opt.elf.empty() || !std::filesystem::is_regular_file(opt.elf, ec))
|
||||
{
|
||||
std::string searched;
|
||||
const std::filesystem::path found = bozo::app::findGameData(&searched);
|
||||
if (found.empty())
|
||||
{
|
||||
std::fprintf(stderr, "tmb: no ELF (--elf); looked for the game data at\n%s", searched.c_str());
|
||||
return 2;
|
||||
}
|
||||
opt.elf = found.string();
|
||||
}
|
||||
// The memory cards in the user folder (<user>/mc0, mc1: the fork's layout, its saves read as they are).
|
||||
if (opt.cardDir.empty() && !bozo::app::userDirectory().empty())
|
||||
opt.cardDir = bozo::app::userDirectory().string();
|
||||
tmb::host::setElfDirectory(std::filesystem::path(opt.elf).parent_path().string());
|
||||
if (opt.iso.empty())
|
||||
opt.iso = tmb::findDiscImage(std::filesystem::path(opt.elf).parent_path().string(), "SCUS_971.01");
|
||||
if (opt.iso.empty())
|
||||
{
|
||||
std::fprintf(stderr, "tmb: no disc image (--iso, TMB_ISO, or an .iso beside the ELF)\n");
|
||||
return 2;
|
||||
}
|
||||
// Real time: the host's clock reaches the game (frame steps, the EE charged the real time a frame took).
|
||||
bozo::det::setEnabled(false);
|
||||
|
||||
const bozo::port::Port *port = bozo::port::port();
|
||||
bozo::port::Registry registry;
|
||||
port->install(registry);
|
||||
const std::vector<uint32_t> missing = bozo::port::undeclared(registry, tmb_external_table, tmb_external_count);
|
||||
if (!missing.empty())
|
||||
{
|
||||
std::fprintf(stderr, "%zu registered overrides are not externals of the generated code (regenerate)\n", missing.size());
|
||||
return 2;
|
||||
}
|
||||
|
||||
opt.gameTag = "SCUS-97101";
|
||||
bozo::host::FreeHost host(opt);
|
||||
bozo::ee::Dispatcher d(host);
|
||||
// Save states (BozoEngine/docs/save-states.md): TMB's section, F5 save, F7 load, F6 / Shift+F6 the slot, the F2 tab.
|
||||
tmb::addStateSection(host, &d.runtime());
|
||||
host.onStateMessage = [](bool, const std::string &message)
|
||||
{
|
||||
std::fprintf(stderr, "[state] %s\n", message.c_str());
|
||||
bozo::app::notify(message);
|
||||
};
|
||||
d.setFunctions(tmb_function_table, tmb_function_count, tmb_resume_table, tmb_resume_count);
|
||||
std::string error;
|
||||
if (!host.setUp(d, tmb_external_table, tmb_external_count, ®istry, error))
|
||||
{
|
||||
std::fprintf(stderr, "tmb: %s\n", error.c_str());
|
||||
return 2;
|
||||
}
|
||||
bozo::app::DevicePad pad;
|
||||
bool scripted = !opt.padScript.empty();
|
||||
for (const std::string &script : opt.playerScripts)
|
||||
scripted = scripted || !script.empty();
|
||||
if (!scripted)
|
||||
host.libraries().pad.input = &pad;
|
||||
const std::string pads = scripted ? std::string("the scripts") : "the PC's devices (" + bozo::app::input::configPath() + ")";
|
||||
std::fprintf(stderr, "tmb: user folder %s, memory cards in %s, pads from %s\n", bozo::app::userDirectory().string().c_str(),
|
||||
opt.cardDir.empty() ? "memory" : opt.cardDir.c_str(), pads.c_str());
|
||||
std::fprintf(stderr, "tmb: %s, %zu overrides, ELF %s, disc %s\n", port->title, registry.functions().size(), opt.elf.c_str(),
|
||||
opt.iso.c_str());
|
||||
|
||||
// The sound: what the mixer makes at each frame's end, to the device (and the WAV file).
|
||||
bozo::app::AudioDevice device(audio);
|
||||
bozo::audio::WavWriter wav;
|
||||
if (!wavPath.empty() && !wav.open(wavPath))
|
||||
std::fprintf(stderr, "tmb: cannot write %s\n", wavPath.c_str());
|
||||
if (sound)
|
||||
device.open();
|
||||
if (device.isOpen() || wav.isOpen())
|
||||
host.onAudio = [&](uint64_t, const int16_t *samples, size_t count) {
|
||||
device.push(samples, count);
|
||||
wav.write(samples, count);
|
||||
};
|
||||
|
||||
bozo::app::Game game;
|
||||
game.run = [&]
|
||||
{
|
||||
tmb::scene::Binding scene(&d.runtime());
|
||||
const uint64_t frames = host.run();
|
||||
if (device.isOpen())
|
||||
{
|
||||
const bozo::app::AudioDevice::Stats a = device.stats();
|
||||
std::fprintf(stderr, "tmb: sound: %.1f s pushed, %llu frames dropped, %llu underruns (%.1f ms of silence); queue %.1f ms "
|
||||
"(%.1f-%.1f) + device %.1f ms; ratio %.4f\n",
|
||||
a.pushed / 48000.0, static_cast<unsigned long long>(a.dropped), static_cast<unsigned long long>(a.underruns),
|
||||
a.missing / 48.0, a.queueMs, a.minQueueMs, a.maxQueueMs, a.deviceMs, a.ratio);
|
||||
device.close();
|
||||
}
|
||||
wav.close();
|
||||
std::fprintf(stderr, "tmb: the game ended after %llu frames: %s\n", static_cast<unsigned long long>(frames),
|
||||
host.endReason().empty() ? "every thread ended" : host.endReason().c_str());
|
||||
return host.endReason().rfind("FAULT", 0) == 0 ? 1 : 0;
|
||||
};
|
||||
game.stop = [&] { host.requestStop(); };
|
||||
game.framesEnded = [&] { return host.framesEnded(); };
|
||||
game.saveState = [&](int slot) { host.requestSave(bozo::app::stateSlotPath(slot)); };
|
||||
game.loadState = [&](int slot) { host.requestLoad(bozo::app::stateSlotPath(slot)); };
|
||||
|
||||
// PC SETTINGS in the game's Options screen (runtime/tmb_menu.cpp): the window's video settings and save states.
|
||||
tmb::menu::Hooks menuHooks;
|
||||
menuHooks.videoShared = [] { return bozo::app::video::shared(); };
|
||||
menuHooks.videoApply = [](const bozo::app::video::Settings &s) { bozo::app::video::post(s, true); };
|
||||
menuHooks.texturePackFolder = [](const std::string &s) { return bozo::app::video::texturePackFolder(s); };
|
||||
menuHooks.stateSlot = [] { return bozo::app::stateSlot(); };
|
||||
menuHooks.setStateSlot = [](int slot) { bozo::app::setStateSlot(slot); };
|
||||
menuHooks.slotSummary = [](int slot) { return bozo::app::stateSlotSummary(slot); };
|
||||
menuHooks.saveState = [&](int slot)
|
||||
{
|
||||
host.requestSave(bozo::app::stateSlotPath(slot));
|
||||
bozo::app::captureStatePicture(slot); // the slot's picture, as F5 takes it
|
||||
return true;
|
||||
};
|
||||
menuHooks.loadState = [&](int slot)
|
||||
{
|
||||
host.requestLoad(bozo::app::stateSlotPath(slot));
|
||||
return true;
|
||||
};
|
||||
menuHooks.quit = [&] { host.requestStop(); };
|
||||
menuHooks.widescreen = [] { return bozo::app::video::shared().applied.widescreen; };
|
||||
menuHooks.setPictureAspect = [](float aspect) { bozo::app::setPictureAspect(aspect); };
|
||||
bozo::app::video::offerWidescreen(true); // runtime/tmb_widescreen.cpp
|
||||
tmb::menu::setHooks(std::move(menuHooks));
|
||||
return bozo::app::runWindow(window, game, &pad);
|
||||
}
|
||||
@@ -0,0 +1,318 @@
|
||||
# TMB on BozoEngine (phase 4, BozoEngine's docs/phase4-inventory.md): TMB's runtime/ built against BozoEngine instead
|
||||
# of the PS2Recomp fork. Milestone M0: headless; M1: the window (tmb), the packs built from the disc.
|
||||
#
|
||||
# cmake -S . -B build/bozo -G Ninja -DBOZO_ENGINE_DIR=<BozoEngine> -DTMB_ELF=<SCUS_971.01>
|
||||
# -DTMB_ISO=<the disc image> [-DBOZO_FFMPEG_ROOT=<kit>/ffmpeg] [-DTMB_WINDOW=OFF]
|
||||
#
|
||||
# Targets:
|
||||
# - tmb: the game in a window, in real time (SDL3, OpenGL 3.3: BozoEngine's bozo_app; TMB_WINDOW, on by default).
|
||||
# - tmb_packs: the texture and mesh packs (tools/tmb_texture_pack.py, tools/tmb_mesh_pack.py on BozoEngine's
|
||||
# tools/native_pack) from the disc image's files, into <build>/packs; the runtime's built-in pack paths point there.
|
||||
# - tmb-headless: the game on BozoEngine with no window (the free host: every library native, the disc image read,
|
||||
# BozoEngine's own timing); it reports the frames and the game's state.
|
||||
# - tmb-check: BozoEngine's call-log checker (bozo-run, tools/run/README.md) with TMB's overrides running natively:
|
||||
# tmb-check <log.clg> --pinned --ref <run.ref> ...
|
||||
#
|
||||
# The generated code: bozo-recomp with the externals bozo-externals writes from the ELF (the stubs BozoEngine answers),
|
||||
# recomp/tmb_stubs.txt and TMB's override list (tools/tmb_overrides_list.py, from runtime/*.cpp).
|
||||
|
||||
# BozoEngine: the release cmake/bozo_engine.json pins, fetched into BozoEngine/ (cmake/bozo_engine_fetch.cmake), unless
|
||||
# BOZO_ENGINE_DIR names another tree (development: a BozoEngine checkout).
|
||||
set(BOZO_ENGINE_DIR "" CACHE PATH "BozoEngine's source tree (default: the release cmake/bozo_engine.json pins, in BozoEngine/)")
|
||||
if(NOT BOZO_ENGINE_DIR OR BOZO_ENGINE_DIR STREQUAL "${CMAKE_SOURCE_DIR}/BozoEngine")
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/bozo_engine_fetch.cmake")
|
||||
set(BOZO_ENGINE_DIR "${bozo_engine_tree}")
|
||||
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${CMAKE_CURRENT_LIST_DIR}/bozo_engine.json")
|
||||
endif()
|
||||
set(TMB_ELF "" CACHE FILEPATH "TMB's executable (SCUS_971.01), extracted from the disc")
|
||||
set(TMB_GEN_FILES 32 CACHE STRING "How many .cpp files the generated code is split into")
|
||||
set(TMB_GEN_OPT "-O1" CACHE STRING "Optimisation of the generated code")
|
||||
if(WIN32)
|
||||
enable_language(RC)
|
||||
set_source_files_properties("${CMAKE_SOURCE_DIR}/runtime/app/utf8.rc" PROPERTIES
|
||||
OBJECT_DEPENDS "${CMAKE_SOURCE_DIR}/runtime/app/tmb.manifest")
|
||||
endif()
|
||||
function(tmb_native_manifest target)
|
||||
if(WIN32)
|
||||
target_sources(${target} PRIVATE "${CMAKE_SOURCE_DIR}/runtime/app/utf8.rc")
|
||||
endif()
|
||||
endfunction()
|
||||
set(TMB_ISO "" CACHE FILEPATH "TMB's disc image (the packs are built from its files)")
|
||||
set(TMB_DISC_DIR "" CACHE PATH "The packs' files already extracted from the disc (tools/tmb_build.py: <dir>/.extracted marks them done); else read from TMB_ISO here")
|
||||
option(TMB_WINDOW "Build tmb, the game in a window (BozoEngine's bozo_app: SDL3, OpenGL 3.3)" ON)
|
||||
if(NOT BOZO_ENGINE_DIR OR NOT EXISTS "${BOZO_ENGINE_DIR}/CMakeLists.txt")
|
||||
message(FATAL_ERROR "TMB: set BOZO_ENGINE_DIR to BozoEngine's source tree")
|
||||
endif()
|
||||
if(NOT TMB_ELF OR NOT EXISTS "${TMB_ELF}")
|
||||
message(FATAL_ERROR "TMB: set TMB_ELF to the game's executable (SCUS_971.01)")
|
||||
endif()
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
if(NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE Release)
|
||||
endif()
|
||||
|
||||
# BozoEngine's own TMB generation (its call-log checks) is not wanted here: TMB generates its own.
|
||||
set(BOZO_TMB_ELF "" CACHE FILEPATH "" FORCE)
|
||||
set(BOZO_APP ${TMB_WINDOW} CACHE BOOL "" FORCE)
|
||||
add_subdirectory("${BOZO_ENGINE_DIR}" bozo)
|
||||
|
||||
find_package(Python3 REQUIRED COMPONENTS Interpreter)
|
||||
|
||||
set(gen_dir "${CMAKE_BINARY_DIR}/tmb_gen")
|
||||
set(native_original_dir "${CMAKE_BINARY_DIR}/native_original")
|
||||
set(overrides_list "${gen_dir}/tmb_overrides.txt")
|
||||
set(externals "${gen_dir}/tmb_externals.txt")
|
||||
file(GLOB TMB_RUNTIME_SOURCES CONFIGURE_DEPENDS "${CMAKE_SOURCE_DIR}/runtime/*.cpp")
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${overrides_list}
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${gen_dir}
|
||||
COMMAND Python3::Interpreter "${CMAKE_SOURCE_DIR}/tools/tmb_overrides_list.py" "${CMAKE_SOURCE_DIR}/runtime" ${overrides_list}
|
||||
DEPENDS "${CMAKE_SOURCE_DIR}/tools/tmb_overrides_list.py" ${TMB_RUNTIME_SOURCES}
|
||||
COMMENT "Listing TMB's overrides")
|
||||
add_custom_command(
|
||||
OUTPUT ${externals}
|
||||
COMMAND bozo-externals ${TMB_ELF} ${externals} --overrides ${overrides_list} --stubs "${CMAKE_SOURCE_DIR}/recomp/tmb_stubs.txt"
|
||||
DEPENDS bozo-externals ${overrides_list} "${CMAKE_SOURCE_DIR}/recomp/tmb_stubs.txt" ${TMB_ELF}
|
||||
COMMENT "Writing the externals list")
|
||||
|
||||
set(gen_files ${gen_dir}/tmb_functions.h ${gen_dir}/tmb_table.cpp)
|
||||
math(EXPR last "${TMB_GEN_FILES} - 1")
|
||||
foreach(i RANGE ${last})
|
||||
string(LENGTH "${i}" len)
|
||||
if(len EQUAL 1)
|
||||
set(n "00${i}")
|
||||
elseif(len EQUAL 2)
|
||||
set(n "0${i}")
|
||||
else()
|
||||
set(n "${i}")
|
||||
endif()
|
||||
list(APPEND gen_files ${gen_dir}/tmb_${n}.cpp)
|
||||
endforeach()
|
||||
add_custom_command(
|
||||
OUTPUT ${gen_files}
|
||||
COMMAND bozo-recomp ${TMB_ELF} ${gen_dir} --prefix tmb --files ${TMB_GEN_FILES} --no-comments --externals ${externals}
|
||||
DEPENDS bozo-recomp ${externals} ${TMB_ELF}
|
||||
COMMENT "Recompiling TMB")
|
||||
# The generated code alone (tools/tmb_build.py's recompile step, before the compile).
|
||||
add_custom_target(tmb_recompile DEPENDS ${gen_files})
|
||||
add_library(tmb_generated OBJECT ${gen_files})
|
||||
add_custom_command(
|
||||
OUTPUT ${native_original_dir}/tmb_hud_original.cpp ${native_original_dir}/tmb_hud_original.h
|
||||
COMMAND Python3::Interpreter "${CMAKE_SOURCE_DIR}/tools/tmb_hud_fixture.py" ${gen_dir} hud ${native_original_dir}
|
||||
DEPENDS ${gen_files} "${CMAKE_SOURCE_DIR}/tools/tmb_hud_fixture.py"
|
||||
COMMENT "Extracting original HUD blocks for optional comparisons")
|
||||
target_sources(tmb_generated PRIVATE ${native_original_dir}/tmb_hud_original.cpp ${native_original_dir}/tmb_hud_original.h)
|
||||
add_custom_command(
|
||||
OUTPUT ${native_original_dir}/tmb_vehicle_original.cpp ${native_original_dir}/tmb_vehicle_original.h
|
||||
COMMAND Python3::Interpreter "${CMAKE_SOURCE_DIR}/tools/tmb_hud_fixture.py" ${gen_dir} vehicle ${native_original_dir}
|
||||
DEPENDS ${gen_files} "${CMAKE_SOURCE_DIR}/tools/tmb_hud_fixture.py"
|
||||
COMMENT "Extracting original vehicle blocks for optional comparisons")
|
||||
target_sources(tmb_generated PRIVATE ${native_original_dir}/tmb_vehicle_original.cpp ${native_original_dir}/tmb_vehicle_original.h)
|
||||
add_custom_command(
|
||||
OUTPUT ${native_original_dir}/tmb_contact_original.cpp ${native_original_dir}/tmb_contact_original.h
|
||||
COMMAND Python3::Interpreter "${CMAKE_SOURCE_DIR}/tools/tmb_hud_fixture.py" ${gen_dir} contact ${native_original_dir}
|
||||
DEPENDS ${gen_files} "${CMAKE_SOURCE_DIR}/tools/tmb_hud_fixture.py"
|
||||
COMMENT "Extracting original terrain/contact blocks for optional comparisons")
|
||||
target_sources(tmb_generated PRIVATE ${native_original_dir}/tmb_contact_original.cpp ${native_original_dir}/tmb_contact_original.h)
|
||||
target_link_libraries(tmb_generated PUBLIC bozo_runtime_headers)
|
||||
target_include_directories(tmb_generated PUBLIC ${gen_dir} ${native_original_dir})
|
||||
target_compile_options(tmb_generated PRIVATE ${TMB_GEN_OPT} -w)
|
||||
|
||||
# TMB's runtime: an object library (its port registration, BOZO_PORT, must be linked whatever references it).
|
||||
add_library(tmb_runtime OBJECT ${TMB_RUNTIME_SOURCES})
|
||||
target_include_directories(tmb_runtime PUBLIC "${CMAKE_SOURCE_DIR}/runtime" ${gen_dir} ${native_original_dir})
|
||||
target_link_libraries(tmb_runtime PUBLIC bozo_port bozo_render bozo_libs bozo_runtime_core)
|
||||
# The Cheats tab of the settings window (F2): ImGui's core and the tab list (bozo_ui, no SDL3; BOZO_SETTINGS_UI), with
|
||||
# the window. The headless programs link it too and never draw it.
|
||||
if(TMB_WINDOW)
|
||||
target_link_libraries(tmb_runtime PUBLIC bozo_ui)
|
||||
endif()
|
||||
add_dependencies(tmb_runtime tmb_generated)
|
||||
set_source_files_properties("${CMAKE_SOURCE_DIR}/runtime/tmb_native_math.cpp" "${CMAKE_SOURCE_DIR}/runtime/tmb_projection_math.cpp" "${CMAKE_SOURCE_DIR}/runtime/tmb_hud_math.cpp" "${CMAKE_SOURCE_DIR}/runtime/tmb_vehicle_math.cpp" "${CMAKE_SOURCE_DIR}/runtime/tmb_hierarchy_math.cpp" "${CMAKE_SOURCE_DIR}/runtime/tmb_scene.cpp" PROPERTIES
|
||||
COMPILE_OPTIONS "-ffp-contract=off;-frounding-math")
|
||||
set_source_files_properties("${CMAKE_SOURCE_DIR}/runtime/tmb_contact_math.cpp" PROPERTIES
|
||||
COMPILE_OPTIONS "-ffp-contract=off;-frounding-math")
|
||||
target_compile_options(tmb_runtime PRIVATE -Wall -Wno-unused-function -Wno-unused-variable -Wno-unused-but-set-variable)
|
||||
# The draw lists as the reference build (the fork) computed them (the PS2XREF1 `draws` field): it compiled TMB's runtime
|
||||
# at -O2 (its RelWithDebInfo flags) and its native renderer library at -O3 (Release), both for AVX2 with FMA, and GCC
|
||||
# fuses a * b + c there (-ffp-contract=fast, its default outside ISO mode) where its inlining lets it. The matrices and
|
||||
# vertices TMB and the mesh submitter (BozoEngine's render/mesh_draw.cpp, moved from the fork) compute for the draws are
|
||||
# those fused results, so the same flags here give the same draws (match1p: every frame; -O3 for the runtime or no FMA:
|
||||
# the first difference within ten frames of the match's start). Nothing the game computes depends on them (the
|
||||
# generated code and BozoEngine's libraries keep their own flags). A CPU without FMA (before 2013's Haswell, 2011's
|
||||
# Bulldozer) cannot run it, as it could not run the fork's.
|
||||
set(TMB_RUNTIME_ARCH "-mavx2;-mfma" CACHE STRING "Instruction set flags of TMB's runtime and the renderer (the reference build's)")
|
||||
set(TMB_RUNTIME_OPT "-O2" CACHE STRING "Optimisation of TMB's runtime (the reference build's)")
|
||||
target_compile_options(tmb_runtime PRIVATE ${TMB_RUNTIME_ARCH} ${TMB_RUNTIME_OPT})
|
||||
target_compile_options(bozo_render PRIVATE ${TMB_RUNTIME_ARCH})
|
||||
# The packs: from the disc image's files (only those they read: .TEX, .RTX, .NGP, .PTR), into the build folder; with
|
||||
# TMB_DISC_DIR, from files already extracted there (tools/tmb_build.py). Both paths build the packs locally.
|
||||
if(TMB_ISO OR TMB_DISC_DIR)
|
||||
set(pack_dir "${CMAKE_BINARY_DIR}/packs")
|
||||
set(disc_dir "${CMAKE_BINARY_DIR}/disc")
|
||||
set(native_pack "${BOZO_ENGINE_DIR}/tools/native_pack")
|
||||
file(GLOB native_pack_sources CONFIGURE_DEPENDS "${native_pack}/*.py")
|
||||
if(TMB_DISC_DIR)
|
||||
set(disc_dir "${TMB_DISC_DIR}")
|
||||
else()
|
||||
add_custom_command(
|
||||
OUTPUT "${disc_dir}/.extracted"
|
||||
COMMAND Python3::Interpreter "${native_pack}/ps2_disc.py" extract "${TMB_ISO}" "${disc_dir}" --ext .TEX,.RTX,.NGP,.PTR
|
||||
COMMAND ${CMAKE_COMMAND} -E touch "${disc_dir}/.extracted"
|
||||
DEPENDS "${TMB_ISO}" "${native_pack}/ps2_disc.py"
|
||||
COMMENT "Reading the packs' files from the disc image")
|
||||
endif()
|
||||
add_custom_command(
|
||||
OUTPUT "${pack_dir}/tmb_textures.pack"
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory "${pack_dir}"
|
||||
COMMAND ${CMAKE_COMMAND} -E env "BOZO_ENGINE_TOOLS=${BOZO_ENGINE_DIR}/tools"
|
||||
"${Python3_EXECUTABLE}" "${CMAKE_SOURCE_DIR}/tools/tmb_texture_pack.py" "${disc_dir}" "${TMB_ELF}" "${pack_dir}/tmb_textures.pack"
|
||||
DEPENDS "${disc_dir}/.extracted" "${CMAKE_SOURCE_DIR}/tools/tmb_texture_pack.py" ${native_pack_sources} "${TMB_ELF}"
|
||||
COMMENT "Building the texture pack")
|
||||
add_custom_command(
|
||||
OUTPUT "${pack_dir}/tmb_meshes.pack"
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory "${pack_dir}"
|
||||
COMMAND ${CMAKE_COMMAND} -E env "BOZO_ENGINE_TOOLS=${BOZO_ENGINE_DIR}/tools"
|
||||
"${Python3_EXECUTABLE}" "${CMAKE_SOURCE_DIR}/tools/tmb_mesh_pack.py" "${disc_dir}" "${pack_dir}/tmb_meshes.pack"
|
||||
DEPENDS "${disc_dir}/.extracted" "${CMAKE_SOURCE_DIR}/tools/tmb_mesh_pack.py" ${native_pack_sources}
|
||||
COMMENT "Building the mesh pack")
|
||||
add_custom_target(tmb_packs ALL DEPENDS "${pack_dir}/tmb_textures.pack" "${pack_dir}/tmb_meshes.pack")
|
||||
add_dependencies(tmb_runtime tmb_packs)
|
||||
else()
|
||||
message(FATAL_ERROR "Set TMB_ISO or TMB_DISC_DIR to build the native texture and mesh packs")
|
||||
endif()
|
||||
target_compile_definitions(tmb_runtime PRIVATE TMB_TEXTURE_PACK="${pack_dir}/tmb_textures.pack"
|
||||
TMB_MESH_PACK="${pack_dir}/tmb_meshes.pack")
|
||||
|
||||
if(TARGET bozo_run)
|
||||
add_executable(tmb-check bozo/tmb_check.cpp)
|
||||
tmb_native_manifest(tmb-check)
|
||||
target_link_libraries(tmb-check PRIVATE tmb_runtime tmb_generated bozo_run)
|
||||
target_compile_definitions(tmb-check PRIVATE BOZO_RUN_DEFAULT_ELF="${TMB_ELF}")
|
||||
# --window: the pinned run shown in BozoEngine's window, its chosen frames captured (milestone M5's pictures).
|
||||
if(TMB_WINDOW)
|
||||
target_link_libraries(tmb-check PRIVATE bozo_app)
|
||||
target_compile_definitions(tmb-check PRIVATE TMB_CHECK_WINDOW=1)
|
||||
endif()
|
||||
if(MINGW)
|
||||
target_link_options(tmb-check PRIVATE -static -Wl,--stack,268435456)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
add_executable(tmb-headless bozo/tmb_headless.cpp)
|
||||
tmb_native_manifest(tmb-headless)
|
||||
target_link_libraries(tmb-headless PRIVATE tmb_runtime tmb_generated bozo_host)
|
||||
target_compile_definitions(tmb-headless PRIVATE BOZO_RUN_DEFAULT_ELF="${TMB_ELF}")
|
||||
|
||||
# The launcher's "Enhance textures" step (tools/tmb_texture_enhance.py): a texture dump made into a replacement pack with
|
||||
# Real-ESRGAN, on the player's PC (docs/TEXTURE_UPSCALING.md). Reads PNGs with BozoEngine's reader; no other dependency.
|
||||
add_executable(tmb-texture-pack bozo/tmb_texture_pack.cpp)
|
||||
tmb_native_manifest(tmb-texture-pack)
|
||||
target_link_libraries(tmb-texture-pack PRIVATE bozo_render)
|
||||
target_compile_options(tmb-texture-pack PRIVATE -Wall -Wextra)
|
||||
if(MINGW)
|
||||
target_link_options(tmb-texture-pack PRIVATE -static)
|
||||
endif()
|
||||
|
||||
# Explicit target: exact native matrix/ABI checks against the owner's generated leaf functions. No disc or game run.
|
||||
add_executable(tmb-native-math-tests EXCLUDE_FROM_ALL tests/native_math_tests.cpp tests/native_direction_callers.cpp)
|
||||
target_include_directories(tmb-native-math-tests PRIVATE "${CMAKE_SOURCE_DIR}/runtime" ${gen_dir})
|
||||
target_compile_options(tmb-native-math-tests PRIVATE -ffp-contract=off -frounding-math)
|
||||
target_link_libraries(tmb-native-math-tests PRIVATE tmb_runtime tmb_generated bozo_host)
|
||||
if(MINGW)
|
||||
target_link_options(tmb-native-math-tests PRIVATE -static -Wl,--stack,268435456)
|
||||
endif()
|
||||
add_executable(tmb-native-hud-tests EXCLUDE_FROM_ALL tests/native_hud_tests.cpp)
|
||||
target_include_directories(tmb-native-hud-tests PRIVATE "${CMAKE_SOURCE_DIR}/runtime" ${gen_dir})
|
||||
target_compile_options(tmb-native-hud-tests PRIVATE -ffp-contract=off -frounding-math)
|
||||
target_link_libraries(tmb-native-hud-tests PRIVATE tmb_runtime tmb_generated bozo_host)
|
||||
if(MINGW)
|
||||
target_link_options(tmb-native-hud-tests PRIVATE -static -Wl,--stack,268435456)
|
||||
endif()
|
||||
add_executable(tmb-native-particle-tests EXCLUDE_FROM_ALL tests/native_particle_tests.cpp)
|
||||
target_include_directories(tmb-native-particle-tests PRIVATE "${CMAKE_SOURCE_DIR}/runtime" ${gen_dir})
|
||||
target_link_libraries(tmb-native-particle-tests PRIVATE tmb_runtime tmb_generated bozo_host)
|
||||
if(MINGW)
|
||||
target_link_options(tmb-native-particle-tests PRIVATE -static -Wl,--stack,268435456)
|
||||
endif()
|
||||
add_executable(tmb-native-vehicle-tests EXCLUDE_FROM_ALL tests/native_vehicle_tests.cpp)
|
||||
target_include_directories(tmb-native-vehicle-tests PRIVATE "${CMAKE_SOURCE_DIR}/runtime" ${gen_dir})
|
||||
target_compile_options(tmb-native-vehicle-tests PRIVATE -ffp-contract=off -frounding-math)
|
||||
target_link_libraries(tmb-native-vehicle-tests PRIVATE tmb_runtime tmb_generated bozo_host)
|
||||
if(MINGW)
|
||||
target_link_options(tmb-native-vehicle-tests PRIVATE -static -Wl,--stack,268435456)
|
||||
endif()
|
||||
add_executable(tmb-native-hierarchy-tests EXCLUDE_FROM_ALL tests/native_hierarchy_tests.cpp tests/native_hierarchy_callers.cpp)
|
||||
target_include_directories(tmb-native-hierarchy-tests PRIVATE "${CMAKE_SOURCE_DIR}/runtime" ${gen_dir})
|
||||
target_compile_options(tmb-native-hierarchy-tests PRIVATE -ffp-contract=off -frounding-math)
|
||||
target_link_libraries(tmb-native-hierarchy-tests PRIVATE tmb_runtime tmb_generated bozo_host)
|
||||
if(MINGW)
|
||||
target_link_options(tmb-native-hierarchy-tests PRIVATE -static -Wl,--stack,268435456)
|
||||
endif()
|
||||
add_executable(tmb-native-contact-tests EXCLUDE_FROM_ALL tests/native_contact_tests.cpp tests/native_sphere_lod_callers.cpp)
|
||||
target_include_directories(tmb-native-contact-tests PRIVATE "${CMAKE_SOURCE_DIR}/runtime" ${gen_dir})
|
||||
target_compile_options(tmb-native-contact-tests PRIVATE -ffp-contract=off -frounding-math)
|
||||
target_link_libraries(tmb-native-contact-tests PRIVATE tmb_runtime tmb_generated bozo_host)
|
||||
if(MINGW)
|
||||
target_link_options(tmb-native-contact-tests PRIVATE -static -Wl,--stack,268435456)
|
||||
endif()
|
||||
add_executable(tmb-native-scene-tests EXCLUDE_FROM_ALL tests/native_scene_tests.cpp)
|
||||
target_include_directories(tmb-native-scene-tests PRIVATE "${CMAKE_SOURCE_DIR}/runtime" ${gen_dir})
|
||||
target_compile_options(tmb-native-scene-tests PRIVATE -ffp-contract=off -frounding-math)
|
||||
target_link_libraries(tmb-native-scene-tests PRIVATE tmb_runtime tmb_generated bozo_host)
|
||||
if(MINGW)
|
||||
target_link_options(tmb-native-scene-tests PRIVATE -static -Wl,--stack,268435456)
|
||||
endif()
|
||||
add_executable(tmb-native-projection-tests EXCLUDE_FROM_ALL tests/native_projection_tests.cpp)
|
||||
target_include_directories(tmb-native-projection-tests PRIVATE "${CMAKE_SOURCE_DIR}/runtime" ${gen_dir})
|
||||
target_compile_options(tmb-native-projection-tests PRIVATE -ffp-contract=off -frounding-math)
|
||||
target_link_libraries(tmb-native-projection-tests PRIVATE tmb_runtime tmb_generated bozo_host)
|
||||
if(MINGW)
|
||||
target_link_options(tmb-native-projection-tests PRIVATE -static -Wl,--stack,268435456)
|
||||
endif()
|
||||
|
||||
add_executable(tmb-native-object-packet-tests EXCLUDE_FROM_ALL tests/native_object_packet_tests.cpp)
|
||||
target_include_directories(tmb-native-object-packet-tests PRIVATE "${CMAKE_SOURCE_DIR}/runtime" ${gen_dir})
|
||||
target_compile_options(tmb-native-object-packet-tests PRIVATE -ffp-contract=off -frounding-math)
|
||||
target_link_libraries(tmb-native-object-packet-tests PRIVATE tmb_runtime tmb_generated bozo_host)
|
||||
if(MINGW)
|
||||
target_link_options(tmb-native-object-packet-tests PRIVATE -static -Wl,--stack,268435456)
|
||||
endif()
|
||||
add_executable(tmb-native-texture-input-tests EXCLUDE_FROM_ALL tests/native_texture_input_tests.cpp)
|
||||
target_include_directories(tmb-native-texture-input-tests PRIVATE "${CMAKE_SOURCE_DIR}/runtime" ${gen_dir})
|
||||
target_compile_options(tmb-native-texture-input-tests PRIVATE -ffp-contract=off -frounding-math)
|
||||
target_link_libraries(tmb-native-texture-input-tests PRIVATE tmb_runtime tmb_generated bozo_host)
|
||||
if(MINGW)
|
||||
target_link_options(tmb-native-texture-input-tests PRIVATE -static -Wl,--stack,268435456)
|
||||
endif()
|
||||
add_executable(tmb-native-shader-tests EXCLUDE_FROM_ALL tests/native_shader_tests.cpp)
|
||||
target_include_directories(tmb-native-shader-tests PRIVATE "${CMAKE_SOURCE_DIR}/runtime")
|
||||
target_compile_options(tmb-native-shader-tests PRIVATE ${TMB_RUNTIME_ARCH} ${TMB_RUNTIME_OPT})
|
||||
if(MINGW)
|
||||
target_link_options(tmb-native-shader-tests PRIVATE -static)
|
||||
endif()
|
||||
if(MINGW)
|
||||
target_link_options(tmb-headless PRIVATE -static -Wl,--stack,268435456)
|
||||
endif()
|
||||
|
||||
if(TMB_WINDOW)
|
||||
add_executable(tmb bozo/tmb_window.cpp)
|
||||
tmb_native_manifest(tmb)
|
||||
target_link_libraries(tmb PRIVATE tmb_runtime tmb_generated bozo_host bozo_app)
|
||||
target_compile_definitions(tmb PRIVATE BOZO_RUN_DEFAULT_ELF="${TMB_ELF}")
|
||||
if(WIN32)
|
||||
enable_language(RC)
|
||||
target_sources(tmb PRIVATE "${CMAKE_SOURCE_DIR}/runtime/app/tmb.rc")
|
||||
# A player's build (tools/tmb_build.py): a GUI-subsystem exe, no console window; started from a terminal it
|
||||
# still prints there (bozo::app attaches to the parent's console).
|
||||
option(TMB_GUI_SUBSYSTEM "tmb.exe without a console window (the players' build)" OFF)
|
||||
if(TMB_GUI_SUBSYSTEM)
|
||||
set_target_properties(tmb PROPERTIES WIN32_EXECUTABLE ON)
|
||||
endif()
|
||||
endif()
|
||||
if(MINGW)
|
||||
target_link_options(tmb PRIVATE -static -Wl,--stack,268435456)
|
||||
endif()
|
||||
endif()
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"version": "0.6.0",
|
||||
"sha256": "d29bae3852abea4a6eee7b091141e637cd2db417383b476ac9778f3f3ff60957"
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
# The BozoEngine release cmake/bozo_engine.json pins, in BozoEngine/ beside cmake/: the release's archive
|
||||
# (https://github.com/TheBozos/BozoEngine/releases), SHA-256 checked, unpacked, and its version and hash written to
|
||||
# BozoEngine/.release; nothing is downloaded while those match the pin (a release's source\BozoEngine comes with it, so
|
||||
# a player's build stays offline). Included by cmake/bozo.cmake and launcher/CMakeLists.txt when they are not given
|
||||
# another tree, run by tools/tmb_build.py in a git checkout and by tools/make_release.py, or on its own:
|
||||
# cmake [-DBOZO_ENGINE_DOWNLOADS=<dir>] -P cmake/bozo_engine_fetch.cmake
|
||||
# BOZO_ENGINE_DOWNLOADS is where the archive goes (default build/). The same scheme as SoulCaliburIII_Recomp's.
|
||||
cmake_minimum_required(VERSION 3.20)
|
||||
get_filename_component(bozo_engine_root "${CMAKE_CURRENT_LIST_DIR}/.." ABSOLUTE)
|
||||
file(READ "${CMAKE_CURRENT_LIST_DIR}/bozo_engine.json" bozo_engine_pin)
|
||||
string(JSON bozo_engine_version GET "${bozo_engine_pin}" version)
|
||||
string(JSON bozo_engine_sha256 GET "${bozo_engine_pin}" sha256)
|
||||
set(bozo_engine_tree "${bozo_engine_root}/BozoEngine")
|
||||
|
||||
set(bozo_engine_want "${bozo_engine_version} ${bozo_engine_sha256}")
|
||||
set(bozo_engine_have "")
|
||||
if(EXISTS "${bozo_engine_tree}/.release")
|
||||
file(READ "${bozo_engine_tree}/.release" bozo_engine_have)
|
||||
string(STRIP "${bozo_engine_have}" bozo_engine_have)
|
||||
elseif(EXISTS "${bozo_engine_tree}")
|
||||
file(GLOB bozo_engine_entries "${bozo_engine_tree}/*" "${bozo_engine_tree}/.*")
|
||||
if(bozo_engine_entries)
|
||||
message(FATAL_ERROR "BozoEngine: ${bozo_engine_tree} is not a pinned release (the old submodule's checkout?): "
|
||||
"move it away (to build on it there: -DBOZO_ENGINE_DIR=<its new place>, or "
|
||||
"tools/tmb_build.py --engine <its new place>)")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT bozo_engine_have STREQUAL bozo_engine_want)
|
||||
if(NOT BOZO_ENGINE_DOWNLOADS)
|
||||
set(BOZO_ENGINE_DOWNLOADS "${bozo_engine_root}/build")
|
||||
endif()
|
||||
set(bozo_engine_name "BozoEngine-${bozo_engine_version}")
|
||||
set(bozo_engine_archive "${BOZO_ENGINE_DOWNLOADS}/${bozo_engine_name}.tar.gz")
|
||||
set(bozo_engine_url
|
||||
"https://github.com/TheBozos/BozoEngine/releases/download/v${bozo_engine_version}/${bozo_engine_name}.tar.gz")
|
||||
message(STATUS "BozoEngine ${bozo_engine_version}: ${bozo_engine_url}")
|
||||
file(DOWNLOAD "${bozo_engine_url}" "${bozo_engine_archive}" EXPECTED_HASH SHA256=${bozo_engine_sha256}
|
||||
TLS_VERIFY ON STATUS bozo_engine_status)
|
||||
list(GET bozo_engine_status 0 bozo_engine_code)
|
||||
if(bozo_engine_code)
|
||||
list(GET bozo_engine_status 1 bozo_engine_error)
|
||||
message(FATAL_ERROR "BozoEngine ${bozo_engine_version}: ${bozo_engine_error}")
|
||||
endif()
|
||||
set(bozo_engine_unpack "${bozo_engine_root}/.BozoEngine-unpack")
|
||||
file(REMOVE_RECURSE "${bozo_engine_tree}" "${bozo_engine_unpack}")
|
||||
file(ARCHIVE_EXTRACT INPUT "${bozo_engine_archive}" DESTINATION "${bozo_engine_unpack}")
|
||||
file(WRITE "${bozo_engine_unpack}/${bozo_engine_name}/.release" "${bozo_engine_want}\n")
|
||||
file(RENAME "${bozo_engine_unpack}/${bozo_engine_name}" "${bozo_engine_tree}")
|
||||
file(REMOVE_RECURSE "${bozo_engine_unpack}")
|
||||
endif()
|
||||
+392
-71
@@ -1,86 +1,407 @@
|
||||
# Handoff (2026-11-01)
|
||||
# TMB on BozoEngine — 2026-11-05
|
||||
|
||||
Where the work stands and how to pick it up on another machine. Details and history are in `RECOMP_NOTES.md`.
|
||||
**Release update, 2026-11-06:** [v0.4.0 is published](https://github.com/TheBozos/TMB_Recomp/releases/tag/v0.4.0),
|
||||
tagged at `eea175219b1e46a9c1699f640744279650c65a14`, with BozoEngine `9361960`.
|
||||
The [tagged release workflow](https://github.com/TheBozos/TMB_Recomp/actions/runs/42133821321) passed and produced
|
||||
both player ZIPs, their SHA-256 files, and the corresponding-source ZIP/hash. The publication notification workflow passed too.
|
||||
Both downloaded player ZIPs pass the local audit/hash checks and contain the same 7,750 files; all three ZIP hashes
|
||||
also match GitHub's asset digests. The published package updated the isolated accented-path portable installation,
|
||||
preserved its player-data marker, reported launcher version 0.4.0 and rebuilt/played successfully.
|
||||
Final release timing: EE/PC **1.0000**, **575,965 ticks/s**, **59.95 fields/s**, movies **30.00 pictures/s**.
|
||||
The approved shared README format is restored. Campaign/hardware/reference-test limits below remain open.
|
||||
|
||||
## Goal
|
||||
The goal is to remove the PS2Recomp fork from the project. This source tree now builds **only on BozoEngine**.
|
||||
The earlier v0.3.2 release remains in Git history and on GitHub for comparison; it is not a runtime dependency.
|
||||
|
||||
The game smooth (its own 60 fps, the USA release only: the European one is dropped) and fully playable as a true PC
|
||||
program: no PS2 hardware simulated where the PC can do the job itself. Locked runs on 2026-11-01: a 1P match
|
||||
57.7-60.4 fps, 4P split screen 55.8-60.4. Earlier:
|
||||
## Architecture and build
|
||||
|
||||
| Release | Path | fps mean | slowest tenth |
|
||||
|---|---|---|---|
|
||||
| USA (`SCUS-97101`, NTSC) | native (`scripts/run_native.sh`, 2x resolution) | 58.9 | 58.5 |
|
||||
[`SAVE_STATES.md`](SAVE_STATES.md) adds save states (F5/F7/F6, `--save-state` / `--load-state`), with the 989SND driver saved in BozoEngine.
|
||||
[`NATIVE_PERSISTENT_FORWARD.md`](NATIVE_PERSISTENT_FORWARD.md) adds the last three forwards: 269/269 forward returns are native.
|
||||
[`NATIVE_BLOW_DEBRIS_FORWARD.md`](NATIVE_BLOW_DEBRIS_FORWARD.md) adds the BlowDebris forwards (one dead-W-slot RAM hash difference, proven).
|
||||
[`NATIVE_HUD_LASER_FORWARD.md`](NATIVE_HUD_LASER_FORWARD.md) adds the HUD laser forwards.
|
||||
[`NATIVE_UPDATE_LAUNCHER_FORWARD.md`](NATIVE_UPDATE_LAUNCHER_FORWARD.md) adds the UpdateLauncher forwards.
|
||||
[`NATIVE_FIRE_TORCH_FORWARD.md`](NATIVE_FIRE_TORCH_FORWARD.md) adds the FireSpecial types c0/1e0/220 forwards.
|
||||
[`NATIVE_FIRE_LOCKON_FORWARD.md`](NATIVE_FIRE_LOCKON_FORWARD.md) adds the FireSpecial type a0 lock-on forwards.
|
||||
[`NATIVE_FIRE_SPECIAL_FORWARD.md`](NATIVE_FIRE_SPECIAL_FORWARD.md) adds the first FireSpecial forwards (types 20, 40, 60).
|
||||
[`NATIVE_LOOPTANK_FORWARD.md`](NATIVE_LOOPTANK_FORWARD.md) adds the LoopTank segment forwards.
|
||||
[`NATIVE_SPECIAL_TORCH_FORWARD.md`](NATIVE_SPECIAL_TORCH_FORWARD.md) adds the special-weapon torch forwards (UpdateSpecial complete).
|
||||
[`NATIVE_FERRIS_BOSS_FORWARD.md`](NATIVE_FERRIS_BOSS_FORWARD.md) adds the Ferris wheel and final boss hit-test forwards.
|
||||
[`NATIVE_WEAPON_HIT_FORWARD.md`](NATIVE_WEAPON_HIT_FORWARD.md) adds the RockHD/RicoHD hit-test forwards and the hd/DispatchHit W audit.
|
||||
[`NATIVE_SPECIAL_ARCS_FORWARD.md`](NATIVE_SPECIAL_ARCS_FORWARD.md) adds the held-aim and lock-on arc special-weapon forwards.
|
||||
[`NATIVE_SPECIAL_SWEEP_FORWARD.md`](NATIVE_SPECIAL_SWEEP_FORWARD.md) adds the three type-100 special-weapon forwards.
|
||||
[`NATIVE_SPECIAL_VOLLEY_FORWARD.md`](NATIVE_SPECIAL_VOLLEY_FORWARD.md) adds the second batch of launcher special-weapon forwards.
|
||||
[`NATIVE_SPECIAL_GUNS_FORWARD.md`](NATIVE_SPECIAL_GUNS_FORWARD.md) adds the first five launcher special-weapon forwards.
|
||||
[`NATIVE_BOSS_MOVE_FORWARD.md`](NATIVE_BOSS_MOVE_FORWARD.md) adds the two FinalBoss movement forwards.
|
||||
[`NATIVE_BOSS_SHOTS_FORWARD.md`](NATIVE_BOSS_SHOTS_FORWARD.md) adds the twelve FinalBoss gun-shot forwards.
|
||||
[`NATIVE_PARTICLE_ARCS_FORWARD.md`](NATIVE_PARTICLE_ARCS_FORWARD.md) adds the two particle arc forwards.
|
||||
[`NATIVE_AI_BEAD_FORWARD.md`](NATIVE_AI_BEAD_FORWARD.md) adds the AI hunt and bait forwards.
|
||||
[`NATIVE_ZOOMIES_HAL_FORWARD.md`](NATIVE_ZOOMIES_HAL_FORWARD.md) adds the Zoomies and HalTrans weapon forwards.
|
||||
[`NATIVE_COMBO_FORWARD.md`](NATIVE_COMBO_FORWARD.md) adds the five combo-launch forwards.
|
||||
[`NATIVE_TIRE_ROTATION_FORWARD.md`](NATIVE_TIRE_ROTATION_FORWARD.md) adds the two tire-pair correction forwards.
|
||||
[`NATIVE_MACHINE_GUN_FORWARD.md`](NATIVE_MACHINE_GUN_FORWARD.md) adds the two machine-gun muzzle forwards.
|
||||
[`NATIVE_ENVHELI_PED_FORWARD.md`](NATIVE_ENVHELI_PED_FORWARD.md) adds the helicopter gun and walking pedestrian forwards.
|
||||
[`NATIVE_JET_DEATH_FORWARD.md`](NATIVE_JET_DEATH_FORWARD.md) adds the six falling junk jet forwards.
|
||||
[`NATIVE_BLIMP_DEATH_FORWARD.md`](NATIVE_BLIMP_DEATH_FORWARD.md) adds the sinking blimp drift and explosion forwards.
|
||||
[`NATIVE_GASTANK_FORWARD.md`](NATIVE_GASTANK_FORWARD.md) adds the rolling and falling gas tank forwards.
|
||||
[`NATIVE_FLYER_FORWARD.md`](NATIVE_FLYER_FORWARD.md) adds the junk jet and blimp flight forwards.
|
||||
Coverage is 209/269 known forward returns (60 remain), with 134/134 known inverse returns native.
|
||||
|
||||
Windows, Ryzen 7 7800X3D, RTX 5070 Ti; scripted play through the menus into the first arena (`tools/play_script.py`).
|
||||
[`NATIVE_HELI_DEATH_FORWARD.md`](NATIVE_HELI_DEATH_FORWARD.md) adds the two falling-helicopter forwards.
|
||||
Coverage is 150/269 known forward returns (119 remain), with 134/134 known inverse returns native.
|
||||
|
||||
## Setting up a new machine
|
||||
[`NATIVE_FERRIS_SMASHER_FORWARD.md`](NATIVE_FERRIS_SMASHER_FORWARD.md) adds the falling Ferris wheel car and
|
||||
smasher hit-camera forwards. Coverage is 148/269 known forward returns (121 remain), with 134/134
|
||||
known inverse returns native.
|
||||
|
||||
1. Install the requirements in the README (CMake, Ninja, GCC 13+, FFmpeg dev libs, X11/Wayland + OpenGL headers,
|
||||
bsdtar, an AVX2 CPU). The native port draws with OpenGL 3.3. A Vulkan driver is only needed for the PS2 path's
|
||||
paraLLEl-GS (`scripts/run.sh`), fetched by CMake with its shaders precompiled.
|
||||
2. `git clone --recurse-submodules https://github.com/TheBozos/TMB_Recomp.git`. `PS2Recomp` is the fork
|
||||
`TheBozos/PS2Recomp`; TMB pins a commit of its `native/renderer` branch (the native work, merged into `main` as it
|
||||
settles).
|
||||
3. The game data is not in the repository (never commit it). Put your own ISO at the repo root, then follow "Build and
|
||||
run" in the README: `extract_iso.sh`, `build_tools.sh`, `recomp.sh`, `build_runtime.sh`, optionally
|
||||
`iop_recomp.sh` (`game_us/`, `generated_us/`, `build/game_us`).
|
||||
4. On Windows: MSYS2 UCRT64 with its GCC, as in the README's Windows section; `scripts/stage_dlls.sh` after a build
|
||||
to start the runner outside the MSYS2 shell. No `perf`: use the fork's sampling profiler (`PS2X_PROFILE=<s>`).
|
||||
5. The first build compiles about 3500 generated files. A change to `ps2_runtime.h`, `ps2_memory.h` or
|
||||
`gs_frontend.h` rebuilds all of them.
|
||||
[`NATIVE_ENVWEAPON_FORWARD.md`](NATIVE_ENVWEAPON_FORWARD.md) adds the two environment gun fire-point
|
||||
forwards. Coverage is 146/269 known forward returns (123 remain), with 134/134 known inverse
|
||||
returns native.
|
||||
|
||||
## Current state
|
||||
[`NATIVE_COPSUV_AIM_FORWARD.md`](NATIVE_COPSUV_AIM_FORWARD.md) adds the two Cop SUV laser-aim
|
||||
forwards. Coverage is 144/269 known forward returns (125 remain), with 134/134 known inverse
|
||||
returns native.
|
||||
|
||||
- **Playable.** Boot, movies (the USA release's story cinematics too), menus, loading, matches (driving, weapons, AI,
|
||||
sound, HUD, split screen), deaths, respawns, game over, saving and loading. Story mode: level 1 of 8 checked.
|
||||
- **The native path** (`TMB_NATIVE=1`, `scripts/run_native.sh`):
|
||||
- frames on the PC's clock (`timer1HandlerNative`, the fork's `FramePacer`; `TMB_NATIVE_FRAMES=0` for the vblanks);
|
||||
- 3D from an offline mesh pack at the game's per-object hook, in the game's order, clipped to its own clip volume
|
||||
(`runtime/tmb_meshes.cpp`); effects from the particle lists (`runtime/tmb_particles.cpp`); 2D builders rewritten
|
||||
(`runtime/tmb_2d.cpp`); textures from an offline pack (`runtime/tmb_textures.cpp`); VU0 programs in C++
|
||||
(`runtime/tmb_vu0.cpp`); no VU1 or VU0 interpreter;
|
||||
- no GS front end: no GS object, memory or thread; the DMA kicks to GIF / VIF0 / VIF1 complete unread; the native
|
||||
renderer presents the frame at 2x (`PS2X_GS_SCALE`);
|
||||
- sound: the recompiled 989snd's libsd calls on the fork's native mixer, the SPU2 absent (`TMB_NATIVE_AUDIO=0`
|
||||
brings it back);
|
||||
- the IOP: no hardware model and no interpreted instruction (`[iop:hw]`); its kernel services answered natively.
|
||||
- the settings window (F2): controls, video (resolution, windowed / fullscreen / borderless, render scale), cheats;
|
||||
the window shows each game frame once (no periodic stutter).
|
||||
- **Controls.** Rebindable to keys, controllers and the mouse: F2 in the game, saved to `input.ini`.
|
||||
- **Known gaps.** Not checked yet: every arena and story level to the endings. Widescreen and frame rates above the
|
||||
PS2's are not started (the game's update steps in whole fields).
|
||||
[`NATIVE_LAUNCHER_AIM_FORWARD.md`](NATIVE_LAUNCHER_AIM_FORWARD.md) adds the Hearse, Minion and
|
||||
Tanker launcher turret-aim forwards. Coverage is 142/269 known forward returns (127 remain),
|
||||
with 134/134 known inverse returns native.
|
||||
|
||||
## Measuring
|
||||
[`NATIVE_RICOCHET_FORWARD.md`](NATIVE_RICOCHET_FORWARD.md) adds the two ricochet movement
|
||||
forwards, before its height test and after its reflection. Coverage is 139/269 known forward
|
||||
returns (130 remain), with 134/134 known inverse returns native.
|
||||
|
||||
- **Check runs.** A pad script reaching the match about 150 s in: `PS2X_PAD_SCRIPT="$(tools/play_script.py 230)"`,
|
||||
with `TMB_TRACE_FRAMES=1` (frame split and CPU per host thread every 100 frames; under native frames also the game's
|
||||
fields per real second, 60 when it runs at its own speed). `PS2X_CAPTURE_DIR` saves the presented picture
|
||||
every few seconds, `PS2X_CAPTURE_WINDOW_DIR` the window as shown, `PS2X_WINDOW_SIZE=1280x960` a bigger window.
|
||||
- **Timeline.** `TMB_TRACE_TIMELINE=<file>`, then `tools/timeline.py <file> [frame] [count]`.
|
||||
- **What is still read or emulated.** `TMB_TRACE_PACKETS=1`: per 250 frames, packets read, chains walked, VU0
|
||||
interpreter runs (all 0 by default); `[audio] native mixer` lines every 10 s with the SPU2 counters (all 0).
|
||||
- **Live diagnosis.** `TMB_LIVE_TOGGLES=<file>` (words read every 60 frames: nodepth, nofog, flat, noguard, dump...)
|
||||
and F9 bursts of window captures: let the owner drive to a spot scripts can't reach.
|
||||
- **Comparison modes.** `TMB_NATIVE_VIF=1` (+ `TMB_NATIVE_MESHES_CHECK=1`), `TMB_NATIVE_MESHES=0 TMB_NATIVE_CHECK=<n>`
|
||||
(VU1's own output beside the translation), `PS2X_VU0_HLE_CHECK=1`, `PS2X_AUDIO_RECORD=<wav>` on either sound path.
|
||||
- **Shared machine.** Only timed runs go through the bench lock (`tools/bench_lock.sh`); builds and visual checks run
|
||||
freely. Discard the first run after a build on Windows (Defender scans the new files).
|
||||
[`NATIVE_WEAPON_LOCK_FORWARD.md`](NATIVE_WEAPON_LOCK_FORWARD.md) adds six weapon lock-on,
|
||||
look-ahead, skill-satellite and rock forwards, with actual aim, position and height-test consumers.
|
||||
Coverage is 137/269 known forward returns (132 remain), with 134/134 known
|
||||
inverse returns native.
|
||||
|
||||
## Next steps
|
||||
[`NATIVE_MINION_FORWARD.md`](NATIVE_MINION_FORWARD.md) adds seven Minion shield-hit
|
||||
forwards, with actual distance, health, HUD and hierarchy-switch consumers.
|
||||
Coverage is 131/269 known forward returns (138 remain), with 134/134 known
|
||||
inverse returns native.
|
||||
|
||||
1. Story levels 2-8 to the endings, fixing what shows up (the owner's reports first); every Challenge arena is checked
|
||||
(the Cheats tab's Unlock everything, `TMB_UNLOCK_ALL=1`, opens the locked ones).
|
||||
2. Widescreen; frame rates above the PS2's (interpolating between game updates).
|
||||
3. Later, a bigger project: the PS2-shaped software layer the recompiled code still runs in (guest threads, DMA kicks,
|
||||
the IOP modules' RPC) replaced by the game's systems as PC code.
|
||||
[`NATIVE_ATTACHMENT_FORWARD.md`](NATIVE_ATTACHMENT_FORWARD.md) adds five helicopter,
|
||||
cable and weapon movement forwards. Coverage is 124/269 known forward returns
|
||||
(145 remain), with 134/134 known inverse returns native.
|
||||
|
||||
## Working conventions
|
||||
[`NATIVE_COLLISION_FORWARD.md`](NATIVE_COLLISION_FORWARD.md) adds six vehicle-collision
|
||||
forwards for velocity reconstruction, forces, impact offsets and morph hit placement.
|
||||
Coverage is 119/269 known forward returns (150 remain), with 134/134 known inverses native.
|
||||
|
||||
- Commit as `Thomas Martin <[email protected]>`, never a personal e-mail. End commits with
|
||||
the `Co-Authored-By` line used in the history.
|
||||
- Fixes to the runtime, IOP or recompiler go into the fork `TheBozos/PS2Recomp`, not into workarounds here. Push the
|
||||
fork first, then bump the submodule here.
|
||||
- Run the fork tests before pushing (`ps2x_tests`, 610+ cases), and a TMB check run on the USA release.
|
||||
- Push with Git for Windows (`/c/Program Files/Git/cmd/git.exe`): MSYS2's git hangs without credentials.
|
||||
- Never edit a script a running or queued job will execute; clear a stale bench lock entry if a job dies holding it.
|
||||
Native graphics DMA/register removal: implementation and validation details are in
|
||||
[`NATIVE_GRAPHICS.md`](NATIVE_GRAPHICS.md). The source uses BozoEngine `a36a4d2` (see the bump notes below), including native graphics
|
||||
completion and the current shared native port services. The published v0.4.0 package remains the earlier release described above.
|
||||
|
||||
The player runtime's two camera matrix products now use typed native records without VU context state.
|
||||
[`NATIVE_MATH.md`](NATIVE_MATH.md) records exact helper/default-run comparisons, the traced HUD position.W
|
||||
RAM difference, and the vehicle/hierarchy/inline VU work that remains.
|
||||
|
||||
The six inline HUD point/direction blocks also use native records; [`NATIVE_HUD.md`](NATIVE_HUD.md)
|
||||
records the original-block comparisons, destination-W contract and targeting-warning coverage limit.
|
||||
|
||||
[`NATIVE_IMAGES.md`](NATIVE_IMAGES.md) records the shared image-builder retirement contributed by DC,
|
||||
the TMB resident-binding audit, exact draw/sound comparisons and movie/loading/gameplay qualification.
|
||||
|
||||
[`NATIVE_VEHICLE.md`](NATIVE_VEHICLE.md) covers native vehicle spatial calculations and the audited skid
|
||||
direction, exact full-frame records, original-caller tests and the remaining multi-step coverage limit.
|
||||
|
||||
[`NATIVE_SUSPENSION_TIRE.md`](NATIVE_SUSPENSION_TIRE.md) adds the suspension ride-height
|
||||
and tire-height transform leaves, with complete generated scalar consumers and tire entry calls.
|
||||
|
||||
[`NATIVE_PARTICLE_EMISSION.md`](NATIVE_PARTICLE_EMISSION.md) adds the emitted-direction and
|
||||
attached/relative emitter transforms, with real particle metadata consumers and complete emitter-coordinate entry calls.
|
||||
|
||||
[`NATIVE_SHADOWS.md`](NATIVE_SHADOWS.md) adds vehicle shadow vertices and weapon shadow motion/height-sample
|
||||
transforms, with complete cached-height vertex loops and actual height-query XYZ staging consumers.
|
||||
|
||||
[`NATIVE_TOW_TRUCK.md`](NATIVE_TOW_TRUCK.md) adds the tow-truck launcher's forward/inverse transforms,
|
||||
with complete positioning, smoothing, normalization, orientation and material-publication consumers.
|
||||
|
||||
[`NATIVE_ATTRACTOR_GROUPS.md`](NATIVE_ATTRACTOR_GROUPS.md) adds group-selection, center and random-position
|
||||
inverse transforms, with complete consumers, seeded generated producers and an audited peel-out W boundary.
|
||||
|
||||
[`NATIVE_PEEL_OUT.md`](NATIVE_PEEL_OUT.md) retires that peel-out forward transform,
|
||||
with complete producer-to-pose checks and a fresh audit of the four opaque W fields.
|
||||
|
||||
[`NATIVE_CAMERA_TRANSFORMS.md`](NATIVE_CAMERA_TRANSFORMS.md) adds all eight camera-update
|
||||
forward transforms, rear-view positioning and the coupled inline XYZW position publication.
|
||||
|
||||
[`NATIVE_WEATHER_VIEWPORT.md`](NATIVE_WEATHER_VIEWPORT.md) adds the weather viewport's
|
||||
forward transform, checked through full entry, fade/fog updates, grid alignment and projection.
|
||||
|
||||
[`NATIVE_WEAPON_SKID_TRANSFORMS.md`](NATIVE_WEAPON_SKID_TRANSFORMS.md) adds weapon translation
|
||||
and skid-mark creation/stretch offsets, with complete positioning, list and vertex consumers.
|
||||
|
||||
[`NATIVE_COLLISION_DRIFT_INVERSES.md`](NATIVE_COLLISION_DRIFT_INVERSES.md) adds sixteen vehicle
|
||||
collision and drift inverse returns, with full XYZW checks and explicit generated-consumer boundaries.
|
||||
|
||||
[`NATIVE_RIGID_BODY_INVERSES.md`](NATIVE_RIGID_BODY_INVERSES.md) adds seven rigid-body inverse
|
||||
returns, with complete impulse/collision entries and point-velocity consumers.
|
||||
|
||||
[`NATIVE_RIGID_BODY_FORWARD.md`](NATIVE_RIGID_BODY_FORWARD.md) adds ten rigid-body forward
|
||||
returns with complete force, torque, impulse and integration entries plus actual
|
||||
point-velocity consumers and audited destination-W lifetimes.
|
||||
|
||||
[`NATIVE_DRIVER_FORWARD.md`](NATIVE_DRIVER_FORWARD.md) adds seven driver path-offset,
|
||||
lookahead and driving-LOS forwards. Coverage is 113/269 known forward returns
|
||||
(156 remain), with 134/134 known inverse returns native. Complete generated owners
|
||||
retain actual collision queries, scalar state consumers and meaningful inverse W.
|
||||
|
||||
[`NATIVE_FINAL_INVERSES.md`](NATIVE_FINAL_INVERSES.md) completes native coverage of all 134 known
|
||||
inverse-helper returns, with force-field/health-stand entries, HUD/radar consumers and
|
||||
particle visibility/sorting checks. Unknown and historical ABI support remains.
|
||||
|
||||
[`NATIVE_VEHICLE_LIGHT_INVERSES.md`](NATIVE_VEHICLE_LIGHT_INVERSES.md) adds six tire, rollover,
|
||||
weapon-damage and object-light inverse returns, with complete generated owner entries
|
||||
and real scalar state-publication consumers.
|
||||
|
||||
[`NATIVE_DRIVER_BOSS_INVERSES.md`](NATIVE_DRIVER_BOSS_INVERSES.md) adds five driver/boss inverse
|
||||
returns and their coupled boss forward publication, with complete/bounded generated consumers
|
||||
and gameplay/loading/movie qualification.
|
||||
|
||||
[`NATIVE_AI_INVERSES.md`](NATIVE_AI_INVERSES.md) adds five AI inverse returns,
|
||||
with steering, attack-range and shot-policy consumers plus real attack-state publication.
|
||||
|
||||
[`NATIVE_HIERARCHY.md`](NATIVE_HIERARCHY.md) covers native collision/height hierarchy sphere tests, audited
|
||||
inverse transforms and BSP plane distances, their original-caller tests and RAM boundary.
|
||||
|
||||
[`NATIVE_DIRECTIONS.md`](NATIVE_DIRECTIONS.md) adds three hot BSP collision direction callers to the
|
||||
native record path, with generated-continuation tests, complete gameplay comparisons and stack-W audit.
|
||||
|
||||
[`NATIVE_DIRECTION_CONSUMERS.md`](NATIVE_DIRECTION_CONSUMERS.md) extends that scope to vehicle collision
|
||||
points, tire-height corrections and light nodes, including the scalar clamps and normalization consumers.
|
||||
|
||||
[`NATIVE_PARTICLE_CONTINUATIONS.md`](NATIVE_PARTICLE_CONTINUATIONS.md) records the timing-sensitive
|
||||
flare fallback found during that qualification and its native dispatch fix across scheduler resumes.
|
||||
|
||||
[`NATIVE_BSP_INVERSES.md`](NATIVE_BSP_INVERSES.md) retires the paired BSP and vehicle inverse leaves,
|
||||
checks untouched VU state through their continuations, and traces the bounded contact-position W
|
||||
RAM difference through the remaining terrain copy chain.
|
||||
|
||||
[`NATIVE_TERRAIN_CONTACTS.md`](NATIVE_TERRAIN_CONTACTS.md) replaces the 27 inline terrain, node,
|
||||
point-contact and ray-result vector blocks with native XYZ calculations, with generated-block and
|
||||
scalar-continuation tests and the retained fourth-component RAM boundary.
|
||||
|
||||
[`NATIVE_SPHERE_LOD.md`](NATIVE_SPHERE_LOD.md) adds the three sphere/LOD difference blocks and six
|
||||
collision hierarchy helper returns, with complete generated sphere/LOD callers, scalar consumer
|
||||
sequences and qualified gameplay/loading/movie routes. It records the remaining raw-RAM audit limit.
|
||||
|
||||
[`NATIVE_HIERARCHY_HELPERS.md`](NATIVE_HIERARCHY_HELPERS.md) adds twelve segment-grid, control-node,
|
||||
height/BSP and line-of-sight helper returns. It records generated consumer tails, historical ABI
|
||||
checks, live-route coverage and the directly traced height-BSP temporary W difference.
|
||||
|
||||
[`NATIVE_HIERARCHY_QUERY_RESULTS.md`](NATIVE_HIERARCHY_QUERY_RESULTS.md) adds twelve point/line,
|
||||
terrain, auxiliary BSP, animated-node and lighting/attachment returns, with generated packing,
|
||||
normalization and colour-consumer checks and a paired line-result W trace.
|
||||
|
||||
[`NATIVE_BSP_CROSSINGS.md`](NATIVE_BSP_CROSSINGS.md) adds thirteen BSP point/segment-crossing
|
||||
returns, including actual point emission, duplicate/capacity checks and comparison of meaningful
|
||||
inverse W when it replaces an earlier forward record.
|
||||
|
||||
[`NATIVE_HIERARCHY_TRAVERSAL_SETUP.md`](NATIVE_HIERARCHY_TRAVERSAL_SETUP.md) adds thirteen database
|
||||
traversal, older collision-node/terrain and animated matrix-stack setup returns, with real scalar
|
||||
consumer boundaries and historical ABI checks.
|
||||
|
||||
[`NATIVE_LEGACY_BSP_HELPERS.md`](NATIVE_LEGACY_BSP_HELPERS.md) adds fifteen older BSP setup/result
|
||||
and hierarchy root/grid/traversal returns, with generated normalization, segment construction,
|
||||
packing and matrix-stack publication checks.
|
||||
|
||||
[`NATIVE_POINT_RAY_HELPERS.md`](NATIVE_POINT_RAY_HELPERS.md) adds eleven coordinate-system/root
|
||||
and point-contact/ray result transforms, with complete scalar result tails and historical ABI
|
||||
checks.
|
||||
|
||||
[`NATIVE_TERRAIN_INPUT_HELPERS.md`](NATIVE_TERRAIN_INPUT_HELPERS.md) adds eleven terrain-node,
|
||||
height-query and material-query inverse returns, with actual height scans, aggregate bounds
|
||||
publication and integer-grid consumer checks.
|
||||
|
||||
[`NATIVE_TERRAIN_QUERY_HELPERS.md`](NATIVE_TERRAIN_QUERY_HELPERS.md) adds ten terrain LOS,
|
||||
cell-collision and ray inverse returns, with translated endpoint pairs and real result
|
||||
normalization/publication consumers.
|
||||
|
||||
[`NATIVE_CAR_PARTICLE_HELPERS.md`](NATIVE_CAR_PARTICLE_HELPERS.md) adds the fourteen older
|
||||
car-debug and hierarchy particle forward returns, with actual debug-line vertex records,
|
||||
view lookup and scalar position consumers.
|
||||
|
||||
[`NATIVE_TERRAIN_FINAL_HELPERS.md`](NATIVE_TERRAIN_FINAL_HELPERS.md) adds eight terrain debug,
|
||||
edit and wave inverse returns, with actual vertex records, grid/input consumers and wave
|
||||
type/bounds dispatch. It closes this narrow hierarchy/terrain two-transform-helper inventory.
|
||||
|
||||
[`NATIVE_SCENE.md`](NATIVE_SCENE.md) covers the subsequent renderer hierarchy producer/consumer replacement:
|
||||
native scene/frame/light records, zero VU0 program calls in both qualified routes, packet-buffer-only RAM
|
||||
differences at the checked gameplay snapshot, and movie/loading/1P/4P validation. Other macro math and shader
|
||||
parameter packing remained at that step; the published release has not been updated by these source changes.
|
||||
|
||||
[`NATIVE_SHADERS.md`](NATIVE_SHADERS.md) covers removal of the mesh shader's `VuImage` and point-light packing,
|
||||
named native parameters and retained state, exact complete 1P/4P recordings, and a disc-free numerical suite
|
||||
added to Windows/Linux CI. Other macro math, scalar packet builders and legacy extents remain.
|
||||
|
||||
[`NATIVE_PROJECTION.md`](NATIVE_PROJECTION.md) covers the next audited screen/weather projection and
|
||||
identity boundaries, original helper/generated-caller checks, live comparison counts, and the remaining
|
||||
peeling-out W-padding chain behind the raw-RAM differences.
|
||||
|
||||
[`NATIVE_OBJECT_PACKETS.md`](NATIVE_OBJECT_PACKETS.md) covers retirement of the per-object shader/header
|
||||
output and RGB packet readbacks. [`NATIVE_TEXTURE_INPUTS.md`](NATIVE_TEXTURE_INPUTS.md) covers the subsequent
|
||||
removal of its last three texture copies and the consumer's packet reads/patches. Game allocation/usage
|
||||
bookkeeping and the separate upload-link builder still execute; no packet shadow or binding is added.
|
||||
|
||||
[`NATIVE_TEXTURE_UPLOADS.md`](NATIVE_TEXTURE_UPLOADS.md) covers the subsequent native upload-link leaf,
|
||||
preserved CPU/cursor ABI, original fallback contracts and bounded gameplay/movie validation. It emits
|
||||
no upload tag at the audited calls; game texture-manager bookkeeping and other packet helpers remain.
|
||||
|
||||
[`NATIVE_GRAPHICS_SERVICES.md`](NATIVE_GRAPHICS_SERVICES.md) records removal of the engine GS device/GIF
|
||||
reader state and TMB's old packet-based flare adapter, independent/combined tests and unsupported readback limits.
|
||||
|
||||
- No submodule: BozoEngine is the release `cmake/bozo_engine.json` pins (fetched into `BozoEngine/`). No PS2Recomp gitlink, legacy CMake branch, import fallback, IOP recompilation or old runner scripts.
|
||||
- `tools/tmb_build.py`: verify → extract → configure → native tools → recompile → packs → compile → stage.
|
||||
- `scripts/build_runtime.sh` and the other retained shortcuts use that same pipeline.
|
||||
- Native frame pacing is unconditional. A legacy `TMB_NATIVE_FRAMES=0` environment setting cannot bypass it.
|
||||
- Heat haze defaults on, as requested. `BOZO_HEAT_HAZE=0` is the comparison switch.
|
||||
- Existing cards/settings keep their format and `%APPDATA%\TMB_Recomp` location. Agent runs must set a scratch `PS2X_USER_DIR`.
|
||||
|
||||
## BozoEngine `db7591c`: owned handler stacks and texture upscaling (2026-11-10)
|
||||
|
||||
The pin moved from `4a8f70a` to engine main `db7591c` (232 commits). The bump brings SC3's texture upscaling (engine
|
||||
PR #83: `texture_upscale` off/2x/4x, `texture_filter` edge/smooth, in the Video tab) and VP2S's owned handler stacks
|
||||
(engine PR #75): native callbacks run on the interrupted thread's own stack, below its live SP.
|
||||
|
||||
That second change needed two fixes:
|
||||
- TMB's crt0 calls `SetupThread(0x8ff800, 0)` (a top, no size). Engine PR #85 declares the 1 MB below such a top.
|
||||
- TMB's hand-written code uses SP as data: `hierTraverseAsm` saves it at `s0 + 0x270`, sets it to 0 at `0x1d5450`,
|
||||
and restores it at `0x1d5718` and `0x1d5734` (a delay slot); `sysSetSp`/`sysRestoreSp` switch it.
|
||||
`runtime/tmb_stack_switch.cpp` parks the real SP with the kernel at each switch and resumes it once restored.
|
||||
|
||||
Validation (headless, private user folders; evidence in `D:/BozoScratch/texture-upscaling`):
|
||||
- Compared with the previous pin, the 1P route (9,500 frames, `ch1p_frames.txt`) and the actual 4P route
|
||||
(8,500 frames) match on every frame for draws, scratchpad, calls, threads and EE cycles.
|
||||
- Sound hashes differ on frames 1595, 1596, 1603 and 1611 only (menu), with equal sample counts throughout.
|
||||
- RAM differs from frame 4, because callback frames now live on the game's stack rather than at `0x1ffxxxx`.
|
||||
- Windowed 1P runs at off/2x/4x and a 4P run at 4x complete. Captures show the copyright movie, the menus, the
|
||||
arena and four views.
|
||||
- At 4x, the 1P route kept about 250 MB of copies (25 ms of worker time each); at 2x, 64 MB (7 ms each).
|
||||
|
||||
## BozoEngine `563454e`: texture replacements (2026-11-10)
|
||||
|
||||
Engine PR #86 adds texture replacements (`<identity>.png` in the user folder's `texture_pack`, read by workers) and a
|
||||
12 MB-per-present budget for larger copies. TMB's side is `tools/tmb_texture_upscale.py` (Real-ESRGAN over a
|
||||
`TMB_TEXTURE_DUMP` dump). Frame-pacing measurements with the bench lock are in `docs/TEXTURE_UPSCALING.md`: 1P and 4P
|
||||
hold 60 with a pack and 4x upscaling. Before the budget, 4x upscaling alone fell to 31 presents/s on the 1P route.
|
||||
Evidence: `D:/BozoScratch/texture-upscaling` (t-*.log, fps_summary.py); Real-ESRGAN in `D:/BozoScratch/esrgan`.
|
||||
|
||||
## Validation recorded in this continuation
|
||||
|
||||
- Engine: all 5 local CTest checks pass, including the corrected FMAC overflow case and its new boundary cases.
|
||||
- Whole-function replay: **9,232/9,232 samples, 1,518/1,518 functions**, bit-exact.
|
||||
- Real-time menu/movie diagnostic: EE/PC **1.0001**, **576,005 ticks/s**, **59.97 fields/s**; movies **29.93–30.00 pictures/s**.
|
||||
The owner also said the freshly launched build no longer felt too fast. This measurement used the handoff build's existing clock fixes;
|
||||
the continuation adds a regression guard and removes the unpaced legacy frame switch.
|
||||
- Native story run without a call log: **26,000 frames**, stage progression, card files written, no fault.
|
||||
- Boot pinned: **MATCH**, 3,000/3,000 state frames; draws 2,999/3,000 (the established last-record exception).
|
||||
- 1P pinned: **MATCH**, 16,000/16,000 state frames; draws 15,999/16,000 (the same last-record exception).
|
||||
- Stage 6 pinned: the old frame-7105 interrupt mismatch is resolved. **11,000/11,000 state and draw frames match with recorded IOP-time sound replies**.
|
||||
Two events retain an ancestor pc in the reference; the checker accepts these only with an active inner call, matching function/caller,
|
||||
and an **exact cycle and checkpoint count**, and reports them separately. It does not shift their timing.
|
||||
- Release-tool regressions: 12 tests pass, including accelerated menus/movies, migration layout, retired source cleanup,
|
||||
junction boundaries, configure retry and archive-pipe completion. No game data is needed by those tests.
|
||||
- Engine and TMB Windows/Linux CI pass. The native package workflow's test run
|
||||
[42121468079](https://github.com/TheBozos/TMB_Recomp/actions/runs/42121468079) also passed, including its bundled-toolchain smoke check.
|
||||
|
||||
### Packaged Windows build and updates
|
||||
|
||||
- Candidate `0.4.0-test.20261105.3`, code `b9c42cb`, engine `9361960`: both player ZIPs pass the archive audit and SHA-256 checks.
|
||||
All **7,750 files** have identical contents between the two installation layouts. The corresponding-source ZIP's hash passes too.
|
||||
- Built and played from `D:\BozoScratch\finish\Jérôme Jeux\TMB_Recomp_Bozo`, using only the bundled kit.
|
||||
The final packaged launcher stopped the build at 40%, resumed it, staged the native executable and launched it.
|
||||
The complete preparation took 126 seconds on this development PC; this is not a clean-OS performance promise.
|
||||
- The launcher self-test completed normal Play/shutdown (exit 0), English/French settings screenshots,
|
||||
and an intentional child crash with a usable report. Failure paths now fail the self-test instead of returning a false success.
|
||||
- Final packaged menu/movie log: **1.0000** EE/PC, **575,964 ticks/s**, **59.97 fields/s**, movies **29.94–30.00 pictures/s**.
|
||||
`tools/check_timing.py` passes with `TMB_NATIVE_FRAMES=0`. The fresh 2,400-frame accent-path run also passes.
|
||||
- The **actual v0.3.2 updater** installed the unsuffixed migration ZIP. The subsequent new build removed the retired
|
||||
`source/PS2Recomp` marker, preserved player-data sentinels, rebuilt, and started BozoEngine.
|
||||
The new updater separately installed its `-bozo.zip` payload into an old-named `TMB_Recomp` folder and preserved its settings marker.
|
||||
- This candidate-validation stage preceded publication; those test candidates were not published releases.
|
||||
The final v0.4.0 delivery is recorded at the top of this document.
|
||||
|
||||
### Final gameplay and profiling checks (2026-11-06)
|
||||
|
||||
All runs use isolated user folders, the USA disc, engine `9361960` and the packaged build's game code.
|
||||
These figures measure **game-thread work**, not the interval between displayed pictures:
|
||||
|
||||
| Scene | Measured frames | Mean work | Mean p95 | Maximum work | Over 16.7 ms |
|
||||
|---|---:|---:|---:|---:|---:|
|
||||
| 1P, bots active, after 125 s | 4,458 | 3.77 ms | 4.57 ms | 8.2 ms | 0 |
|
||||
| Actual four-player split-screen, after 100 s | 3,136 | 4.51 ms | 5.40 ms | 12.5 ms | 0 |
|
||||
| Effects-heavy story level 20, after 125 s | 4,098 | 2.72 ms | 3.54 ms | 11.2 ms | 0 |
|
||||
|
||||
- 1P and level 20 each completed 12,000 frames; four-player completed 9,000. Gameplay intervals hold about 60
|
||||
updates/presents per second. Whole-run averages including loading are 59.7–59.9 updates/s. Occasional presentation
|
||||
intervals over 20 ms still occur; do not describe this as zero hitches on all hardware.
|
||||
- Repeated the handoff's exact 7,500-frame four-pad command, including captures at 6,000 and 7,000. Its old script
|
||||
actually stays on opponent selection in this real-time build. The previous 42-present/s dip did not recur on that
|
||||
same screen: frames 7,000–7,300 remained at 60 presents/s.
|
||||
- For the real split-screen run, omitted player 1's initial `1292:CROSS/18` from the local `p1_frames.txt` input;
|
||||
the native build has already reached the main menu there, so that old intro-skip press selects ONE PLAYER.
|
||||
Kept all other four-pad events unchanged. Captures at 6,000 and 8,000 show all four views, driving and firing.
|
||||
AI suppression was off; the four-human deathmatch itself has four human vehicles. Bot coverage comes from 1P.
|
||||
- One further historical 1P timing pair (125–195 s) measured 3.77 ms native versus 5.49 ms on the previous runtime,
|
||||
with no game-work frames over budget in either. This is a limited local comparison, not a cross-hardware speedup claim.
|
||||
- Completed the previously unwritten raw-profile output and fixed `hitch.py`'s imported `__file__` namespace in the local
|
||||
profiling tools. A 20-second sample contains 20,475 raw thread samples. Its game-thread pacer segmentation labels
|
||||
100 of 1,129 segments over 16.7 ms, but work samples are similar in the two groups (2.1 versus 1.8 per segment).
|
||||
The largest gaps line up with the profiler's 0.5-second thread enumeration; they cannot be counted as actual missed
|
||||
game frames. The game's own statistics in that interval show 4.51 ms mean, 8.9 ms maximum, zero over budget.
|
||||
Mesh submission and VU work remain the main CPU buckets. Mixer worker/COP2 inlining/GL batching remain optional
|
||||
optimization opportunities; none was introduced without a demonstrated frame-budget problem.
|
||||
- Restarted for 6,000 headless frames with a copy of the card written by the native story run. It reached gameplay
|
||||
without a fault; the four existing card files remain intact. This is restart/readback coverage, not a full-campaign-ending claim.
|
||||
- The new updater also passed in the accented `TMB_Recomp_Bozo` layout, **running from its own bundled Python**.
|
||||
It safely set aside loaded Python DLLs, installed the payload, preserved the player-data marker, and the updated Python starts.
|
||||
|
||||
The source migration and README review are merged through [PR #3](https://github.com/TheBozos/TMB_Recomp/pull/3).
|
||||
The retired fork checkout, Git metadata and both linked worktrees are preserved independently at
|
||||
`D:\TMB_Retired\2026-11-05`; they are no longer an active submodule or local submodule configuration.
|
||||
|
||||
## Limits of the old reference comparisons
|
||||
|
||||
- Native 989SND uses its own timing. Default pinned story/4P/stage runs can differ on opaque play handles or the instant a sound ends.
|
||||
Recorded sound replies let the remaining native game state/draws be checked. Those replies are a checker option and never used by the player build.
|
||||
- The old pinned `save` recording still differs inside the test-only kill-enemies cheat's copied-context guest call at frame 5458.
|
||||
The native campaign run does proceed through the kills, stage transitions and real card writes. Do not describe the old pinned save recording as MATCH.
|
||||
- Audio sample hashes are diagnostic, not an enforced equality claim; the existing handoff documents the few-sample timing differences.
|
||||
- A fresh standard-user Windows OS, SmartScreen/Mark of the Web, physical high-DPI displays and additional human/controller acceptance need real hardware testing.
|
||||
|
||||
## Packaging and updates
|
||||
|
||||
Both player ZIPs carry **the same BozoEngine build**:
|
||||
|
||||
| File | Root folder | Purpose |
|
||||
|---|---|---|
|
||||
| `TMB_Recomp-<version>-bozo.zip` | `TMB_Recomp_Bozo/` | Separate/new installation |
|
||||
| `TMB_Recomp-<version>.zip` | `TMB_Recomp/` | Existing launcher's in-place Update |
|
||||
|
||||
The older ZIP name does not retain the older engine. The existing updater can install the migration ZIP;
|
||||
the new launcher subsequently uses `-bozo.zip` updates regardless of its installation folder name.
|
||||
The corresponding-source ZIP and every SHA-256 accompany a published release.
|
||||
|
||||
Requirements: Windows 10 version 1903 or newer / Windows 11, **AVX2 + FMA**, OpenGL 3.3, about 10 GB free. Only the USA disc is supported.
|
||||
Follow [RELEASE_CHECKLIST.md](RELEASE_CHECKLIST.md). Do not publish a release tag merely because a test artifact builds.
|
||||
|
||||
## Working rules
|
||||
|
||||
- README follows the shared The Bozos project format: preserve its banner/badges, disc notice/hash, status screenshots,
|
||||
milestone/native-layer tables, goal, architecture, requirements, build/run, controls/cheats, disc facts, layout and credits.
|
||||
Updating stale facts is not permission to replace that presentation with a shorter standalone README.
|
||||
- Clean-room rules in `BozoEngine/docs/PLAN.md` still apply: do not read the old fork, its generated code or emulator source when writing engine code.
|
||||
- Push engine changes before the TMB pin; use reviewed branches/PRs and green CI. End commits with a `Co-Authored-By` line.
|
||||
- Do not modify game/disc files or commit derived content. Never modify the owner's real user folder during agent runs.
|
||||
- Keep scratch/builds on D:. Never edit a script while a job runs it, send input to other windows, or kill another project's processes.
|
||||
- The shared benchmark mechanism is for timing runs only; builds and functional checks do not take it. Do not announce its state.
|
||||
|
||||
## Local evidence
|
||||
|
||||
Continuation scratch: `D:\BozoScratch\finish`. Source worktrees: `D:\TMB_bozo` and `D:\BozoEngine`.
|
||||
Logs include `diag.log`, `ctest-final.log`, `replay/report.txt`, `pin-boot.log`, `pin-match1p.log`, `pin-stage6.log`,
|
||||
`save-free.log` and the deliberately retained failing `save-fixes.log` comparison.
|
||||
Final evidence: `final-launcher-shots/selftest.log`, `final-launcher-user/logs/TMB_Recomp.1.log`, `migration3.log`,
|
||||
`native-update3.log`, `future-update3.log`, `scene-1p.log`, `four-player.log`, `scene-stage.log`, `hitch-report.txt`,
|
||||
`scene-hitch.samples` (original), `scene-hitch-symbols.samples` (same samples with the Unicode module path resolved
|
||||
through a hard link to the same executable), and `save-readback.log`.
|
||||
@@ -0,0 +1,88 @@
|
||||
# Native AI hunt and bait forward transforms
|
||||
|
||||
[Particle arc forwards](NATIVE_PARTICLE_ARCS_FORWARD.md) follow with the two particle arc sites.
|
||||
|
||||
Two AI-driving forward returns use native XYZ arithmetic after the
|
||||
[Zoomies and HalTrans weapon forwards](NATIVE_ZOOMIES_HAL_FORWARD.md). Known forward
|
||||
coverage grows from 178 to 180 of 269 returns (89 remain). Known inverse coverage
|
||||
stays 134 of 134; BozoEngine stays at `4a8f70a`.
|
||||
|
||||
| Return PC | Owner | Producer and consumer |
|
||||
| --- | --- | --- |
|
||||
| `103534` | `Vehicle::aiPerformBeadOnHuntCs` (`103308`) | A side offset `(x,0,0)` through the vehicle's basis into frame `+10`, added to the driver's bead point and made relative to the vehicle for the steering angle |
|
||||
| `106af0` | `Vehicle::aiUpdateBaitModeOld` (`1069f8`) | Offset `(0,130,0)` through the target vehicle's basis into frame `+10`, added to the target's position, used to pick the closest attractor point |
|
||||
|
||||
When hunting, the AI keeps a side offset. It is used as is when the AI info flag
|
||||
at `+5b8` is set or the info distance at `+20` is at least 150, and otherwise clamped
|
||||
to ±20. The offset is added to the bead point,
|
||||
made relative to the vehicle, and `atan2f` of its X/Y becomes the steering heading.
|
||||
The driver then checks speed or drives to attack range and turns smoothly.
|
||||
|
||||
In the old bait mode, once the target's counter at `+20d0` reaches 600 and no point
|
||||
has been picked (`driver+20c` is -1), the AI projects a point 130 ahead of the
|
||||
target. It hands that point
|
||||
to `attractGetClosestPoint`, which reads it only through `mathfSubVector`. The
|
||||
closest attractor point becomes the driver's new bead.
|
||||
|
||||
In both owners the result is the frame vector at `+10`. It is read only by
|
||||
`mathfAddVector`, `mathfSubVector`, `attractGetClosestPoint` and scalar X/Y loads.
|
||||
Frame `+1c` is never read. Neither owner reads VU registers, the accumulator or
|
||||
flags. The existing native helper computes separately rounded XYZ, preserves
|
||||
destination W and leaves VU state untouched. Unknown and historical callers keep
|
||||
the original ABI. No engine or gameplay formula changes.
|
||||
|
||||
## Generated comparisons
|
||||
|
||||
Evidence is under `D:/BozoScratch/ai-bead-forward`, against parent `71e5997`
|
||||
(PR #72). Parent headless/window binaries are preserved there and match PR #72's
|
||||
qualified build. Generated bodies, retail data and runtime recordings stay outside
|
||||
Git.
|
||||
|
||||
- Added coverage is 1,024 generated sequences / 64 whole-memory comparisons (caller
|
||||
kinds 283 and 284): helper-boundary continuations and owner entries, across four
|
||||
rounding modes, FTZ/DAZ, RAM aliases, identity/quarter-turn bases and arbitrary W
|
||||
payloads.
|
||||
- Hunt entries start inside the owner at `1034c4`, right after the side offset is
|
||||
built, with the frame as its prologue leaves it.
|
||||
- From there they run the unclamped, +20 and -20 cases, the transform, the bead
|
||||
addition, the vehicle-relative subtraction and `atan2f`.
|
||||
- They stop at `aiDriveToAttackRange`; reaching it is asserted.
|
||||
- Bait entries run from the owner's start through its counter and mode checks, the
|
||||
transform and the real attractor search over two points, to the owner's return.
|
||||
When a point has already been picked, they return without a transform.
|
||||
- Both bases are fixture-known, so every case is checked against an independent
|
||||
identity or quarter-turn result.
|
||||
- Published values are asserted exactly against the original FPU arithmetic: the
|
||||
hunt heading vector after both the addition and the subtraction, and the bait
|
||||
point, the picked index and the bead pointer. The sites publish in 512 and 480
|
||||
cases.
|
||||
- The VU rule from the earlier weapon increments applies. Only forward scratch W at
|
||||
frame `+1c` is normalized for test comparison, after every real consumer.
|
||||
- New caller kinds shift the shared random fill for later rounding modes, so two
|
||||
data-dependent counts in earlier fixtures moved (vehicle tire jumps 705 → 706,
|
||||
real libm errno cases 810 → 853). All scenario-defined counts and assertions are
|
||||
unchanged.
|
||||
- Aggregate caller coverage is 145,920 generated sequences / 7,104 whole-memory
|
||||
comparisons. Historical forward ABI coverage is 10,944 / 684; inverse remains
|
||||
8,576 / 134.
|
||||
|
||||
## Replay and window qualification
|
||||
|
||||
Player, headless runner, historical checker and all eleven native test targets
|
||||
build. All eleven native suites and twelve Python tooling tests pass, with every
|
||||
previous publication assertion enabled.
|
||||
|
||||
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
|
||||
frames. Every recording field matches parent `71e5997`, including the RAM hash on
|
||||
every frame: scratchpad, calls, draws, sound, thread state and EE timing/counts.
|
||||
Sampled 32 MiB RAM images are identical. Strict/default recordings and snapshots
|
||||
are byte exact; strict comparisons report no mismatch. Neither AI return runs on these routes, so both are qualified by the generated owner suite above.
|
||||
|
||||
Fresh isolated window runs, started after the headless replays had finished,
|
||||
complete 6,500 one-player, 6,500 actual four-player and 4,200 movie frames.
|
||||
Reviewed captures show the intro and credits, menus, vehicle and level selection,
|
||||
driving with the HUD and four simultaneous views. Each route has five distinct
|
||||
captures. Stereo 48 kHz, 16-bit WAV recordings contain nonzero audio. Audio device
|
||||
underruns: 58.2 ms of silence in one-player, 35.7 ms in four-player and 24.3 ms in
|
||||
the movie run. These are functional checks, not a performance or flawless-playback
|
||||
claim. AI hunting and baiting in actual play, full campaign and physical controller/hardware acceptance remain open.
|
||||
@@ -0,0 +1,100 @@
|
||||
# Native AI inverses
|
||||
|
||||
Five AI inverse-transform returns now use native record arithmetic, extending the
|
||||
[rigid-body increment](NATIVE_RIGID_BODY_INVERSES.md). Inverse coverage grows
|
||||
from 112 to 117 sites; forward coverage stays at 95. BozoEngine stays at `4a8f70a`.
|
||||
|
||||
| Return PC | Owner | Consumers |
|
||||
| --- | --- | --- |
|
||||
| `1029f8` | `aiMoveBetweenPoints` | Lateral correction, angle wrapping, smooth steering and control-pad updates |
|
||||
| `102c20` | `aiUpdateControlPadForTwoStageAttack` | Lateral correction, smooth steering and composed attack-range update |
|
||||
| `102d74` | `aiDriveToAttackRange` | Relative velocity, range prediction and throttle/brake selection |
|
||||
| `105c68` | `aiCheckForGoodShot` | Target motion, weapon/range/angle gates, look policy and attack-state publication |
|
||||
| `105eec` | `aiCheckForGoodRearShot` | Rear target motion, weapon class, look policy and attack-state publication |
|
||||
|
||||
The existing native inverse snapshots basis/input records, computes separately
|
||||
rounded XYZ and copies first-basis W as meaningful data. All four output
|
||||
components stay exact. Native calls leave VU registers, accumulator, flags and
|
||||
data memory untouched. Unknown callers and historical hosts retain the original
|
||||
ABI. AI branches, angle wrapping, driver steering and attack-state changes stay
|
||||
compiled game code.
|
||||
|
||||
## Generated-code comparisons
|
||||
|
||||
Evidence is under `D:/BozoScratch/ai-inverses`, against main `c7c798e` (PR #46).
|
||||
Generated code, retail data, recordings and captures stay outside Git.
|
||||
|
||||
- Added coverage is 2,560 generated sequences / 160 whole-memory comparisons.
|
||||
Aggregate coverage is 93,696 / 3,840. Four host rounding modes, denormal
|
||||
controls, RAM aliases, rotated bases and arbitrary first-basis W are covered.
|
||||
- Each return has 256 inverse-boundary cases through its real consumer/return
|
||||
and 256 producer cases. Four owners have complete entries (1,024 cases).
|
||||
The larger navigation owner starts at its bounded steering producer
|
||||
`102944` (256 cases), then completes its real scalar tail; the whole navigation
|
||||
state machine and its earlier pathfinding calls are outside these fixtures.
|
||||
- Producer reach assertions distinguish active paths and pre-transform gates:
|
||||
896 producer cases reach the selected inverse and 384 skip it. The navigation
|
||||
prefix covers seven rejection gates and its active correction path. Two-stage
|
||||
attack entries also run the real composed attack-range function.
|
||||
- The real `boundFAngle` and `driverSmoothlyTurn` execute, including angle wraps,
|
||||
left/right steering and control-pad stores. Range entries exercise throttle,
|
||||
brake, special attack range, weapon range and predicted relative motion.
|
||||
- Shot entries cover low/high turning rate, low target speed, lateral thresholds,
|
||||
weapon classes, range/angle rejection, look policy and real attack-state stores.
|
||||
The deterministic game-mode branch of look policy is used; its optional random
|
||||
branch remains outside these fixtures. Successful attack-state publication is
|
||||
required for both front and rear shots, not merely early rejection.
|
||||
- CPU outside retired VU, outgoing host FP effects, clocks/checkpoints, per-site
|
||||
inverse counts, steering/look/attack helper counts and final memory agree.
|
||||
Native VU stays untouched through the complete consumers. No new W exclusion
|
||||
or VU reconstruction is added; inverse XYZW is compared in full.
|
||||
- Whole-memory producer samples select active transforms. Historical inverse ABI
|
||||
coverage grows to 7,488 / 117 cases / whole-memory checks. Forward remains
|
||||
5,504 / 344. Existing hierarchy coverage retains 786,432 helper cases / 384
|
||||
whole-memory, 8,000 geometric edges, 1,024 complete BSP callers / 32 whole-memory
|
||||
and 2,048 unknown ABI cases.
|
||||
|
||||
## Replay qualification
|
||||
|
||||
Player, headless runner, historical checker and all eleven native test targets
|
||||
build. All eleven native suites and twelve Python tooling tests pass. The final
|
||||
caller suite requires successful front/rear attack-state publication in 392 / 352
|
||||
comparison cases respectively.
|
||||
|
||||
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
|
||||
frames. Every recorded field matches the immediate parent: raw RAM, scratchpad,
|
||||
calls, draws, sound, thread state and EE timing/counts. Sampled 32 MiB RAM images
|
||||
are identical too. Strict/default recording files and snapshots are byte exact;
|
||||
strict result comparisons report no mismatch. No new RAM-padding difference is
|
||||
introduced relative to the rigid-body parent.
|
||||
|
||||
All five new sites execute in 1P: navigation 640 calls, two-stage steering 448,
|
||||
attack range 1,370, front shot 1 and rear shot 1,473 (3,932 total). Four-player
|
||||
makes no AI inverse calls in this four-human scenario. The front-shot runtime
|
||||
sample is sparse; its broader branches and successful publication are qualified
|
||||
by the generated-code fixtures.
|
||||
|
||||
## Window qualification
|
||||
|
||||
Fresh isolated runs complete 6,500 one-player, 6,500 actual four-player and
|
||||
4,200 movie frames. Reviewed captures show level loading, advancing gameplay,
|
||||
AI opponents, driving/combat/effects, four simultaneous views, decoded intro
|
||||
images and return to the menu. Each route has five distinct captures.
|
||||
|
||||
Windowed 1P reaches 2,545 new inverse calls: two-stage steering 292, attack range
|
||||
1,412, front shot 1 and rear shot 840; the navigation inverse is cold in this
|
||||
windowed sample but reached in the headless replay. Four-player and movies make
|
||||
no AI inverse calls. Stereo 48 kHz WAV captures contain nonzero audio. Device
|
||||
underruns remain: 60.2 ms silence in 1P, 33.6 ms in 4P and 17.6 ms in movies.
|
||||
These are functional checks, not a timing or flawless-playback claim. Full
|
||||
campaign, all navigation branches, random look-policy paths and physical
|
||||
controller/hardware acceptance remain outside this increment.
|
||||
|
||||
## Remaining scope
|
||||
|
||||
Current generated source contains 134 inverse-helper and 269 forward-helper
|
||||
returns. Of these two families, 17 inverse and 174 forward sites remain outside
|
||||
the native allowlists: 191 total. This is a call-site inventory, not a count of
|
||||
all remaining emulation. Remaining inverse groups include driver/boss helpers,
|
||||
HUD/radar, rollover, damage, lighting, a tire helper and a particle helper.
|
||||
Additional inline arithmetic and forward transforms remain separate work.
|
||||
@@ -0,0 +1,105 @@
|
||||
# Native attachment and environment forward transforms
|
||||
|
||||
Five attachment/environment forward returns use native XYZ arithmetic after the
|
||||
[vehicle-collision forward increment](NATIVE_COLLISION_FORWARD.md). Coverage
|
||||
grows from 119 to 124 of 269 known forward returns (145 remain). Known inverse
|
||||
coverage stays 134 of 134. BozoEngine stays at `4a8f70a`.
|
||||
|
||||
| Return PC | Owner | Qualified consumer |
|
||||
| --- | --- | --- |
|
||||
| `129e58` | `EnvHeli::UpdateTrans` | Translated helicopter position, height smoothing and real coordinate-system grid reparenting |
|
||||
| `137cac` | `Cable::Update` | Parent-space offset, pickup/cable position, grid membership and lifetime/type-dispatch staging |
|
||||
| `1b2d1c` | `Weapon::UpdateGasCanTrans` | Smoothed, frame-scaled movement, real height query, child position and lifetime fields |
|
||||
| `1b3d30` | `Weapon::UpdateSawBladeTrans` | Smoothed, frame-scaled movement and translated coordinate-system position |
|
||||
| `1b3e00` | `Weapon::UpdateTaxiSpikeTrans` | Smoothed, frame-scaled movement and translated coordinate-system position |
|
||||
|
||||
Native returns compute separately rounded XYZ, preserve destination W and leave
|
||||
VU registers, accumulator, flags and data memory untouched. The original scalar
|
||||
smoothing, frame accessors, angle updates, height queries and grid/lifetime logic
|
||||
remain. Unknown/historical callers retain the original ABI. No engine or game
|
||||
motion formula is changed.
|
||||
|
||||
## Generated-code comparisons
|
||||
|
||||
Evidence is under `D:/BozoScratch/attachment-forward`, against parent `2ee3dc9`
|
||||
(PR #54). Parent headless/window binaries are preserved there for diagnostics.
|
||||
Generated bodies, retail data and runtime recordings stay outside Git.
|
||||
|
||||
- Added coverage is 2,560 generated sequences / 160 whole-memory comparisons.
|
||||
Each return has 256 helper-boundary sequences through its real tail and 256
|
||||
producer-entry sequences. Four rounding modes, FTZ/DAZ, RAM aliases, rotated
|
||||
bases, zero/tiny/signed vectors, zero/one/two frame counts, arbitrary W payloads
|
||||
and actual in-place scratch outputs are covered.
|
||||
- Helicopter entries complete the original owner: local movement, world-position
|
||||
addition, scalar height smoothing and `hdReparentCsGrid`. Enabled and disabled
|
||||
grid gates are included.
|
||||
- Cable entries retain the parent's offset transform, actual child-coordinate
|
||||
position publication and grid update, disabled-child state and lifetime
|
||||
increments through 301. Expiry cases start from the real owner and stop at
|
||||
`ChangePickupType` after position/grid publication, timer reset and type-index
|
||||
staging. Pickup replacement itself is not stubbed or claimed as complete-owner
|
||||
coverage; other entries complete the owner.
|
||||
- Grid entries execute real sphere-cell calculations, pool allocation, linked-list
|
||||
insertion and old-cell removal/deallocation. Explicit bucket/node ownership and
|
||||
cached-cell assertions verify translated positions reach the correct real cell.
|
||||
There are 128 successful removal/reinsertion cases, plus disabled-grid cases.
|
||||
- Gascan entries complete the original movement/smoothing/frame-count path,
|
||||
parked three-angle update, query/publish gates, child-coordinate publication and
|
||||
lifetime fields. Height fixtures use the actual `hdHatTest`, disabled-terrain
|
||||
`terrainGetHAT` and an empty resident collision grid, preserving the original
|
||||
miss/fallback behavior. They do not claim terrain-hit coverage. No height or
|
||||
collision result is stubbed. Expired-state entries use the actual non-player
|
||||
message gate; player-message dispatch is outside these fixtures.
|
||||
- Saw/taxi entries complete the original smoothing, three actual frame-accessor
|
||||
calls, local movement transform and world-coordinate addition.
|
||||
- Explicit per-site and smoothing/frame/grid/query/angle counts are required.
|
||||
Known position assertions pass 32 cases per owner, including gascan child
|
||||
positions. Cable enabled/disabled and expiry states, gascan expiry state,
|
||||
grid cache IDs, bucket pointers and node ownership are checked before any W
|
||||
normalization. CPU outside retired VU, clocks/checkpoints, host FP effects,
|
||||
action counts and final memory agree. Native VU stays untouched throughout.
|
||||
- Opaque forward W is restricted to the real owner's `SP+0c`. Exact output counts
|
||||
and addresses distinguish helper boundaries from complete-entry frames of
|
||||
`0x30`, `0x40` or `0x60` bytes. Disabled producer gates have no exclusion. Original W
|
||||
remains intact through every real consumer, then is normalized for comparison
|
||||
only. Meaningful inverse W remains fully compared in the earlier suites.
|
||||
No runtime RAM mask, recorded-hash normalization or VU-bank reconstruction is
|
||||
introduced.
|
||||
- Aggregate caller coverage is 117,248 generated sequences / 5,312 whole-memory
|
||||
checks. Historical forward ABI coverage grows to 7,360 / 460; inverse remains
|
||||
8,576 / 134. Existing hierarchy/BSP/edge/unknown-ABI coverage and earlier AI,
|
||||
vehicle/light, final inverse, driver and collision assertions stay enabled.
|
||||
|
||||
## Replay and window qualification
|
||||
|
||||
Player, headless runner, historical checker and all eleven native test targets
|
||||
build. All eleven native suites and twelve Python tooling tests pass; every
|
||||
previous publication assertion remains enabled.
|
||||
|
||||
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
|
||||
frames. Every recording field matches parent `2ee3dc9`: raw RAM, scratchpad,
|
||||
calls, draws, sound, thread state and EE timing/counts. Sampled 32 MiB RAM images
|
||||
are identical. Strict/default recording files and snapshots are byte exact,
|
||||
with no strict mismatch. This increment adds no RAM-hash difference.
|
||||
|
||||
Default one-player reaches cable `137cac` 3,902 times and taxi-spike `1b3e00`
|
||||
494 times; four-player reaches cable 3,798 times. Helicopter, gascan and saw-blade
|
||||
sites are cold on these headless routes and are qualified by their generated
|
||||
owners and real consumers described above.
|
||||
|
||||
Fresh isolated window runs complete 6,500 one-player, 6,500 actual four-player
|
||||
and 4,200 movie frames. Reviewed captures show level loading, advancing driving,
|
||||
AI opponents, combat/effects, four simultaneous views, decoded intro footage and
|
||||
return to the menu. Each route has five distinct captures. Stereo 48 kHz,
|
||||
16-bit WAV recordings contain nonzero audio.
|
||||
|
||||
Windowed one-player reaches cable 1,706 times and gascan 46 times; four-player
|
||||
reaches cable 1,816 times. Movies make no calls to these five sites. Helicopter
|
||||
and saw-blade sites remain cold across these runtime routes, and taxi-spike
|
||||
runtime reach comes from the headless one-player route. Complete generated
|
||||
entries retain the stated cold-site coverage and expiry/query limits.
|
||||
|
||||
Device underruns remain: 30.2 ms silence in 1P, 29.5 ms in 4P and 18.4 ms in movies.
|
||||
These are functional checks, not a timing or flawless-playback claim. Full
|
||||
campaign, every attachment/terrain-hit/pickup-replacement configuration and
|
||||
physical-controller/hardware acceptance remain outside this increment.
|
||||
@@ -0,0 +1,118 @@
|
||||
# Native attractor-group spatial transforms
|
||||
|
||||
Three inverse-transform returns now use native record calculations, extending
|
||||
the [tow-truck increment](NATIVE_TOW_TRUCK.md). Forward coverage stays at 79 sites;
|
||||
inverse coverage grows from 86 to 89. BozoEngine remains pinned to `4a8f70a`.
|
||||
|
||||
| Return PC of helper `1da1e8` | Owner | Consumers |
|
||||
| --- | --- | --- |
|
||||
| `108d6c` | `attractGetGroupTestPointIsIn` (`108c60`) | Local XY bounds and ordered group selection |
|
||||
| `109870` | `attractGetCenterOfGroup` (`1097c8`) | Rotated half-extents plus group origin, then XYZ publication |
|
||||
| `1099a0` | `attractGetRandomPositionInGroup` (`1098e8`) | Rotated random offsets plus group origin, then XYZ publication |
|
||||
|
||||
The existing native inverse calculation snapshots operands, computes separately
|
||||
rounded XYZ and copies the first basis vector's W as data. Native calls leave VU
|
||||
registers, accumulator, flags and data memory untouched. Historical hosts and
|
||||
unknown callers keep the complete original ABI. Group ordering, height gates,
|
||||
boundary comparisons, random generation, rotation construction and world-position
|
||||
publication remain compiled game code.
|
||||
|
||||
## Generated consumers and numerical checks
|
||||
|
||||
Local evidence is under `D:/BozoScratch/attractor-transforms`, against main
|
||||
`0bf979a` (PR #39). Generated game code, retail data, recordings and captures stay
|
||||
outside Git.
|
||||
|
||||
- Added coverage is 1,536 generated consumer sequences / 96 whole-memory
|
||||
comparisons. Aggregate coverage is 71,168 / 2,432. All final fixture memory,
|
||||
including W, is compared without a forward-W exclusion for the new cases.
|
||||
CPU outside retired VU, outgoing host FP effects, clocks/checkpoints and memory
|
||||
agree; native VU stays untouched. Four host rounding modes, denormal controls,
|
||||
RAM aliases and arbitrary opaque W payloads are covered.
|
||||
- Every point-test case runs the complete selection tail and return, including
|
||||
subsequent group iterations. Literal boundary fixtures verify the rotated
|
||||
strict bounds, signed zero and values immediately inside/outside the upper
|
||||
bound. Another 256 cases enter the actual function: empty/negative counts,
|
||||
height rejection, rotated/unrotated groups, inclusive unrotated upper bounds,
|
||||
first-match ordering and a third-group match after two rotated misses.
|
||||
- Center and random-position cases run through their complete publication tails,
|
||||
retaining destination W and publishing group Z. Another 256 cases for each
|
||||
enter at the actual function entry, including zero rotation, positive/negative
|
||||
rotation and zero/reversed extents. Rotation inputs stay within thirty degrees;
|
||||
wider trigonometric argument reduction is outside these fixtures.
|
||||
- Random-position entry cases execute the actual generated `mathfRandf` and
|
||||
`rand`, with guest-backed generator state restored between comparison runs.
|
||||
An explicit assertion verifies two real `rand` dispatches per entry. These
|
||||
fixtures exercise the generated producer; runtime native-library behavior is
|
||||
separately covered by the paired gameplay routes.
|
||||
- Historical inverse coverage grows to 5,696 / 89 cases / whole-memory checks;
|
||||
historical forward coverage stays at 4,480 / 280. Existing hierarchy coverage
|
||||
retains 786,432 helper cases / 384 whole-memory, 8,000 geometric edges, 1,024
|
||||
complete BSP callers / 32 whole-memory and 2,048 unknown ABI cases.
|
||||
- All eleven native suites and twelve Python tooling tests pass. Current emitted
|
||||
inverse-transform vector results are stored before MXCSR restoration; the
|
||||
original/native comparisons pass in all four caller rounding modes.
|
||||
|
||||
## Gameplay and RAM boundary
|
||||
|
||||
Default and strict builds complete 9,500 one-player and 8,500 actual four-player
|
||||
frames. Strict/default recording files and full 32 MiB snapshots are identical.
|
||||
Against the tow-truck baseline, every scratchpad, call, draw, sound, thread, count
|
||||
and EE-clock field agrees. The entire four-player recording and both sampled full
|
||||
RAM snapshots also agree. The three sites execute 14,567 / 25,280 / 3 times in
|
||||
one-player respectively (39,850 total); all are cold in this four-player route.
|
||||
Four-player therefore supplies general regression coverage, not site reach.
|
||||
Default routes make zero original-helper comparisons and execute zero VU0
|
||||
microprograms. Counts establish coverage, not a measured speedup.
|
||||
|
||||
One-player RAM hashes differ on 664 frames in intervals 7,621–7,629,
|
||||
7,732–8,066 and 8,446–8,765. A temporary paired observer reproduces both complete
|
||||
qualified recordings and every raw callback hash. Every difference is confined
|
||||
to four `Vehicle+52c` peel-out vector W fields:
|
||||
|
||||
| RAM word | Baseline / native | Differing frames |
|
||||
| --- | --- | --- |
|
||||
| `26077c` | `00000000` / `02000200` | 9 |
|
||||
| `26617c` | `00000000` / `02000200` | 9 |
|
||||
| `268e7c` | `00000000` / `02000200` | 664 |
|
||||
| `25da7c` | `00000000` / `42700000` | 23 |
|
||||
|
||||
Every differing word matches its last observed writer: the existing forward
|
||||
return `1abd60` in `vehicleUpdatePeelingOut`. The inherited `VF16.W` supplies those
|
||||
bits; XYZ is identical. Its `vehicleSetCsMat` consumer uses XYZ-only addition and
|
||||
does not consume peel-out W. The complete generated coordinate-system consumer
|
||||
tests now explicitly include all three observed W payloads across rounding modes
|
||||
and matrix aliases, alongside the existing fuzz cases.
|
||||
|
||||
Replacing only these four words on a diagnostic RAM copy reproduces every
|
||||
baseline frame hash, with zero unaccounted frames or writer-provenance mismatches.
|
||||
No RAM mask or VU-state reconstruction ships. The three temporarily instrumented
|
||||
production sources and their original object hashes were restored exactly; all
|
||||
eleven rebuilt native suites pass again.
|
||||
|
||||
After observer removal, clean default/strict recordings and full snapshots
|
||||
reproduce the qualified results byte-for-byte. Player, headless and checker
|
||||
binaries contain no temporary observer markers.
|
||||
|
||||
Fresh 6,500-frame one-player and actual four-player windowed routes and a
|
||||
4,200-frame movie/menu route complete through clean exit, with isolated scratch
|
||||
user data. Reviewed captures show decoded movie pictures (1,000), return to menu
|
||||
(1,800), Junkyard loading (one-player 4,500), active one-player gameplay
|
||||
(5,500 / 6,300), and four advancing snow-arena views with snow/tire effects
|
||||
(four-player 5,500 / 6,300). Windowed one-player reaches the point-test and center
|
||||
sites 6,613 / 11,993 times; random-position inverse is cold in that shorter route.
|
||||
All three are cold in the four-player and movie routes. These captures establish
|
||||
bounded functionality, not pixel-exact windowed or console parity.
|
||||
|
||||
All three stereo 48 kHz WAV recordings contain audio. Device logs report
|
||||
13.4 / 61.3 / 39.0 ms of silence (movie / one-player / four-player), with underruns
|
||||
and dropped frames. Deterministic gameplay sound matches the baseline; flawless
|
||||
device audio and subjective listening are not claimed.
|
||||
|
||||
## Remaining scope
|
||||
|
||||
These two helper inventories now contain 79 native forward and 89 native inverse
|
||||
sites. Outside their allowlists remain 190 forward and 45 inverse sites, 235 in
|
||||
total across the game. This is a structural source inventory, not a live cost
|
||||
measurement, and excludes other helper families and inline VU operations. Full
|
||||
campaign acceptance and console visual/audio parity remain separate work.
|
||||
@@ -0,0 +1,95 @@
|
||||
# Native sinking blimp forward transforms
|
||||
|
||||
[Falling junk jet forwards](NATIVE_JET_DEATH_FORWARD.md) follow with six more environment sites.
|
||||
|
||||
Two blimp death forward returns use native XYZ arithmetic after the
|
||||
[gas tank forwards](NATIVE_GASTANK_FORWARD.md). Known forward coverage grows from
|
||||
155 to 157 of 269 returns (112 remain). Known inverse coverage stays 134 of 134;
|
||||
BozoEngine stays at `4a8f70a`.
|
||||
|
||||
| Return PC | Owner | Producer and consumer |
|
||||
| --- | --- | --- |
|
||||
| `10eee0` | `Blimp::UpdateDeath` (`10ee18`) | The blimp's velocity at `+20` through its rebuilt coordinate-system basis, into the static vector `0x4fc200`, added to its position |
|
||||
| `10efa0` | `Blimp::UpdateDeath` (`10ee18`) | A random explosion offset in `0x4fc200`, transformed in place, added to the position and handed to the effect and explosion sound |
|
||||
|
||||
While the blimp is more than 100 units above the ground (`hdHatTest`), it rolls
|
||||
(smoothed speed, accumulated and clamped roll, `mathfRotMatrixRPH`), moves by the
|
||||
transformed velocity and sinks by 0.5. A 1-in-9 roll then builds an explosion offset
|
||||
(±80 by a raw `rand` bit, random Y/Z), transforms it in place and adds the position.
|
||||
The result goes to `particleCreateFx` and `ExplosionSound::playBlimpExplosion`.
|
||||
Cars within 150 (Manhattan, 2D) of the blimp are set on fire. Near the ground it
|
||||
crash-lands instead, with no transform.
|
||||
|
||||
`0x4fc200` is a function-local static: no other code in the game references it.
|
||||
Its W (`0x4fc20c`) is never read. After the first transform it is read only by
|
||||
`mathfAddVector`. The explosion offset's X/Y/Z are rewritten before the second
|
||||
transform, which reads only X/Y/Z. The explosion point is then read only through:
|
||||
|
||||
- `mathfAddVector` in `particleCreateFx` and its child effects;
|
||||
- `mathfManhatDist` in `calculateRangedVolume`;
|
||||
- `mathfSubVector` in `calculatePanAngle`, both reached from
|
||||
`calcDualMonoMixVolPan`.
|
||||
|
||||
The owner reads no VU registers, accumulator or flags. The existing native helper
|
||||
computes separately rounded XYZ, preserves destination W and leaves VU state
|
||||
untouched. It reads its input before writing, so the in-place transform is safe.
|
||||
Unknown and historical callers keep the original ABI. No engine or gameplay formula
|
||||
changes.
|
||||
|
||||
## Generated comparisons
|
||||
|
||||
Evidence is under `D:/BozoScratch/blimp-death-forward`, against parent `bb68515`
|
||||
(PR #65). Parent headless/window binaries are preserved there and match PR #65's
|
||||
qualified build. Generated bodies, retail data and runtime recordings stay outside
|
||||
Git.
|
||||
|
||||
- Added coverage is 1,024 generated sequences / 64 whole-memory comparisons (caller
|
||||
kinds 260 and 261): helper-boundary continuations and full-owner entries, across
|
||||
four rounding modes, FTZ/DAZ, RAM aliases, identity/quarter-turn bases and
|
||||
arbitrary W payloads.
|
||||
- Full entries run the real `hdHatTest` on the fixture's empty height grid, with
|
||||
the ground set either 1,030 below the blimp (drift) or 30 below (crash landing).
|
||||
They then run the roll smoothing and clamping, matrix rebuild, transform, position
|
||||
update and sink. The fixture seeds the game's actual libc `rand` state, so the
|
||||
1-in-9 explosion roll is taken or skipped as intended. With no explosion, the
|
||||
owner checks the empty vehicle lists and returns normally. Explosion and crash
|
||||
cases stop at `particleCreateFx`.
|
||||
- Helper-boundary outputs are checked against an independent identity or
|
||||
quarter-turn result. Full entries rebuild the basis from the roll first, so those
|
||||
are covered by the native/original comparison.
|
||||
- The published values are asserted exactly against the original FPU arithmetic:
|
||||
the drift position (X/Y, and Z after the 0.5 sink), and the explosion point in
|
||||
`0x4fc200`. Cases where both transforms run check both, in order. The drift site
|
||||
publishes in 704 cases, the explosion site in 544.
|
||||
- The VU rule from the earlier weapon increments applies. Only the static's forward
|
||||
W at `0x4fc20c` is normalized for test comparison, after every real consumer.
|
||||
- New caller kinds shift the shared random fill for later rounding modes, so two
|
||||
data-dependent counts in earlier fixtures moved (vehicle tire jumps 709 → 714,
|
||||
real libm errno cases 820 → 862). All scenario-defined counts and assertions are
|
||||
unchanged.
|
||||
- Aggregate caller coverage is 134,144 generated sequences / 6,368 whole-memory
|
||||
comparisons. Historical forward ABI coverage is 9,472 / 592; inverse remains
|
||||
8,576 / 134.
|
||||
|
||||
## Replay and window qualification
|
||||
|
||||
Player, headless runner, historical checker and all eleven native test targets
|
||||
build. All eleven native suites and twelve Python tooling tests pass, with every
|
||||
previous publication assertion enabled.
|
||||
|
||||
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
|
||||
frames. Every recording field matches parent `bb68515`: raw RAM, scratchpad,
|
||||
calls, draws, sound, thread state and EE timing/counts. Sampled 32 MiB RAM images
|
||||
are identical. Strict/default recordings and snapshots are byte exact; strict
|
||||
comparisons report no mismatch. Neither blimp death return runs on these routes, so
|
||||
both are qualified by the generated owner suite above.
|
||||
|
||||
Fresh isolated window runs, started after the headless replays had finished,
|
||||
complete 6,500 one-player, 6,500 actual four-player and 4,200 movie frames.
|
||||
Reviewed captures show the intro and credits, menus, vehicle and level selection,
|
||||
driving with the HUD and four simultaneous views. Each route has five distinct
|
||||
captures. Stereo 48 kHz, 16-bit WAV recordings contain nonzero audio. Audio device
|
||||
underruns: 58.5 ms of silence in one-player, 53.4 ms in four-player and 36.9 ms in
|
||||
the movie run. These are functional checks, not a performance or flawless-playback
|
||||
claim. A blimp destroyed in actual play, full campaign and physical
|
||||
controller/hardware acceptance remain open.
|
||||
@@ -0,0 +1,107 @@
|
||||
# Native BlowDebris forward transforms
|
||||
|
||||
[The last three persistent-field sites](NATIVE_PERSISTENT_FORWARD.md) complete the forward coverage.
|
||||
|
||||
The six `DebrisStuff::BlowDebris` forward returns use native XYZ arithmetic after the
|
||||
[HUD laser batch](NATIVE_HUD_LASER_FORWARD.md). Known forward coverage grows from 260
|
||||
to 266 of 269 returns (3 remain). Known inverse coverage stays 134 of 134; BozoEngine
|
||||
stays at `4a8f70a`.
|
||||
|
||||
`DebrisStuff::BlowDebris` (`120480`) blows an object apart. The debris table at `s7`
|
||||
has `0xb20` bytes per entry, and each piece's velocity sits at `+120 + 16k`. The
|
||||
piece type (`*hierhead & 0x3f`) selects the branch:
|
||||
|
||||
| Return PC | Output | Producer and consumer |
|
||||
| --- | --- | --- |
|
||||
| `120788` | frame `+10` | Type 3: the piece's offset (hierhead `+10`) goes through the blast matrix at frame `+30`. Its X, Y, Z are added as scalars to a position into the piece's hierarchy node `+10`, then aimed (`mathfRotationFromVector`) |
|
||||
| `120838` | velocity (persistent) | Type 3: a random spin vector in frame `+10` goes through the matrix into the piece's velocity |
|
||||
| `1208dc` | frame `+10` | Type 4: like `120788`, in place |
|
||||
| `1209a0` | velocity (persistent) | Type 4: like `120838` |
|
||||
| `120b28` | velocity (persistent) | Other types: like `120838` |
|
||||
| `120c3c` | frame `+20` | With a push requested: the push goes through the matrix; its X and Y are added to the velocity |
|
||||
|
||||
No code reads these outputs' W:
|
||||
- **Frame outputs:** read as scalars X/Y/Z and by `mathfRotationFromVector` (XYZ).
|
||||
The owner never loads frame `+1c` or `+2c`.
|
||||
- **Debris velocity:** the debris init (`120228`, `120350`) and `Debris::Update`
|
||||
(`120e20`) read and write only `+120/+124/+128`. Every other `+12c` load in the
|
||||
generated code is an unrelated integer field or a stack slot.
|
||||
|
||||
The owner reads no VU registers, accumulator or flags. `1208dc` is in place, so the
|
||||
input is read whole before the output is written. The existing native helper computes
|
||||
separately rounded XYZ, preserves destination W and leaves VU state untouched.
|
||||
Unknown and historical callers keep the original ABI. No engine or gameplay formula
|
||||
changes.
|
||||
|
||||
## Generated comparisons
|
||||
|
||||
Evidence is under `D:/BozoScratch/blow-debris-forward`, against parent `c6d7787`
|
||||
(PR #90). Parent headless/window binaries are preserved there and match PR #90's
|
||||
qualified build. Generated bodies, retail data and runtime recordings stay outside
|
||||
Git.
|
||||
|
||||
- Added coverage is 3,072 generated sequences / 192 whole-memory comparisons (caller
|
||||
kinds 365 to 370). They are helper-boundary continuations and entries at the
|
||||
call-return label before each transform (`120774`, `12080c`, `1208c8`, `120974`,
|
||||
`120aec`, `120c2c`), across four rounding modes, FTZ/DAZ, RAM aliases,
|
||||
identity/quarter-turn bases and arbitrary W payloads.
|
||||
- These outputs are not consumed by `mathfAddVector`. At each run's stop, the
|
||||
harness therefore reads the pending transform's output back from its own
|
||||
destination, untouched since, and records it with a zero base. The stops are
|
||||
`mathfRotationFromVector`, `mathfCopyVector`, `mathfRPHFromMatrix` and
|
||||
`mathfRand`.
|
||||
- Every basis is fixture-known, so every site is checked against an independent
|
||||
identity or quarter-turn result. Published values are asserted exactly against the
|
||||
original FPU arithmetic: the hierarchy node position (`120788`, `1208dc`) and the
|
||||
velocity after the push (`120c3c`). Publications: 512 for each site.
|
||||
- The VU rule from the earlier weapon increments applies. Only forward W (frame
|
||||
`+1c`, `+2c` or the velocity's `+12c`) is normalized for test comparison, after
|
||||
every real consumer.
|
||||
- New caller kinds shift the shared random fill for later rounding modes, so two
|
||||
data-dependent counts in earlier fixtures moved (vehicle tire jumps 707 → 709,
|
||||
real libm errno cases 859 → 819). All scenario-defined counts and assertions are
|
||||
unchanged.
|
||||
- Aggregate caller coverage is 189,952 generated sequences / 9,856 whole-memory
|
||||
comparisons. Historical forward ABI coverage is 16,448 / 1,028; inverse remains
|
||||
8,576 / 134.
|
||||
|
||||
## Replay and window qualification
|
||||
|
||||
Player, headless runner, historical checker and all eleven native test targets
|
||||
build. All eleven native suites and twelve Python tooling tests pass, with every
|
||||
previous publication assertion enabled.
|
||||
|
||||
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
|
||||
frames. Strict/default recordings and snapshots are byte exact; strict comparisons
|
||||
report no mismatch. Four returns are live on the one-player route: `120788` and
|
||||
`120838` run natively 7 times each, `1208dc` and `1209a0` 34 times each.
|
||||
`120b28` and `120c3c` are cold on these routes and are qualified by the generated
|
||||
owner suite above.
|
||||
|
||||
**One recorded difference, proven to be a dead W slot.** This applies the rule
|
||||
accepted for the [machine-gun increment](NATIVE_MACHINE_GUN_FORWARD.md). Against
|
||||
parent `c6d7787`, the four-player recording matches on every field. The one-player
|
||||
recording matches on every field except the end-of-frame RAM hash. That hash differs
|
||||
on 309 frames (6,899 to 7,207, then matches again), and the sampled RAM image
|
||||
differs in the same single word.
|
||||
|
||||
- A RAM dump right after frame 6,899 shows exactly one differing word, `0x8fefdc`:
|
||||
the parent has `00000000`, the native build `42700000`.
|
||||
- A temporary logging build showed `1208dc`'s output at `0x8fefd0` (`sp =
|
||||
0x8fefc0`), so the word is that transform's dead frame `+1c` W slot.
|
||||
- The same temporary build wrote a NaN pattern into the W of every BlowDebris
|
||||
output, including the persistent debris velocities. Over the full one-player
|
||||
route only the RAM hash differed from the parent: calls, draws, sound, thread
|
||||
state, EE timing and every count matched.
|
||||
|
||||
The experiment was not committed; the qualified binary was restored afterwards and
|
||||
matches the recorded hash.
|
||||
|
||||
Fresh isolated window runs, started after the headless replays had finished,
|
||||
complete 6,500 one-player, 6,500 actual four-player and 4,200 movie frames.
|
||||
Reviewed captures show the intro and credits, menus, vehicle and level selection,
|
||||
driving with the HUD and four simultaneous views. Each route has five distinct
|
||||
captures. Stereo 48 kHz, 16-bit WAV recordings contain nonzero audio. Audio device
|
||||
underruns: 55.8 ms of silence in one-player, 26.2 ms in four-player and 15.0 ms in
|
||||
the movie run. These are functional checks, not a performance or flawless-playback
|
||||
claim. Full campaign and physical controller/hardware acceptance remain open.
|
||||
@@ -0,0 +1,76 @@
|
||||
# Native FinalBoss movement forward transforms
|
||||
|
||||
[Launcher special-weapon forwards, first batch](NATIVE_SPECIAL_GUNS_FORWARD.md) follow with five UpdateSpecial sites.
|
||||
|
||||
Two FinalBoss movement forward returns use native XYZ arithmetic after the
|
||||
[FinalBoss gun-shot forwards](NATIVE_BOSS_SHOTS_FORWARD.md). Known forward coverage
|
||||
grows from 194 to 196 of 269 returns (73 remain). Known inverse coverage stays 134
|
||||
of 134; BozoEngine stays at `4a8f70a`.
|
||||
|
||||
| Return PC | Owner | Producer and consumer |
|
||||
| --- | --- | --- |
|
||||
| `111788` | `FinalBoss::UpdateTrans` (`111550`) | The boss velocity at `+50` (its Y just smoothed toward the forward speed) through the boss's own basis at `+a0` into frame `+0`, added to its coordinate-system position; the boss is then reparented in the grid |
|
||||
| `111cc4` | `FinalBoss::UpdateDeath` (`111c50`) | The same velocity after the death roll rebuilds the coordinate-system matrix, added to the position, then probed with `hdHatTest` |
|
||||
|
||||
Both results are the frame vector at `+0`. It is read only by `mathfAddVector`.
|
||||
`hdHatTest` receives the same slot only as an output, which it writes with
|
||||
`mathfCopyVector`/`mathfSetFVector`. Frame `+0c` is never read. Neither owner reads
|
||||
VU registers, the accumulator or flags. The existing native helper computes
|
||||
separately rounded XYZ, preserves destination W and leaves VU state untouched.
|
||||
Unknown and historical callers keep the original ABI. No engine or gameplay formula
|
||||
changes.
|
||||
|
||||
The third non-shot boss site, `FinalBoss::CheckCollision` (`11201c`), hands its
|
||||
point to `hdPntSphereTest`. It stays with the deferred collision-system group
|
||||
(Ferris wheel and RockHD).
|
||||
|
||||
## Generated comparisons
|
||||
|
||||
Evidence is under `D:/BozoScratch/boss-move-forward`, against parent `75e7827`
|
||||
(PR #75). Parent headless/window binaries are preserved there and match PR #75's
|
||||
qualified build. Generated bodies, retail data and runtime recordings
|
||||
stay outside Git.
|
||||
|
||||
- Added coverage is 1,024 generated sequences / 64 whole-memory comparisons (caller
|
||||
kinds 299 and 300): helper-boundary continuations and owner entries, across four
|
||||
rounding modes, FTZ/DAZ, RAM aliases, identity/quarter-turn bases and arbitrary W
|
||||
payloads.
|
||||
- `UpdateTrans` entries start after the forward-speed smoothing, at the label where
|
||||
its result is stored into the velocity, and vary that speed's sign.
|
||||
- `UpdateDeath` entries start after the death roll's `mathfRotMatrixRPH`.
|
||||
- Each runs the transform and the position update. They stop at
|
||||
`hdReparentCsGrid` (`UpdateTrans`) or `hdHatTest` (`UpdateDeath`); reaching it is
|
||||
asserted.
|
||||
- The boss basis is fixture-known, so every case is checked against an independent
|
||||
identity or quarter-turn result. The new position is asserted exactly against the
|
||||
original FPU addition. Each site publishes in 512 cases.
|
||||
- The VU rule from the earlier weapon increments applies. Only forward scratch W at
|
||||
frame `+0c` is normalized for test comparison, after every real consumer.
|
||||
- New caller kinds shift the shared random fill for later rounding modes, so two
|
||||
data-dependent counts in earlier fixtures moved (vehicle tire jumps 709 → 701,
|
||||
real libm errno cases 859 → 830). All scenario-defined counts and assertions are
|
||||
unchanged.
|
||||
- Aggregate caller coverage is 154,112 generated sequences / 7,616 whole-memory
|
||||
comparisons. Historical forward ABI coverage is 11,968 / 748; inverse remains
|
||||
8,576 / 134.
|
||||
|
||||
## Replay and window qualification
|
||||
|
||||
Player, headless runner, historical checker and all eleven native test targets
|
||||
build. All eleven native suites and twelve Python tooling tests pass, with every
|
||||
previous publication assertion enabled.
|
||||
|
||||
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
|
||||
frames. Every recording field matches parent `75e7827`, including the RAM hash on
|
||||
every frame: scratchpad, calls, draws, sound, thread state and EE timing/counts.
|
||||
Sampled 32 MiB RAM images are identical. Strict/default recordings and snapshots
|
||||
are byte exact; strict comparisons report no mismatch. Neither boss movement return runs on these routes, so both are qualified by the generated owner suite above.
|
||||
|
||||
Fresh isolated window runs, started after the headless replays had finished,
|
||||
complete 6,500 one-player, 6,500 actual four-player and 4,200 movie frames.
|
||||
Reviewed captures show the intro and credits, menus, vehicle and level selection,
|
||||
driving with the HUD and four simultaneous views. Each route has five distinct
|
||||
captures. Stereo 48 kHz, 16-bit WAV recordings contain nonzero audio. Audio device
|
||||
underruns: 57.7 ms of silence in one-player, 925.2 ms in four-player and 24.1 ms in
|
||||
the movie run. These are functional checks, not a performance or flawless-playback
|
||||
claim. The qualification four-player window run logged 925.2 ms of silence. Two back-to-back full reruns of that route gave 31.9 ms (new build) and 22.8 ms (parent), so this was machine load, not this change. The boss fight in actual play, full campaign and physical controller/hardware acceptance remain open.
|
||||
@@ -0,0 +1,91 @@
|
||||
# Native FinalBoss gun-shot forward transforms
|
||||
|
||||
[FinalBoss movement forwards](NATIVE_BOSS_MOVE_FORWARD.md) follow with the boss's two movement sites.
|
||||
|
||||
Twelve FinalBoss forward returns use native XYZ arithmetic after the
|
||||
[particle arc forwards](NATIVE_PARTICLE_ARCS_FORWARD.md). Known forward coverage
|
||||
grows from 182 to 194 of 269 returns (75 remain). Known inverse coverage stays 134
|
||||
of 134; BozoEngine stays at `4a8f70a`.
|
||||
|
||||
All twelve are in `FinalBoss::UpdateBoss` (`10f7c0`) and end a gun shot the same
|
||||
way. A muzzle offset goes through the boss's coordinate system into the frame
|
||||
vector at `+10`, and `mathfAddVector` adds the boss position. Some states then aim
|
||||
at the target with `mathfRotationFromPointToPoint`. With shots enabled
|
||||
(`gp-4538`), `Weapons::CreateStaticWeapon` is called with that frame vector as the
|
||||
shot origin.
|
||||
|
||||
| Return PCs | Muzzle offset |
|
||||
| --- | --- |
|
||||
| `110114`, `110880` | The game's table at `235070` |
|
||||
| `1101b0`, `11091c`, `110d9c` | The game's table at `235090` |
|
||||
| `10febc`, `1103e4`, `1104e4`, `110a0c`, `110adc`, `110e8c`, `110f74` | A vector just built with `mathfSetFVector` |
|
||||
|
||||
The frame vector is read only by `mathfAddVector`, by `CreateStaticWeapon`, and,
|
||||
with shots disabled, by `playHelicopterMachineGunSound`. Two earlier increments
|
||||
cover these: the environment-gun increment showed that `CreateStaticWeapon` reads
|
||||
only X/Y/Z, and the sound helper passes the point only to `calcDualMonoMixVolPan`,
|
||||
which the [sinking blimp increment](NATIVE_BLIMP_DEATH_FORWARD.md) showed reads only
|
||||
X/Y/Z.
|
||||
Frame `+1c` is never read. The owner reads no VU registers, accumulator or flags.
|
||||
The existing native helper computes separately rounded XYZ, preserves destination
|
||||
W and leaves VU state untouched. It reads its input before writing, so the in-place
|
||||
transforms are safe. Unknown and historical callers keep the original ABI. No
|
||||
engine or gameplay formula changes.
|
||||
|
||||
## Generated comparisons
|
||||
|
||||
Evidence is under `D:/BozoScratch/boss-shots-forward`, against parent `1f22318`
|
||||
(PR #74). Parent headless/window binaries are preserved there and match PR #74's
|
||||
qualified build. Generated bodies, retail data and runtime recordings stay outside
|
||||
Git.
|
||||
|
||||
- Added coverage is 6,144 generated sequences / 384 whole-memory comparisons
|
||||
(caller kinds 287 to 298): helper-boundary continuations and owner entries,
|
||||
across four rounding modes, FTZ/DAZ, RAM aliases, identity/quarter-turn bases
|
||||
and arbitrary W payloads.
|
||||
- The attack states pick their shots through random rolls and timers, so owner
|
||||
entries start at the call-return label just before each shot. The frame is set
|
||||
as the owner's prologue leaves it, as in the boss fixtures that test the inverse
|
||||
transforms. Each entry is one of:
|
||||
- right after the offset's `mathfSetFVector`;
|
||||
- after the roll that gates the shot, entered with roll result 0;
|
||||
- after the burst-interval check, entered with remainder 0.
|
||||
|
||||
From there each entry runs the transform, the position addition, any aiming, and
|
||||
the call to `CreateStaticWeapon`, where the fixture stops; reaching it is
|
||||
asserted.
|
||||
- The boss basis is fixture-known in every case, so every output is checked against
|
||||
an independent identity or quarter-turn result.
|
||||
- The shot origin is asserted exactly against the original FPU addition, both in
|
||||
the frame and as the origin `CreateStaticWeapon` receives. Each site publishes in
|
||||
512 cases.
|
||||
- The VU rule from the earlier weapon increments applies. Only forward scratch W at
|
||||
frame `+1c` is normalized for test comparison, after every real consumer.
|
||||
- New caller kinds shift the shared random fill for later rounding modes, so two
|
||||
data-dependent counts in earlier fixtures moved (vehicle tire jumps 704 → 709,
|
||||
real libm errno cases 838 → 859). All scenario-defined counts and assertions are
|
||||
unchanged.
|
||||
- Aggregate caller coverage is 153,088 generated sequences / 7,552 whole-memory
|
||||
comparisons. Historical forward ABI coverage is 11,840 / 740; inverse remains
|
||||
8,576 / 134.
|
||||
|
||||
## Replay and window qualification
|
||||
|
||||
Player, headless runner, historical checker and all eleven native test targets
|
||||
build. All eleven native suites and twelve Python tooling tests pass, with every
|
||||
previous publication assertion enabled.
|
||||
|
||||
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
|
||||
frames. Every recording field matches parent `1f22318`, including the RAM hash on
|
||||
every frame: scratchpad, calls, draws, sound, thread state and EE timing/counts.
|
||||
Sampled 32 MiB RAM images are identical. Strict/default recordings and snapshots
|
||||
are byte exact; strict comparisons report no mismatch. None of the twelve boss returns runs on these routes, so they are qualified by the generated owner suite above.
|
||||
|
||||
Fresh isolated window runs, started after the headless replays had finished,
|
||||
complete 6,500 one-player, 6,500 actual four-player and 4,200 movie frames.
|
||||
Reviewed captures show the intro and credits, menus, vehicle and level selection,
|
||||
driving with the HUD and four simultaneous views. Each route has five distinct
|
||||
captures. Stereo 48 kHz, 16-bit WAV recordings contain nonzero audio. Audio device
|
||||
underruns: 52.0 ms of silence in one-player, 501.9 ms in four-player and 19.4 ms in
|
||||
the movie run. These are functional checks, not a performance or flawless-playback
|
||||
claim. In the qualification four-player window run, the frame-1,000 capture was black and the run logged 501.9 ms of silence, from a stall early in the intro. Two back-to-back short reruns (new build, then parent) captured frames 900 to 1,100. Both show the intro at frame 1,000 and about 20 ms of silence each, so the stall was the machine, not this change. The boss fight in actual play, full campaign and physical controller/hardware acceptance remain open.
|
||||
@@ -0,0 +1,93 @@
|
||||
# Native BSP point and segment-crossing transforms
|
||||
|
||||
Thirteen further hierarchy returns use the existing native record calculations. Seven inverse
|
||||
and six forward additions bring both allowlists to thirty-three entries. This extends the
|
||||
[query/lighting increment](NATIVE_HIERARCHY_QUERY_RESULTS.md). BozoEngine remains pinned at
|
||||
`4a8f70a`; no shared engine or renderer change is included.
|
||||
|
||||
| Helper | Return PCs | Owner |
|
||||
|---|---|---|
|
||||
| Inverse `1da1e8` | `1cdf80`, `1ce028`, `1ce220` | BSP point setup and normalization `1cdeb8` |
|
||||
| Inverse `1da1e8` | `1ce644`, `1ce674` | Both-endpoints-outside crossing `1ce588` |
|
||||
| Inverse `1da1e8` | `1ce7b4` | Start-outside crossing `1ce738` |
|
||||
| Inverse `1da1e8` | `1cea40` | End-outside crossing `1ce958` |
|
||||
| Forward `1da298` | `1cdf40`, `1cdfe4`, `1ce1cc` | BSP point setup `1cdeb8` |
|
||||
| Forward `1da298` | `1ce37c`, `1ce3a4` | BSP point-result publication `1cdeb8` |
|
||||
| Forward `1da298` | `1cdd3c` | BSP segment-result publication `1cd538` |
|
||||
|
||||
The player leaves snapshot operands before overlapping writes, retain separately rounded XYZ
|
||||
arithmetic, and leave VU registers, accumulator, flags and data memory untouched. Inverse XYZW
|
||||
matches the original, including basis[0].W; forward XYZ matches while destination W is preserved.
|
||||
Scalar normalization, axis tests, averages, crossing-point emission, duplicate/capacity guards,
|
||||
packed result fields, clocks/checkpoints and query traversal remain compiled game code.
|
||||
Historical hosts and unaudited callers retain their complete original helper ABI. Other helper
|
||||
returns and inline VU operations remain; this is not complete VU removal.
|
||||
|
||||
## Numerical and generated-consumer checks
|
||||
|
||||
Local evidence is under `D:/BozoScratch/hierarchy-bsp-crossings`, against main `b3d03f6` (PR #27).
|
||||
Generated game code, disc data, captures, recordings and RAM dumps are excluded from the commit.
|
||||
|
||||
- The consumer harness grows from 12,288 to 18,944 generated sequences and from 384 to 592
|
||||
complete-memory comparisons (6,656 / 208 added). Four host FP modes, denormal controls, RAM
|
||||
aliases and arbitrary W payloads are covered. CPU outside retired VU, complete outgoing host
|
||||
FP effects, clocks/checkpoints and other memory must match; native VU must be untouched.
|
||||
- Original forward W and VU effects remain live throughout the real consumer sequences. Only
|
||||
final unused forward-output W fields are normalized afterward. A full inverse write can reuse
|
||||
that same record and replace opaque W with meaningful basis[0].W: the reference harness now
|
||||
removes the earlier forward-W exclusion at that write, so the later inverse W is compared
|
||||
exactly. No production arithmetic or W contract was changed for this fixture correction.
|
||||
- BSP setup sequences retain their real point-mode, zero/copy, short-normalization and unit-box
|
||||
decisions, then stop at the following segment-query dispatch. Exact/adjacent unit-axis values
|
||||
are included. Point-result publication runs through packed material/flag fields and return;
|
||||
the segment-result tail stops at its next point-loop boundary after scalar result addition.
|
||||
- Both/start/end-outside sequences run through the actual generated point emitter and return,
|
||||
including axis classifications, averaging, duplicate flags and counts 0, 48 and 49 at the
|
||||
50-point capacity boundary. Start/end cases include exact/adjacent positive and negative
|
||||
five-unit representations. These are helper-consumer tails, not complete query-root coverage.
|
||||
- Historical forward checks grow to 1,536 cases / 96 complete-memory comparisons (384 / 24 added).
|
||||
Historical inverse checks cover all thirty-three returns: 2,112 cases / 33 complete-memory checks.
|
||||
The hierarchy suite retains 786,432 helper comparisons, 384 complete-memory checks, 8,000 geometric
|
||||
edges, 1,024 recursive BSP callers / 32 complete-memory checks and 2,048 unknown-caller ABI cases.
|
||||
- The math suite retains 1,048,576 helper comparisons, 512 complete-memory checks and 2,048
|
||||
unknown-caller ABI cases, including overlap, alignment, aliases and scratchpad coverage.
|
||||
- Player, headless and historical checker builds, all eleven native suites and twelve Python
|
||||
tooling tests pass.
|
||||
|
||||
## Gameplay, loading and movies
|
||||
|
||||
Default and strict routes complete 9,500 one-player and 8,500 actual four-player frames. Every
|
||||
non-RAM frame-record field matches the baseline throughout: scratchpad, calls/counts, draws/counts,
|
||||
sound/sample counts, thread state and EE clock. The entire four-player recording is also
|
||||
byte-identical to the baseline, including every RAM frame. Strict contact, hierarchy, math and
|
||||
projection checks pass; strict/default recordings and snapshots are identical for both routes.
|
||||
Defaults perform zero original comparisons and zero VU0 microprogram calls.
|
||||
|
||||
The six new forward returns execute 23,889 / 0 times in one-player / four-player. The seven new
|
||||
inverse returns execute 24,255 / 2 times. All thirteen sites run in one-player; four-player reaches
|
||||
only `hdStartOut` and `hdEndOut`, once each, with other sites covered by generated consumers/units.
|
||||
The batch retires another 48,144 / 2 original helper executions. These are counts, not timing or
|
||||
FPS measurements.
|
||||
|
||||
One-player RAM hashes differ on 3,906 frames (5594 through 9499). A complete 32 MB snapshot at
|
||||
frame 7000 differs by two bytes in one stack word, `8fedfc`: baseline zero versus native 1.0.
|
||||
Paired baseline/native observers identify forwards `1cdf40` and `1cdfe4`, whose output temporary
|
||||
is SP+`20` with unused W at SP+`2c`. The original stores inherited VF16.W (including transient
|
||||
values); native preserves the existing 1.0. Diagnostic snapshots reproduce the qualified
|
||||
baseline/native snapshots exactly. The following inverse consumes XYZ; its own later output W
|
||||
is meaningful and checked exactly, as described above. The four-player frame-6000 snapshot is
|
||||
baseline-identical. This is bounded snapshot/consumer evidence, not a classification of every
|
||||
possible RAM difference or campaign consumer.
|
||||
|
||||
Temporary observers were removed, restored sources were forced to rebuild, and the native math
|
||||
object matches its qualified hash. All three executables contain no observer marker; all eleven
|
||||
native suites pass again. No new hash mask, padding restoration or shadow VU state is shipped.
|
||||
Clean post-diagnostic default replays reproduce both complete qualified recordings and snapshots
|
||||
byte-for-byte.
|
||||
|
||||
Fresh window runs complete 4,201 game frames for movies/menus and 6,501 each for one-player and
|
||||
actual four-player. Reviewed captures show decoded movie pictures, Junkyard loading and active
|
||||
rainy combat, and four advancing snow-arena views. Device logs report 27.4 / 50.9 / 175.3 ms of
|
||||
silence (movie / one-player / four-player), with underruns and dropped audio frames. Deterministic
|
||||
sound records match. Full campaign acceptance, flawless device audio and console visual parity
|
||||
remain unclaimed.
|
||||
@@ -0,0 +1,73 @@
|
||||
# Native BSP and vehicle inverse directions
|
||||
|
||||
Four more `mathfMulVec` (`1da1e8`) returns use native record calculations: BSP collision setup
|
||||
`1cd658`, `1cda84`, `1cdae8`, and vehicle collision-point offset `1170fc`. This extends the audited
|
||||
inverse allowlist from eleven to fifteen entries. The existing inverse implementation snapshots its
|
||||
inputs, preserves separate rounding, and writes all four output components, including basis[0].W.
|
||||
The player leaf leaves VU registers, accumulator, flags and data memory untouched. Historical-host
|
||||
and unknown-caller paths retain the original complete ABI. BozoEngine remains pinned at `4a8f70a`.
|
||||
|
||||
Together with the preceding forward-direction replacements, these BSP and vehicle setup sequences
|
||||
now execute both transforms without VU context state. The surrounding scalar collision traversal,
|
||||
terrain calculations and other inline VU operations still execute. This is not complete VU removal.
|
||||
|
||||
## Numerical and caller checks
|
||||
|
||||
Evidence is local under `D:/BozoScratch/bsp-inverses`, against main `4a65a8b` (PR #22).
|
||||
Generated game code, disc data, captures and RAM dumps are not committed.
|
||||
|
||||
- The hierarchy suite passes 786,432 helper cases, rotating through all fifteen inverse sites;
|
||||
384 complete flat-memory checks, 8,000 geometric edges, 1,024 recursive BSP caller cases
|
||||
(32 complete-memory checks), and 2,048 unknown-caller ABI cases remain passing. Another 960
|
||||
historical-host inverse cases (15 complete-memory checks) compare the full CPU/VU ABI and memory.
|
||||
- The actual generated BSP continuations pass 1,536 paired forward/inverse cases and 48 full-memory
|
||||
comparisons. Another 2,048 vehicle/light continuation cases and 64 full-memory comparisons cover
|
||||
collision-point setup, tire loops/clamps and light normalization/attenuation. Both sets now require
|
||||
the complete initial VU state to remain untouched. Inverse output W is compared exactly; only the
|
||||
previously established forward-direction destination-W boundary is excluded.
|
||||
- The math suite retains 1,048,576 helper comparisons, 512 complete-memory checks, arbitrary input
|
||||
bits, four host FP modes, denormal controls, overlap, RAM aliases, low address bits and scratchpad.
|
||||
- A further 512 generated body-contact consumer cases (16 full-memory checks) vary position.W
|
||||
independently through the actual XYZ subtraction, stopping at its next dot-product call. CPU,
|
||||
VU, clocks/checkpoints, complete host FP effects and other memory must remain identical. This
|
||||
proves that consumer boundary; it does not claim coverage of every possible contact consumer.
|
||||
- Player, headless and historical checker builds, all ten native suites, and twelve Python tests pass.
|
||||
|
||||
## Gameplay, loading and movies
|
||||
|
||||
Default and strict routes complete 9,500 one-player and 8,500 actual four-player frames. The new
|
||||
sites retire another 653,080 / 60,768 original inverse-helper executions, respectively. The three
|
||||
BSP returns execute in the one-player route; four-player exercises the vehicle return. Total native
|
||||
inverse counts are 712,794 / 62,880. These counts are not a timing or FPS measurement.
|
||||
|
||||
Every non-RAM frame-record field matches the baseline throughout both routes: scratchpad, calls,
|
||||
draws, sound, thread state, EE clock, and associated counts. Four-player RAM also matches throughout.
|
||||
Default runs make zero original comparisons and zero VU0 microprogram calls. Strict math, hierarchy
|
||||
and projection checks pass and reproduce each default recording byte-for-byte.
|
||||
|
||||
The one-player RAM hash differs on 3,781 frames, beginning at frame 5595. The complete 32 MB snapshot
|
||||
at frame 7000 differs by six bytes in three words: `25e06c`, `263a6c`, `26946c`, each changing from
|
||||
zero to `42700000` (60.0). These are position.W in the first 0x40-byte vehicle contact result at
|
||||
Vehicle+`b10`, not position XYZ, radius, a matrix coefficient or a native inverse output mismatch.
|
||||
The four-player frame-6000 snapshot is byte-for-byte identical.
|
||||
|
||||
Temporary local generated-store tracing identifies the copy at `hdTerrain` `1cc904`: it copies Z/W
|
||||
from its temporary result into each contact record. The preceding inline transform at `1cc828`-
|
||||
`1cc838` calculates XYZ into VF16 and stores its inherited W in the terrain query point at `5253b0`.
|
||||
`terrainGetHAT` carries that W through its position copy (`1efb38`/`1efb3c` on the flat path), then
|
||||
`hdTerrain` copies the result into the vehicle record. Retiring the inverse helper changes the old
|
||||
VF16 residue. `collisCheckBodyResult` reads position through XYZ-only `mathfSubVector` (return
|
||||
`118204`); the varied-W fixture above checks that boundary. The traced snapshot matches the ordinary
|
||||
native run. All temporary generated instrumentation was restored byte-for-byte before the final
|
||||
build. No RAM-hash mask, padding restoration or shadow VU state is added.
|
||||
|
||||
Windowed runs complete 4,201 movie/menu frames and 6,501 frames each of one-player and four-player.
|
||||
Reviewed captures show the decoded opening movie, level loading, rainy combat with targeting and
|
||||
vehicle effects, and all four snow-arena views advancing with driving/firing. Device logs report
|
||||
330.1 / 54.2 / 33.1 ms of silence (movie / one-player / four-player) and dropped audio frames;
|
||||
deterministic sound records remain exact. Flawless device audio, full-campaign acceptance and console
|
||||
visual parity are not claimed by these bounded tests.
|
||||
|
||||
The subsequent [terrain/contact increment](NATIVE_TERRAIN_CONTACTS.md) replaces the inline vector
|
||||
blocks in terrain, node, point-contact and ray-result construction. Scalar algorithms and other
|
||||
inverse callers still need their own consumer audits before being replaced.
|
||||
@@ -0,0 +1,114 @@
|
||||
# Native camera and rear-view transforms
|
||||
|
||||
Nine forward-transform returns now use native record calculations, extending the
|
||||
[peel-out increment](NATIVE_PEEL_OUT.md). Forward coverage grows from 80 to 89
|
||||
sites; inverse coverage stays at 89. BozoEngine remains pinned to `4a8f70a`.
|
||||
|
||||
| Return PC | Owner | Checked consumer boundary |
|
||||
| --- | --- | --- |
|
||||
| `1137cc` | `Camera::Update` | Position addition and flag clearing through height-query handoff |
|
||||
| `11398c` | `Camera::Update` | Coordinate-system position publication and camera-mode gate |
|
||||
| `113a78` | `Camera::Update` | Position addition, target/history records, scalar state and matrix publication |
|
||||
| `113b28` | `Camera::Update` | Position addition through rotation-from-points handoff |
|
||||
| `113c2c` | `Camera::Update` | Position addition, three-axis smoothing, history and matrix publication |
|
||||
| `113f28` | `Camera::Update` | Target reconstruction, vehicle-relative difference, history and smoothing through LOS handoff |
|
||||
| `1142d8`, `114394` | `Camera::Update` | Left/right collision-probe positions through LOS handoff |
|
||||
| `1fdd3c` | `viewSetRearViewPos` | Global position/orientation publication and complete return |
|
||||
|
||||
The existing native helper snapshots its operands, computes separately rounded
|
||||
XYZ and retains destination W. Historical hosts and unknown callers retain the
|
||||
complete original ABI. Selection, smoothing, angles, collision queries and game
|
||||
checkpoints remain compiled game code.
|
||||
|
||||
## Coupled inline position consumer
|
||||
|
||||
The `11398c` path also replaces four instructions at `11399c..1139a8` before
|
||||
their VU loads, addition and store. XYZ comes directly from vehicle position and
|
||||
transformed offset records. Original `VADD.xyz` retains `VF13.W`, loaded from the
|
||||
third camera-basis column by the immediately preceding transform. The native
|
||||
consumer publishes that basis record's W directly. All inputs are read before
|
||||
publication, including an in-place position alias. No register shadow,
|
||||
inter-call cache or VU reconstruction is introduced. Published XYZW is exact.
|
||||
|
||||
## Generated comparisons
|
||||
|
||||
Evidence is under `D:/BozoScratch/camera-transforms`, against main `00b7414`
|
||||
(PR #41). Generated code, retail data, recordings and captures stay outside Git.
|
||||
|
||||
- Added coverage is 4,608 generated producer/consumer sequences / 288 whole-memory
|
||||
comparisons. Aggregate coverage is 76,288 / 2,752. Four host rounding modes,
|
||||
denormal controls, RAM aliases, all four camera slots, aliased camera/vehicle
|
||||
coordinate systems and arbitrary basis/output W payloads are covered.
|
||||
- Each camera site has 256 helper-boundary cases and 256 cases entering preceding
|
||||
generated setup, covering offsets, vehicle dimensions, desired positions and
|
||||
smoothing/history updates. They stop at the real boundaries in the table;
|
||||
no query result is stubbed. These are not complete camera-update entry tests.
|
||||
- Rear-view has 256 helper-boundary cases and 256 actual function entries,
|
||||
including non-primary-player early returns, both layout branches,
|
||||
positive/negative distances and real rotation/sine/cosine producers. Rotation
|
||||
inputs stay within half a radian; wider argument reduction is outside these fixtures.
|
||||
- CPU outside retired VU, outgoing host FP effects, clocks/checkpoints and final
|
||||
memory agree. Forward-output W in offset/desired-target records is excluded
|
||||
only after real consumers run. The coupled coordinate-system position's W
|
||||
is compared exactly. Native leaves and the new inline
|
||||
consumer leave VU state untouched.
|
||||
- Complete rear-view entries retain the original rotation producer's
|
||||
`mathfUnitMatrixAsm` VU effects. A test captures state at entry to the native
|
||||
leaf and checks it remains unchanged through that leaf and the entire scalar
|
||||
consumer. This does not replace the identity producer or claim whole-function
|
||||
VU removal.
|
||||
- Historical forward ABI coverage grows to 5,120 / 320 cases / whole-memory
|
||||
checks; inverse stays at 5,696 / 89. Existing hierarchy coverage retains
|
||||
786,432 helper cases / 384 whole-memory, 8,000 geometric edges, 1,024 complete
|
||||
BSP callers / 32 whole-memory and 2,048 unknown ABI cases.
|
||||
- Player, headless runner, historical checker and all test targets build.
|
||||
All eleven native suites and twelve Python tooling tests pass. The hierarchy
|
||||
suite passes again with arbitrary published basis-W payloads.
|
||||
|
||||
## Replay qualification
|
||||
|
||||
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
|
||||
frames. Every recorded field matches the immediate parent, including raw RAM,
|
||||
scratchpad, calls, draws, sound, threads, counts and EE clocks. Both sampled full
|
||||
32 MiB RAM snapshots match exactly. Strict/default recording files and snapshots
|
||||
are identical. No observer, RAM mask or VU-state restoration is needed.
|
||||
|
||||
| New return | One-player calls | Four-player calls |
|
||||
| --- | ---: | ---: |
|
||||
| `113a78` | 2 | 4 |
|
||||
| `113f28` | 3,900 | 15,188 |
|
||||
| `1142d8` | 3,900 | 15,188 |
|
||||
| `114394` | 3,900 | 15,188 |
|
||||
| `1fdd3c` | 3,902 | 3,798 |
|
||||
| Total | 15,604 | 49,366 |
|
||||
|
||||
The other four camera sites, including the coupled inline consumer, are cold in
|
||||
these routes and qualified by generated comparisons. Total native forward calls
|
||||
become 1,157,512 / 352,070. Default routes make zero original-helper comparisons
|
||||
and execute zero VU0 microprograms. Counts establish reach, not a measured speedup.
|
||||
|
||||
Fresh 6,500-frame one-player and actual four-player windowed routes and a
|
||||
4,200-frame movie/menu route complete through clean exit, with isolated scratch
|
||||
user data. Reviewed captures show decoded movie action (1,000), return to menu
|
||||
(1,800), Junkyard loading (one-player 4,500), combat/movement with targeting and
|
||||
effects (one-player 5,500 / 6,300), and four advancing snow-arena views
|
||||
(four-player 5,500 / 6,300). These are bounded functional checks, not pixel-exact
|
||||
windowed or console parity.
|
||||
|
||||
Windowed one-player reaches `113a78` once, the three hot camera sites 1,708 times
|
||||
each, and rear-view 1,709 times: 6,834 new native calls. Four-player reaches them
|
||||
4 / 7,192 each / 1,799 times respectively: 23,379 new calls. The other four sites
|
||||
remain cold; all nine are cold in the movie route.
|
||||
|
||||
All three stereo 48 kHz WAV recordings contain audio. Device logs report
|
||||
20.9 / 82.9 / 30.3 ms of silence (movie / one-player / four-player), with underruns
|
||||
and dropped frames. Deterministic gameplay sound is exact; flawless device audio
|
||||
and subjective listening are not claimed.
|
||||
|
||||
## Remaining scope
|
||||
|
||||
These two helper inventories now contain 89 native forward and 89 native inverse
|
||||
sites. Outside their allowlists remain 180 forward and 45 inverse sites, 225 in
|
||||
total across the game. This structural inventory excludes other helper families
|
||||
and inline VU operations. Full campaign, all camera modes in live play and
|
||||
console visual/audio parity remain separate work.
|
||||
@@ -0,0 +1,82 @@
|
||||
# Native older car and hierarchy particle transforms
|
||||
|
||||
Fourteen remaining forward-helper returns use native XYZ record calculations, extending the
|
||||
[terrain-query increment](NATIVE_TERRAIN_QUERY_HELPERS.md). The forward allowlist grows from
|
||||
52 to 66; the inverse list stays at 74. BozoEngine remains pinned to `4a8f70a`.
|
||||
|
||||
| Return PCs of forward helper `1da298` | Owner |
|
||||
|---|---|
|
||||
| `1c8f10`, `1c8f3c`, `1c8fd8`, `1c9000`, `1c908c`, `1c90b4`, `1c9140`, `1c9168`, `1c91f4`, `1c921c` | Older car-collision debug corner pairs `1c8db0` |
|
||||
| `1c959c`, `1c96e8` | Older car-collision debug point/normal records `1c8db0` |
|
||||
| `1d4514`, `1d4560` | Initialized/new hierarchy particle-node positions `1d4498` |
|
||||
|
||||
The existing native leaf captures operands before overlapping writes, computes separately
|
||||
rounded XYZ and preserves destination W without VU registers, accumulator, flags or data memory.
|
||||
Historical hosts and unknown callers keep the complete original ABI. Collision queries, scalar
|
||||
world-coordinate addition, debug-line record construction, view lookup, FX dispatch and game
|
||||
checkpoints remain compiled game code.
|
||||
|
||||
## Generated consumer and numerical checks
|
||||
|
||||
Local evidence is under `D:/BozoScratch/hierarchy-car-particles`, against main `571020e` (PR #33).
|
||||
Generated game code, retail assets, recordings, snapshots and captures are excluded from Git.
|
||||
|
||||
- Consumer coverage grows from 49,664 to 56,832 sequences and from 1,552 to 1,776 whole-memory
|
||||
checks: 7,168 / 224 added. Four host rounding modes, denormal controls, RAM aliases and
|
||||
arbitrary temporary W payloads remain covered. CPU outside retired VU, outgoing host FP
|
||||
effects, clocks/checkpoints and other memory match; native VU is untouched.
|
||||
- Each car corner pair runs the real generated transforms and scalar world sums, selects
|
||||
either debug colour branch, then executes `terrainDrawLine` through actual `drawLines`
|
||||
dispatch. Its real producer reads endpoint XYZ and explicitly writes W=1 for both vertices.
|
||||
Colour RGBA, including meaningful alpha, is copied independently and compared exactly.
|
||||
- The two later car returns run their transformed-point world sums and the same actual
|
||||
debug-line producer through `drawLines` dispatch. Rendering beyond that dispatch remains
|
||||
outside these bounded fixtures; no debug-GPU parity is claimed.
|
||||
- The fixture now initializes, restores and compares the real debug records at
|
||||
`7484f0`–`7485bf`, in addition to the existing stack/data/global regions. All older cases
|
||||
rerun with that comparison; complete flat-memory checks remain too.
|
||||
- Initialized particle nodes run the real view-index lookup and scalar XYZ sum through return.
|
||||
New nodes run view lookup and in-place world-position addition through modeled-FX creation
|
||||
dispatch. The complete FX allocator/emitter lifecycle is outside this fixture.
|
||||
- Forward W is excluded only after the real scalar consumers have run. The debug producer's
|
||||
complete XYZW records and all other writes remain exact; no production W repair is added.
|
||||
- Historical forward coverage grows from 2,752 / 172 to 3,648 / 228 cases / whole-memory checks.
|
||||
Historical inverse coverage stays at 4,736 / 74. The hierarchy suite retains 786,432 helper
|
||||
cases / 384 whole-memory, 8,000 geometric edges, 1,024 complete recursive BSP callers / 32
|
||||
whole-memory and 2,048 unknown-caller ABI cases. The math suite retains 1,048,576 helper cases
|
||||
/ 512 whole-memory and 2,048 unknown-caller ABI cases.
|
||||
- Player, headless and historical-checker builds and twelve Python tooling tests pass. Every
|
||||
native test target was rebuilt/relinked against the current library; all eleven suites pass.
|
||||
|
||||
## Gameplay, loading and movies
|
||||
|
||||
Default and strict runs complete 9,500 one-player and 8,500 actual four-player frames.
|
||||
Each complete default recording is byte-identical to the preceding main, including RAM,
|
||||
scratchpad, library calls/counts, draws/counts, sound/sample counts, threads and EE clock.
|
||||
The full 32 MB snapshots at one-player frame 7000 and four-player frame 6000 are also exact.
|
||||
Strict contact, hierarchy, math and projection checks pass; their recordings and snapshots
|
||||
match the default runs byte-for-byte. Default runs perform zero original comparisons and
|
||||
zero VU0 microprogram calls. Strict diagnostic runs intentionally execute original oracles.
|
||||
|
||||
Optional forward-call tracing records 1,191,280 / 381,308 total helper calls in one-player /
|
||||
four-player, with zero calls to any of the fourteen new returns in both default and strict
|
||||
runs. These paths have generated-consumer, numerical and historical-ABI coverage, without
|
||||
live-route reach. This batch does not claim retired gameplay executions or a measured speedup.
|
||||
|
||||
Fresh windowed runs complete the configured 4,200-frame movie/menu and 6,500-frame one-player
|
||||
and actual four-player routes through clean exit, using isolated scratch user data. Reviewed
|
||||
captures show decoded movie pictures, Junkyard loading, active one-player gameplay and four
|
||||
advancing snow-arena views. Device logs report 31.0 / 31.6 / 7.5 ms of silence (movie /
|
||||
one-player / four-player), with underruns and dropped frames; deterministic sound remains exact.
|
||||
Flawless device audio, full campaign and console visual parity remain unclaimed.
|
||||
|
||||
## Remaining scope
|
||||
|
||||
The structural two-helper inventory is now 66 native forward and 74 native inverse sites,
|
||||
with 203 / 60 sites outside their allowlists, 263 in total. This includes code inside otherwise
|
||||
replaced functions; it is not a live cost measurement and excludes other helpers/inline VU.
|
||||
|
||||
The narrow hierarchy/collision owner range `1c0000`–`1dffff` and terrain range `1ef000`–`1f5fff`
|
||||
now have no remaining forward sites for this helper. Eight inverses remain there: six terrain
|
||||
debug-drawing calls and terrain modify/wave setup. This is not complete VU removal, full campaign
|
||||
acceptance or console visual parity.
|
||||
@@ -0,0 +1,86 @@
|
||||
# Native vehicle collision and drift inverses
|
||||
|
||||
Sixteen inverse-transform returns now use native record arithmetic, extending the
|
||||
[weapon/skid increment](NATIVE_WEAPON_SKID_TRANSFORMS.md). Inverse coverage grows
|
||||
from 89 to 105 sites; forward coverage stays at 95. BozoEngine stays at `4a8f70a`.
|
||||
|
||||
| Return PC | Owner | Consumer |
|
||||
| --- | --- | --- |
|
||||
| `1161f4`, `116618` | `collisSetupHitPoints` | Local axis selection and hit-point records |
|
||||
| `119090`, `11927c` | `collisAverageEnvironmentCollisions` | Hit location and slope response |
|
||||
| `11985c`, `119870`, `119e64` | `collisReflectOffCollision` | Reflection decisions and local velocity |
|
||||
| `11afb0`, `11b018` | `collisCalcCar2CarForces` | Local force scaling and force decisions |
|
||||
| `11b9a8` | `collisSetCar2CarFlags` | Local velocity publication before hit dispatch |
|
||||
| `11c38c`, `11c3c0` | `collisCar2CarMorph` | Velocity and normalized hit location |
|
||||
| `11c540` | `collisCheckDrivableSlopeHit` | Slope accumulation and wheel response |
|
||||
| `1ab558`, `1ab8f4`, `1abad4` | `vehicleUpdateDrift` | Drift exit, direction checks and velocity publication |
|
||||
|
||||
The existing inverse snapshots three basis columns and the input, calculates
|
||||
separately rounded XYZ, and copies the first basis column's W as meaningful data.
|
||||
All four result components remain exact. Native calls do not touch VU registers,
|
||||
accumulator, flags or data memory. Unknown callers and historical hosts keep the
|
||||
complete original ABI. Collision dispatch, force application, orientation/matrix
|
||||
producers and tire-plane updates remain generated game code.
|
||||
|
||||
## Generated-code comparisons
|
||||
|
||||
Evidence is under `D:/BozoScratch/collision-drift-inverses`, against main `a2905f2`
|
||||
(PR #44). Generated code, retail data, recordings and captures stay outside Git.
|
||||
|
||||
- Added coverage is 8,192 sequences / 512 whole-memory comparisons. Aggregate
|
||||
coverage is 87,552 / 3,456. Four host rounding modes, denormal controls and
|
||||
cached/uncached RAM aliases and arbitrary basis W payloads are covered.
|
||||
- Each return has 256 inverse-boundary cases and 256 generated producer cases.
|
||||
Producers comprise 3,712 bounded call-argument sequences and 384 complete
|
||||
drift entries (128 exiting drift and 256 inactive drift).
|
||||
- All sixteen sites have explicit original/native call counts and native leaf
|
||||
VU-preservation assertions. CPU outside retired VU, outgoing host FP effects,
|
||||
checkpoints, call counts and final memory agree. No new W exclusions are used.
|
||||
- Ten tails run through their real return: averaged hit location, slope response,
|
||||
reflected velocity, second car-force result, both morph inverses, drivable
|
||||
slope and all three drift returns. Active drift direction fixtures continue
|
||||
through slowdown and the final velocity inverse with tire-plane updates gated
|
||||
off. Complete drift entries cover the speed threshold's reset/retain branches.
|
||||
- Six tails have explicit boundaries: hit-point setup stops before its subsequent
|
||||
forward-transform loop; the first two reflection decisions stop before the
|
||||
displacement subtraction; the first car-force result is scaled and normalized
|
||||
before the second matrix-from-normal producer; collision flags stop at hit-info
|
||||
initialization after velocity publication. These fixtures do not claim full
|
||||
collision dispatch, force application or all orientation/tire update paths.
|
||||
- Historical inverse ABI coverage grows to 6,720 / 105 cases / whole-memory
|
||||
checks. Forward remains 5,504 / 344. Existing hierarchy coverage retains
|
||||
786,432 helper cases / 384 whole-memory, 8,000 geometric edges, 1,024 complete
|
||||
BSP callers / 32 whole-memory and 2,048 unknown ABI cases.
|
||||
|
||||
## Replay and window qualification
|
||||
|
||||
Player, headless runner, historical checker and all eleven native test targets
|
||||
build. All eleven native suites and twelve Python tooling tests pass.
|
||||
|
||||
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
|
||||
frames. Every recorded field matches the immediate parent: raw RAM, scratchpad,
|
||||
calls, draws, sound, thread state and EE timing/counts. Sampled 32 MiB RAM images
|
||||
are identical too. Strict/default recording files and snapshots are byte exact;
|
||||
strict result comparisons report no mismatch. New native inverse calls total
|
||||
34,927 in 1P and 15,194 in 4P. Return `11927c` remains cold in these replays and is
|
||||
qualified by its reached generated-code fixture.
|
||||
|
||||
Fresh windowed checks use isolated user folders and complete 6,500 one-player,
|
||||
6,500 four-player and 4,200 movie frames. Captures show level loading followed
|
||||
by moving gameplay, four simultaneous views, driving/firing/effects, decoded
|
||||
intro images and return to the menu. Each route has five distinct captures.
|
||||
The new inverse calls total 16,872 / 7,202 in windowed 1P / 4P; movies make none.
|
||||
Stereo 48 kHz WAV captures contain nonzero audio on all routes. Device underruns
|
||||
remain: 53.4 ms silence in 1P, 25.4 ms in 4P and 270.5 ms in movies. The movie
|
||||
run overlapped functional checks; this is not a clean timing comparison or a
|
||||
claim of flawless device playback. Mixer records in the paired headless runs
|
||||
remain exact. Full campaign, every collision dispatch path and physical
|
||||
controller/hardware acceptance are outside this increment.
|
||||
|
||||
## Remaining scope
|
||||
|
||||
The current generated source contains 134 inverse-helper returns and 269 forward
|
||||
returns. Of these two families, 29 inverse and 174 forward sites remain outside
|
||||
the native allowlists: 203 total. This is a call-site inventory, not a count of
|
||||
all remaining emulation. Rigid-body inverses, AI, driver/boss helpers, HUD/radar,
|
||||
rollover, damage, lighting and additional inline arithmetic remain separate work.
|
||||
@@ -0,0 +1,119 @@
|
||||
# Native vehicle-collision forward transforms
|
||||
|
||||
Six vehicle-collision forward returns use native XYZ record arithmetic after the
|
||||
[driver forward increment](NATIVE_DRIVER_FORWARD.md). Coverage grows from 113
|
||||
to 119 of 269 known forward returns (150 remain). Known inverse coverage stays
|
||||
134 of 134. BozoEngine stays at `4a8f70a`.
|
||||
|
||||
| Return PC | Owner | Qualified consumer |
|
||||
| --- | --- | --- |
|
||||
| `11ad1c`, `11ada0` | `collisCar2CarCollision` | Vehicle velocity/speed reconstruction, real relative-mass and coupled force calculation, through the effects-dispatch boundary |
|
||||
| `11b26c` | `collisApplyForce` | Complete velocity update, normalization, speed, matrix, rotation and state-flag publication |
|
||||
| `11bba8`, `11bbe8` | `collisSetCar2CarFlags` | Heading/angle producer prefix, impact-offset selection, translated take-hit point publication and damage staging before hit dispatch |
|
||||
| `11c368` | `collisCar2CarMorph` | Complete velocity difference, meaningful inverses, scaled hit position and hit-location/state publication |
|
||||
|
||||
Native arithmetic retains separately rounded XYZ, destination W and untouched VU
|
||||
registers, accumulator, flags and data memory. The original scalar collision,
|
||||
mass, force, rotation, angle and hit-location logic remains. Unknown/historical
|
||||
callers keep the original ABI. No engine or collision tuning is changed.
|
||||
|
||||
## Generated-code comparisons
|
||||
|
||||
Evidence is under `D:/BozoScratch/contact-forward`, against immediate parent
|
||||
`555f9b3` (PR #52 plus its UTF-8 documentation correction, PR #53). Generated
|
||||
bodies, retail data and runtime artifacts stay outside Git.
|
||||
|
||||
- Added coverage is 3,072 generated sequences / 192 whole-memory comparisons.
|
||||
Each return has 256 helper-boundary sequences through its actual consumers and
|
||||
256 producer-entry sequences in four rounding modes, with FTZ/DAZ, RAM aliases,
|
||||
rotated bases, zero/tiny/signed vectors and opaque basis/destination W payloads.
|
||||
- Collision producer entries start at the actual owner entry and retain the
|
||||
velocity-reconstruction type/enable gates, signed speed bookkeeping, actual
|
||||
relative masses, both inverse projections and both coupled force applications.
|
||||
Controlled fixture thresholds enable the force paths. They stop at `11b2e8`,
|
||||
before the separate angles/effects owner. Effects, later collision flags and
|
||||
hit clearing are not claimed as complete-owner coverage by these fixtures.
|
||||
- Force entries complete the real owner, including retained/scaled velocity,
|
||||
transformed force addition, normalization and mass-divided speed, matrix and
|
||||
Euler rotation publication, and the state flag. Known entries require exact
|
||||
velocities with identity and rotated bases.
|
||||
- Impact producer prefixes start at `11ba50`, after unrelated early collision,
|
||||
take-hit allocation and state work. They retain actual heading/trigonometry,
|
||||
bounded-angle and directional-offset selection, type/enable gates, coordinate
|
||||
translation, take-hit point pointer publication and scalar damage staging.
|
||||
They stop at `142d98`, before dispatching damage/effects. Boundary cases run the
|
||||
same real tails. Known prefixes require exact translated front/right points;
|
||||
additional prefixes select rear/left offsets. Dispatch is not stubbed or skipped.
|
||||
- Morph entries complete the real owner: forward velocity, subtraction, both
|
||||
existing inverse leaves, sign/scaling branches and real hit classification.
|
||||
Published location/state fields must agree, including meaningful first-basis W
|
||||
in the vehicle inverse record and reused stack record.
|
||||
- Original zero-vector rotation paths execute real libm domain handling. Fixtures
|
||||
seed retail `_LIB_VERSION=1` (verified in the local ELF) and valid errno storage;
|
||||
actual errno writes and FP effects are compared (828 sequences reach errno).
|
||||
No libm/helper result is stubbed.
|
||||
- Explicit per-return, relative-mass/force, normalization/matrix/rotation,
|
||||
heading/angle and hit-location counts are required. Known-state publication
|
||||
assertions cover 64 reconstructed velocities, 32 force updates, 64 impact
|
||||
points and 256 complete morph locations. Native VU remains untouched through
|
||||
the actual scalar producers and consumers.
|
||||
- Forward W exclusions are restricted to reconstructed `Vehicle+1ec`, the real
|
||||
nested force frame's `SP+1c`, direct force frame `SP+1c`, or impact scratch
|
||||
`SP+1c`. Exact output counts/addresses account for actual frame sizes and reuse
|
||||
of the nested force frame. Reference W stays intact through all real consumers
|
||||
before comparison-only normalization. Morph inverse overwrites remove the
|
||||
forward-W exclusion and compare full XYZW. No runtime RAM mask or VU-bank
|
||||
reconstruction is introduced.
|
||||
- Aggregate coverage is 114,688 generated caller sequences / 5,152 whole-memory
|
||||
checks. Historical forward ABI coverage is 7,040 / 440; inverse stays 8,576 /
|
||||
134. Existing hierarchy/BSP/edge/unknown-ABI coverage and earlier AI,
|
||||
vehicle/light, final inverse and driver publication assertions remain enabled.
|
||||
|
||||
## Replay and window qualification
|
||||
|
||||
Player, headless runner, historical checker and all eleven native test targets
|
||||
build. All eleven native suites and twelve Python tooling tests pass; all earlier
|
||||
publication assertions remain enabled.
|
||||
|
||||
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
|
||||
frames. Draws, sound, scratchpad, calls, threads and EE timing/counts match the
|
||||
parent in every frame. Four-player raw RAM hashes also match throughout. Both
|
||||
sampled 32 MiB RAM images are exact. Strict/default recording files and snapshots
|
||||
are byte exact, with no strict mismatch.
|
||||
|
||||
One-player has seven raw RAM-hash differences, at frames 5929, 6497, 6503-6506
|
||||
and 8823. Isolated parent/native diagnostic executables retain the production
|
||||
objects and substitute only the parent/native math object and identical diagnostic
|
||||
frame-end observation. Their complete recordings match the corresponding
|
||||
qualification recordings. Exact frame-end snapshots and direct call traces prove:
|
||||
|
||||
- Every affected snapshot differs only at `8ff2ac`: original zero, native `8ff270`.
|
||||
Neighboring captured frames have no other differences.
|
||||
- Matching calls to `11b26c` have real force `SP=8ff290`, input at SP and output at
|
||||
`SP+10=8ff2a0`. Both enter with `W=8ff270`; the original writes zero, while
|
||||
native code retains that exact prior value.
|
||||
- The complete real force owner consumes only output XYZ in its velocity addition,
|
||||
then uses normalized XYZ for speed/matrix/rotation and returns. Its local output
|
||||
record is no longer live after that return. The surviving bytes are stack W
|
||||
residue, not a physics/driver result. Existing meaningful inverse W stays exact.
|
||||
- Production binaries and raw recordings are unchanged. No runtime RAM mask,
|
||||
recorded-hash normalization or VU-state reconstruction is used. The exception
|
||||
is documented explicitly rather than calling all one-player RAM hashes exact.
|
||||
|
||||
Default one-player reaches force `11b26c` 45 times and morph `11c368` 166 times;
|
||||
velocity-reconstruction and impact-offset sites are cold on that route.
|
||||
Four-player makes no calls to the six new sites. Fixtures qualify the cold paths
|
||||
within the complete/bounded consumer scopes stated above.
|
||||
|
||||
Fresh isolated window runs complete 6,500 one-player, 6,500 actual four-player
|
||||
and 4,200 movie frames. Reviewed captures show level loading, advancing driving,
|
||||
AI activity, vehicle rollover, simultaneous four-view driving/effects, decoded
|
||||
intro footage and return to the menu. Each route has five distinct captures.
|
||||
Stereo 48 kHz, 16-bit WAV recordings contain nonzero audio.
|
||||
|
||||
Windowed one-player reaches the two velocity-reconstruction returns 14/8 times,
|
||||
force 53 times and morph 178 times. Impact offsets remain cold. Four-player and
|
||||
movies make no calls to these six sites. Device underruns remain: 46.9 ms silence
|
||||
in 1P, 30.6 ms in 4P and 16.8 ms in movies. These are functional checks, not a
|
||||
timing or flawless-playback claim. Full campaign, every collision/effects path
|
||||
and physical-controller/hardware acceptance remain outside this increment.
|
||||
@@ -0,0 +1,87 @@
|
||||
# Native combo-launch forward transforms
|
||||
|
||||
[Zoomies and HalTrans weapon forwards](NATIVE_ZOOMIES_HAL_FORWARD.md) follow with four more weapon sites.
|
||||
|
||||
Five combo forward returns use native XYZ arithmetic after the
|
||||
[tire-pair correction forwards](NATIVE_TIRE_ROTATION_FORWARD.md). Known forward
|
||||
coverage grows from 169 to 174 of 269 returns (95 remain). Known inverse coverage
|
||||
stays 134 of 134; BozoEngine stays at `4a8f70a`.
|
||||
|
||||
All five are in `Vehicle::vehicleCheckForCombos` (`1af4c0`). Each places the launch
|
||||
point for a special triggered by a button combo:
|
||||
|
||||
| Return PC | Combo | Producer |
|
||||
| --- | --- | --- |
|
||||
| `1af700` | `1` | After `Launcher::GetLockOn`: offset `(0,8,2)` through the vehicle's coordinate-system basis, in place |
|
||||
| `1af790` | `0x10304` | After `GetLockOn`: offset `(0,12,5)`, the same way (`+2270` is set for the first of its four `CreateWeapon` calls) |
|
||||
| `1af890` | `4`, controller count above the threshold | The stored offset at `+2620` through the vehicle basis at `+d0` (sets `+2274`) |
|
||||
| `1af8fc` | `4`, otherwise | The same offset, on the single-cost branch |
|
||||
| `1af980` | `5` | The same offset (sets `+2274`) |
|
||||
|
||||
When `+580` is 1, the combo code is the first word of the controller block at
|
||||
`+2000`; when it is 2, it is the word at `+418` of the block at `+2004`. Each combo compares the counter at `+2214` with
|
||||
its cost. The transform result is the frame vector at `+0`, read only by
|
||||
`mathfAddVector`, which adds the vehicle position into `+2760` and writes X/Y/Z
|
||||
only. `TheGame::CreateWeapon` then launches the special. Frame `+0c` is never read
|
||||
in any combo case, and the W of `+2760` is not written by this path at all. The
|
||||
owner reads no VU registers, accumulator or flags. The existing native helper
|
||||
computes separately rounded XYZ, preserves destination W and leaves VU state
|
||||
untouched. It reads its input before writing, so the in-place transforms are safe.
|
||||
Unknown and historical callers keep the original ABI. No engine or gameplay formula
|
||||
changes.
|
||||
|
||||
## Generated comparisons
|
||||
|
||||
Evidence is under `D:/BozoScratch/combo-forward`, against parent `7627a52` (PR #70).
|
||||
Parent headless/window binaries are preserved there and match PR #70's qualified
|
||||
build. Generated bodies, retail data and runtime recordings stay outside Git.
|
||||
|
||||
- Added coverage is 2,560 generated sequences / 160 whole-memory comparisons
|
||||
(caller kinds 274 to 278): helper-boundary continuations and full-owner entries,
|
||||
across four rounding modes, FTZ/DAZ, RAM aliases, identity/quarter-turn bases and
|
||||
arbitrary W payloads.
|
||||
- Full entries run from the owner's start: the `+580` check, the combo dispatch
|
||||
and the energy-cost checks. Combos 1 and `0x10304` run the real
|
||||
`Launcher::GetLockOn`, with nothing to lock on in empty vehicle lists. Combo 4
|
||||
takes each branch by its controller count. Every launch stops at `CreateWeapon`;
|
||||
reaching it is asserted. With no combo entered, the owner adds `+20c8` into the
|
||||
counter at `+20e0` and returns without a transform.
|
||||
- Both bases are fixture-known at entry as well as at the helper boundary, so every
|
||||
case is checked against an independent identity or quarter-turn result.
|
||||
- The launch position in `+2760` is asserted exactly against the original FPU
|
||||
addition, together with the `+2270`/`+2274` flags. Each site publishes in 480
|
||||
cases.
|
||||
- The VU rule from the earlier weapon increments applies. Only forward scratch W at
|
||||
frame `+0c` is normalized for test comparison, after every real consumer.
|
||||
- New caller kinds shift the shared random fill for later rounding modes, so two
|
||||
data-dependent counts in earlier fixtures moved (vehicle tire jumps 700 → 708,
|
||||
real libm errno cases 853 → 842). All scenario-defined counts and assertions are
|
||||
unchanged.
|
||||
- Aggregate caller coverage is 142,848 generated sequences / 6,912 whole-memory
|
||||
comparisons. Historical forward ABI coverage is 10,560 / 660; inverse remains
|
||||
8,576 / 134.
|
||||
|
||||
## Replay and window qualification
|
||||
|
||||
Player, headless runner, historical checker and all eleven native test targets
|
||||
build. All eleven native suites and twelve Python tooling tests pass, with every
|
||||
previous publication assertion enabled.
|
||||
|
||||
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
|
||||
frames. Every recording field matches parent `7627a52`, including the RAM hash on
|
||||
every frame: scratchpad, calls, draws, sound, thread state and EE timing/counts.
|
||||
Sampled 32 MiB RAM images are identical. Strict/default recordings and snapshots
|
||||
are byte exact; strict comparisons report no mismatch. The combo-4 return `1af8fc`
|
||||
is live: it runs natively once on the one-player route with no recorded
|
||||
difference. The other four returns are cold on these routes and are qualified by
|
||||
the generated owner suite above.
|
||||
|
||||
Fresh isolated window runs, started after the headless replays had finished,
|
||||
complete 6,500 one-player, 6,500 actual four-player and 4,200 movie frames.
|
||||
Reviewed captures show the intro and credits, menus, vehicle and level selection,
|
||||
driving with the HUD and four simultaneous views. Each route has five distinct
|
||||
captures. Stereo 48 kHz, 16-bit WAV recordings contain nonzero audio. Audio device
|
||||
underruns: 50.1 ms of silence in one-player, 39.8 ms in four-player and 19.8 ms in
|
||||
the movie run. These are functional checks, not a performance or flawless-playback
|
||||
claim. The other combos in actual play, full campaign and physical
|
||||
controller/hardware acceptance remain open.
|
||||
@@ -0,0 +1,83 @@
|
||||
# Native Cop SUV laser-aim forward transforms
|
||||
|
||||
[Environment gun forwards](NATIVE_ENVWEAPON_FORWARD.md) follow with two more launcher sites.
|
||||
|
||||
The two `Launcher::UpdateCopSUV` (`14ff58`) forward returns use native XYZ
|
||||
arithmetic after the [launcher turret-aim forwards](NATIVE_LAUNCHER_AIM_FORWARD.md).
|
||||
Known forward coverage grows from 142 to 144 of 269 returns (125 remain). Known
|
||||
inverse coverage stays 134 of 134; BozoEngine stays at `4a8f70a`.
|
||||
|
||||
| Return PC | Branch | Producer and consumer |
|
||||
| --- | --- | --- |
|
||||
| `150094` | Mode `0x14` with a live player state | Laser offset table through the vehicle basis, in place, plus the shooter position, aimed at the player-state target |
|
||||
| `1502cc` | Otherwise, a closest car within 600 units | Same offset and position, aimed at the car `GetClosestCar` chose |
|
||||
|
||||
As with the other launchers, the frame `+10` result is read only as XYZ, by
|
||||
`mathfAddVector` and by the scalar `mathfRotationFromPointToPoint`. The owner never
|
||||
reads frame `+1c` (the output W) and reads no VU registers, accumulator or flags.
|
||||
The existing native helper computes separately rounded XYZ, preserves destination
|
||||
W and leaves VU state untouched. Unknown and historical callers keep the original
|
||||
ABI. No engine or gameplay formula changes.
|
||||
|
||||
## Generated comparisons
|
||||
|
||||
Evidence is under `D:/BozoScratch/copsuv-aim-forward`, against parent `5135b43`
|
||||
(PR #59). Parent headless/window binaries are preserved there and match PR #59's
|
||||
qualified build. Generated bodies, retail data and runtime recordings stay
|
||||
outside Git.
|
||||
|
||||
- Added coverage is 1,024 generated sequences / 64 whole-memory comparisons
|
||||
(caller kinds 247 and 248): helper-boundary continuations and full-owner
|
||||
entries, across four rounding modes, FTZ/DAZ, RAM aliases, identity/quarter-turn
|
||||
bases and arbitrary W payloads.
|
||||
- Kind 247 sets the game mode to `0x14` with a live player state and a target
|
||||
coordinate system, so full entries take the first branch even without a closest
|
||||
car. Kind 248 places a car inside the laser's 600-unit range, so full entries take
|
||||
the closest-car branch; that car's target flag (`+24bc`) is asserted, and the
|
||||
no-target scenario returns normally without a transform. Producer reach is
|
||||
asserted in every case.
|
||||
- Both branches continue into `LauncherSound::startLaserSound` or
|
||||
`stopLaserSound`, which call into the sound driver. Fixtures stop at those two
|
||||
calls, after the aim point has been consumed, and assert that one of them was
|
||||
reached; the laser sound and the turret matrix publication after it are not
|
||||
executed here.
|
||||
- Transform outputs are checked against an independent identity or quarter-turn
|
||||
result in every reached case (the basis is the vehicle's own). The aim point
|
||||
consumed by `mathfRotationFromPointToPoint` is asserted exactly against the
|
||||
original FPU addition. The first site publishes in 512 cases, the second in 480.
|
||||
- The VU rule from the earlier weapon increments applies. Only forward scratch W
|
||||
at frame `+1c` is normalized for test comparison, after every real consumer.
|
||||
- New caller kinds shift the shared random fill for later rounding modes, so two
|
||||
data-dependent counts in earlier fixtures moved again (vehicle tire jumps
|
||||
704 → 715, real libm errno cases 833 → 850). All scenario-defined counts and
|
||||
assertions are unchanged.
|
||||
- Aggregate caller coverage is 127,488 generated sequences / 5,952 whole-memory
|
||||
comparisons. Historical forward ABI coverage is 8,640 / 540; inverse remains
|
||||
8,576 / 134.
|
||||
|
||||
## Replay and window qualification
|
||||
|
||||
Player, headless runner, historical checker and all eleven native test targets
|
||||
build. All eleven native suites and twelve Python tooling tests pass, with every
|
||||
previous publication assertion enabled.
|
||||
|
||||
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
|
||||
frames. Every recording field matches parent `5135b43`: raw RAM, scratchpad,
|
||||
calls, draws, sound, thread state and EE timing/counts. Sampled 32 MiB RAM images
|
||||
are identical. Strict/default recordings and snapshots are byte exact; strict
|
||||
comparisons report no mismatch. The closest-car return `1502cc` is live: it runs
|
||||
natively 1,638 times on the one-player route and 845 times on the four-player route
|
||||
with no recorded difference. The player-state return `150094` is cold on these
|
||||
routes and is qualified by the generated owner suite above.
|
||||
|
||||
Fresh isolated window runs complete 6,500 one-player, 6,500 actual four-player
|
||||
and 4,200 movie frames; `1502cc` runs natively 544 times in the one-player window
|
||||
and 197 times in the four-player window. Reviewed captures show the intro and
|
||||
credits, menus, vehicle and level selection, combat with the HUD and four
|
||||
simultaneous views. Each route has five distinct captures. Stereo 48 kHz, 16-bit
|
||||
WAV recordings contain nonzero audio.
|
||||
|
||||
Audio device underruns remain: 57.3 ms silence in one-player, 35.3 ms in
|
||||
four-player and 15.2 ms in the movie run. These are functional checks, not a
|
||||
performance or flawless-playback claim. The mode-`0x14` branch in actual play, full
|
||||
campaign and physical controller/hardware acceptance remain open.
|
||||
@@ -0,0 +1,81 @@
|
||||
# Native BSP collision directions
|
||||
|
||||
The native player now calculates `mathfMulTransVec` (`1da298`) directly for three additional
|
||||
`hdBspNode` return sites: `1cd618`, `1cda54` and `1cdabc`. Together they make 529,424 calls in the
|
||||
qualified 1P route. The existing skid caller (`168b30`) remains native. These are caller-scoped
|
||||
replacements; the other direction callers retain the original helper and its complete ABI.
|
||||
BozoEngine remains at `4a8f70a`.
|
||||
|
||||
The calculation snapshots three basis columns and the input vector, computes separately rounded
|
||||
basis-times-XYZ arithmetic and writes XYZ. Destination W is retained as opaque padding. Native code
|
||||
neither reads nor maintains VU registers, accumulator, flags, microcode or data memory. Scalar CPU
|
||||
registers and timing are unchanged, and the complete host floating-point control word is restored.
|
||||
The existing rare-exponent record arithmetic, overlap, alignment and RAM-alias handling are reused.
|
||||
|
||||
## Consumer audit
|
||||
|
||||
The three calls create the local point/segment directions in `hdBspNode` (`1cd538..1cdeb4`). Their
|
||||
output is the stack vector at `sp+40`; subsequent additions and copies consume XYZ. The inverse
|
||||
transforms at `1cd658`, `1cda84` and `1cdae8` consume XYZ and produce the vector at `sp+50` before
|
||||
scalar additions populate the segment endpoints. Those inverse helpers remain original at these
|
||||
return sites; their output W comes from the inverse basis, independently of input W.
|
||||
|
||||
There are no direct VU register/control/flag reads in `hdBspNode`. Its scalar comparisons and BSP
|
||||
classification continue in the generated code. This scope does not establish a W/flag contract for
|
||||
other direction callers, nor replace the complete collision traversal.
|
||||
|
||||
`TMB_NATIVE_MATH_CHECK=1` compares native XYZ against the original leaf on a copied context and
|
||||
restores memory before the native write. The normal player makes no such original calls for the
|
||||
audited sites. The historical host retains the original helper even at these return addresses.
|
||||
`TMB_NATIVE_DIRECTION_TRACE=1` optionally reports direction-helper frequencies by return address;
|
||||
normal runs do not collect the caller map. Frequencies are not CPU timings.
|
||||
|
||||
## Validation
|
||||
|
||||
Evidence is local under `D:/BozoScratch/direction-callers`, against main `f946958` (PR #20).
|
||||
No game code, captures, RAM dumps or disc data are committed.
|
||||
|
||||
- The matrix/direction suite passes 1,048,576 numerical/ABI comparisons and 512 complete flat-memory
|
||||
comparisons, including 262,144 direction cases distributed across all four audited return sites.
|
||||
Four host rounding modes, denormal controls, extreme/arbitrary input bits, overlap, aliases,
|
||||
scratchpad and low address bits are covered. Native leaf VU state remains untouched. Another
|
||||
2,048 comparisons retain the complete original ABI for unaudited callers.
|
||||
- Another 1,536 cases run the real generated BSP continuations from each new direction call through
|
||||
the scalar vector consumers and original inverse transforms, ending before the next result-buffer
|
||||
operation. They include the two successive direction calls in the segment setup. The actual local
|
||||
stack-vector layout is used. CPU state outside intentionally retired VU effects, cycle/checkpoint
|
||||
counts, host FP control and all memory outside direction-output W agree. Forty-eight comparisons
|
||||
check the entire flat memory; historical-host direction ABI comparisons are exact too.
|
||||
- All nine native suites and all 12 release-tool tests pass. Player, headless and checker builds pass.
|
||||
- Default 1P completes 9,500 frames with 533,524 native directions, versus 4,100 before this change.
|
||||
That retires 529,424 more generated VU direction executions, about 44% of all direction calls in
|
||||
this route. The 4P route completes 8,500 frames; these new BSP sites are not reached there, so its
|
||||
native direction count remains 8,363. There is no measured speedup claim.
|
||||
- Every frame's draw hashes/counts, deterministic sound hashes/sample counts, library calls/counts,
|
||||
EE clocks, scratchpad and thread records match the baseline in both routes. All 4P RAM hashes match
|
||||
too. Default runs make zero original comparisons and zero VU0 microprogram calls.
|
||||
- Separate strict runs enable the native math, hierarchy and projection original comparisons.
|
||||
All 533,524 / 8,363 native direction XYZ comparisons pass (1P / 4P). Both complete frame recordings
|
||||
reproduce their corresponding default recordings byte-for-byte.
|
||||
- Windowed default routes complete 4,201 movie/menu frames and 6,501 frames each for 1P and 4P.
|
||||
Direct captures show the decoded opening movie, menus, the 1P loading screen, active textured combat
|
||||
with rain, vehicle effects and HUD targeting, and all four snow-arena views after loading. Sound is
|
||||
active; device logs report 22.5 / 56.6 / 26.3 ms of silence and some dropped frames. Deterministic
|
||||
sound is exact; flawless device audio or subjective listening acceptance is not claimed.
|
||||
|
||||
## RAM boundary and remaining qualification
|
||||
|
||||
The 1P RAM hashes differ in 3,234 frames, first at 5593. At frame 7000 the complete 32 MB snapshot
|
||||
differs in six bytes across just two stack W words: `8fef5c` and `8ff05c`. A temporary direction trace
|
||||
identifies the corresponding outputs `8fef50` / `8ff050` at BSP frame bases `8fef10` / `8ff010`.
|
||||
The original helper would store inherited VF16.W (`0`); the native helper retains the pre-existing
|
||||
padding (`ffffffff` / `02000200`). There are no differences elsewhere at that snapshot. Temporary
|
||||
watch tracing is removed from the production source and executable. No shadow VU state, padding
|
||||
restoration or broader memory-hash mask is introduced.
|
||||
|
||||
Full campaign, console visual parity, unaudited direction callers and complete VU removal remain
|
||||
outside this bounded qualification. Further BSP inverse directions and other hot direction callers
|
||||
still need their own consumer audit.
|
||||
|
||||
The subsequent [`NATIVE_DIRECTION_CONSUMERS.md`](NATIVE_DIRECTION_CONSUMERS.md) increment adds the
|
||||
vehicle collision-point, tire-height and light-node direction callers with their generated consumers.
|
||||
@@ -0,0 +1,83 @@
|
||||
# Native vehicle and light directions
|
||||
|
||||
The subsequent [BSP/vehicle inverse increment](NATIVE_BSP_INVERSES.md) also retires the inverse leaf
|
||||
following vehicle return `11708c`, with unchanged VU state through the paired setup sequence.
|
||||
|
||||
This increment extends the native `mathfMulTransVec` (`1da298`) path to four more audited return sites:
|
||||
|
||||
| Return | Caller | Immediate consumers |
|
||||
| --- | --- | --- |
|
||||
| `11708c` | `Vehicle::collisSetupHitPoints` | XYZ point addition, then original inverse/scalar point setup |
|
||||
| `1880e0` | `Vehicle::suspCheckTireHeight` | Z displacement, scalar suspension clamps and tire-height write |
|
||||
| `1d4284` | `hierLightNode` | XYZ view translation and scalar normalization |
|
||||
| `1d42e8` | `hierLightNode` | Scalar XYZ dot product and light attenuation |
|
||||
|
||||
It reuses the native basis-times-XYZ calculation and destination-W contract documented in
|
||||
[`NATIVE_DIRECTIONS.md`](NATIVE_DIRECTIONS.md). No VU registers, accumulator, flags or data memory are
|
||||
read or maintained on these native leaf paths. Other return sites and the historical host retain the
|
||||
original helper's complete ABI. BozoEngine remains at `4a8f70a`.
|
||||
|
||||
## Consumer audit
|
||||
|
||||
The collision-point loop writes the direction to the local vector at `sp+10`. `mathfAddVector` reads
|
||||
only XYZ to produce the vehicle's world point. The loop then replaces the temporary XYZ before its
|
||||
original inverse transform and final scalar addition. Direction W contributes to no numerical result
|
||||
in these consumers; the original inverse still loads the complete vector into its compatibility state.
|
||||
The method has no direct VU register/control/flag reads.
|
||||
|
||||
The tire-height loop transforms the local tire point into `sp+10` and reads only its Z at `sp+18`.
|
||||
Generated scalar code computes and clamps the displacement before writing the tire height. Remaining
|
||||
tire iterations reuse that vector, including null/flagged-tire branches. There are no calls after the
|
||||
direction helper in that loop except later direction iterations, and no direct VU state reads.
|
||||
|
||||
The light-node position and direction vectors are at `sp+10` and `sp+30`. Their consumers are scalar
|
||||
XYZ addition, normalization and dot product; light record indices/flags and attenuation are written
|
||||
explicitly. Their W components are not copied into light parameters. The generated continuation
|
||||
retains view lookup, normalization's small-vector branch, light-type branches, count/cursor updates
|
||||
and the saved-register epilogue. `hierLightNode` has no direct VU state reads.
|
||||
|
||||
These are scoped helper replacements, not complete native collision, suspension or light builders.
|
||||
The existing optional original check and caller-frequency trace remain available. No measured speedup
|
||||
is claimed from counts alone.
|
||||
|
||||
## Validation
|
||||
|
||||
Local evidence is under `D:/BozoScratch/collision-directions`, against main `5820992` (PR #21).
|
||||
No generated game code, disc data, captures or RAM dumps are committed.
|
||||
|
||||
- The existing math suite passes 1,048,576 helper numerical/ABI comparisons and 512 full flat-memory
|
||||
comparisons. Its 262,144 direction cases now cover all eight audited return sites, with arbitrary
|
||||
input bits, extreme exponents, four host FP modes, denormal controls, record overlap, RAM aliases,
|
||||
low address bits and scratchpad. Native leaf VU state and complete host MXCSR remain untouched.
|
||||
- Another 2,048 cases execute the actual generated vehicle/light continuations, including collision
|
||||
point addition/inverse setup through the next loop boundary, remaining tire loops and clamps,
|
||||
and both light continuations through their epilogue. They check the CPU state outside intentionally
|
||||
retired VU effects, complete memory outside direction-output W, exact cycles/checkpoints and host
|
||||
FP effects. Sixty-four cases compare the complete flat memory. Historical-host helper ABI checks
|
||||
are exact at all four new sites. The previous 1,536 BSP continuation cases still pass.
|
||||
- The scalar normalization can raise host exception flags. Each reference/native caller test starts
|
||||
from the same complete MXCSR and compares the original continuation's complete outgoing effects;
|
||||
only the native leaf promises to leave MXCSR unchanged.
|
||||
- All ten native suites and 12 release-tool tests pass. Player, headless and checker builds pass.
|
||||
- Default 1P completes 9,500 frames with 855,975 native directions, up from 533,524. The actual 4P
|
||||
route completes 8,500 frames with 207,441, up from 8,363. This retires another 322,451 / 199,078
|
||||
generated direction-helper executions in these routes. All four new sites run in both routes.
|
||||
- Every baseline frame-record field matches in both default routes, including RAM, scratchpad,
|
||||
draw/sound hashes and counts, library calls/counts, EE clocks and thread state. Default runs make
|
||||
no original comparisons and no VU0 microprogram calls.
|
||||
- Strict runs enable native math, hierarchy and projection original checks. All 855,975 / 207,441
|
||||
direction XYZ comparisons pass; both complete recordings reproduce their default files byte-for-byte.
|
||||
- Complete 32 MB snapshots at 1P frame 7000 and 4P frame 6000 match the baseline byte-for-byte.
|
||||
No additional memory-hash mask, padding restoration or shadow VU state is introduced.
|
||||
|
||||
Live 4P qualification also exposed a timing-sensitive native-flare continuation issue. The subsequent
|
||||
fix and its additional native-particle regression target are documented in
|
||||
[`NATIVE_PARTICLE_CONTINUATIONS.md`](NATIVE_PARTICLE_CONTINUATIONS.md). Final results below use both changes.
|
||||
|
||||
Windowed final runs complete 4,201 movie/menu frames and 6,501 frames each for 1P and 4P. Direct final
|
||||
captures show the decoded opening movie, loading screen, active rainy combat with targeting/HUD and
|
||||
vehicle effects, and all four snow-arena views with driving/firing. The 4P run advances through the
|
||||
previous stall point. Device logs report 17.8 / 46.2 / 30.9 ms of silence (movie / 1P / 4P) and some
|
||||
dropped frames; deterministic sound remains exact. Flawless device audio or subjective listening
|
||||
acceptance is not claimed. Full campaign, console visual parity and complete VU removal remain
|
||||
outside the bounded qualification.
|
||||
@@ -0,0 +1,95 @@
|
||||
# Native driver and boss inverses
|
||||
|
||||
Five driver/boss inverse returns now use native record arithmetic, following the
|
||||
[AI increment](NATIVE_AI_INVERSES.md). The coupled final-boss forward transform
|
||||
also becomes native, so the local offset can reach its real vehicle-position
|
||||
consumer without VU transport. Inverse coverage grows from 117 to 122 of 134
|
||||
sites, forward coverage from 95 to 96 of 269. BozoEngine stays at `4a8f70a`.
|
||||
|
||||
| Return PC | Owner | Qualified consumer |
|
||||
| --- | --- | --- |
|
||||
| `1265a8`, `1265d0` | `driverGetOffsetFromPoint` | Path-point local offsets, Y comparison and probe staging |
|
||||
| `1288b0`, `1288c4` | `driverCheckDrivingLOS` | Local X signs, LOS state, random steering choice and publication |
|
||||
| `112118` | `FinalBoss::CheckCollision` | Captured-vehicle local offset and effect-coordinate staging |
|
||||
| `11112c` (forward) | `FinalBoss::UpdateBoss` | Local offset to world XYZ, captured-vehicle position and attachment flags |
|
||||
|
||||
Inverse arithmetic is unchanged: separately rounded XYZ and meaningful first-basis
|
||||
W remain exact. The forward writes XYZ and retains destination W; its sole scratch
|
||||
W at `SP+1c` is audited after the actual XYZ publication and flag consumers.
|
||||
No inverse W is excluded. Native calls leave VU registers, accumulator, flags and
|
||||
data memory untouched. Unknown callers and historical hosts keep the original ABI.
|
||||
|
||||
## Generated-code comparisons
|
||||
|
||||
Evidence is under `D:/BozoScratch/driver-boss-inverses`, against main `bd12a90`
|
||||
(PR #47). Generated code, retail data, recordings and captures stay outside Git.
|
||||
|
||||
- Added coverage is 3,072 generated sequences / 192 whole-memory comparisons.
|
||||
Aggregate coverage is 96,768 / 4,032. Four rounding modes, denormal controls,
|
||||
RAM aliases, rotated bases and arbitrary first-basis W are covered.
|
||||
- Each of the six sites has 256 helper-boundary cases and 256 producer cases.
|
||||
Path offsets include complete `126500` entries, six pre-transform rejection
|
||||
gates, and active Y comparisons. The positive probe path stages its actual
|
||||
150-unit vector and stops at forward helper `1da298`, before the unrelated
|
||||
LOS query. The optional lateral-rotation producer is disabled in these fixtures.
|
||||
- Driving-LOS producer fixtures begin at `128880`, after earlier geometry,
|
||||
LOS and tire queries. They execute actual LOS-state publication, transform
|
||||
gates, opposite/same/zero X tests, the generated seeded random helper and
|
||||
steering-choice stores through the function return. Those earlier queries
|
||||
are outside this bounded fixture; they are not replaced with test stubs.
|
||||
- Boss inverse producers begin at `1120ec`: actual position subtraction,
|
||||
in-place inverse, three real random calls and effect-coordinate staging execute
|
||||
up to particle creation `1e6610`. The resulting local offset then enters the
|
||||
real `UpdateBoss` position producer at `11110c`, transforms forward, translates,
|
||||
publishes vehicle XYZ and updates attachment flags, stopping before the next
|
||||
collision call `111f80`. Standalone forward cases cover that same consumer.
|
||||
Identity and rotated bases must recover the known captured-vehicle position.
|
||||
Earlier collision queries, hit dispatch, particle creation, sound and the rest
|
||||
of the boss state machine are outside these fixtures.
|
||||
- CPU outside retired VU, host FP effects, clocks/checkpoints, per-site inverse
|
||||
counts, random-call counts and final memory agree. Native VU remains untouched
|
||||
through these consumers. Only the audited forward scratch W is normalized in
|
||||
the comparison after the real consumer; no runtime RAM mask or VU reconstruction
|
||||
is introduced. Whole-memory producer samples select active transforms.
|
||||
- Historical inverse ABI coverage is 7,808 / 122 cases / whole-memory checks;
|
||||
historical forward coverage is 5,568 / 348. Existing coverage retains 786,432
|
||||
hierarchy helper cases / 384 whole-memory checks, 8,000 geometric edges,
|
||||
1,024 complete BSP callers / 32 whole-memory checks and 2,048 unknown ABI cases.
|
||||
|
||||
## Replay and window qualification
|
||||
|
||||
Player, headless runner, historical checker and all eleven native test targets
|
||||
build. All eleven native suites and twelve Python tooling tests pass. Existing
|
||||
front/rear AI attack-publication assertions still pass (392 / 352 cases).
|
||||
|
||||
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
|
||||
frames. Every recorded field matches the immediate parent: raw RAM, scratchpad,
|
||||
calls, draws, sound, thread state and EE timing/counts. Sampled 32 MiB RAM images
|
||||
are identical. Strict/default recording files and snapshots are byte exact, with
|
||||
no strict comparison mismatches.
|
||||
|
||||
One-player reaches all four new driver sites: 16 calls each to the path-offset
|
||||
returns and 39 each to the driving-LOS returns (110 total). Four-player makes no
|
||||
new driver/boss calls in this four-human scenario. The boss sites are cold in
|
||||
these replay routes; their attachment behavior is qualified by the generated-code
|
||||
fixtures above, not a complete boss fight.
|
||||
|
||||
Fresh isolated window runs complete 6,500 one-player, 6,500 actual four-player
|
||||
and 4,200 movie frames. Reviewed captures show level loading, advancing gameplay,
|
||||
AI opponents, driving/combat/effects, four simultaneous views, decoded intro
|
||||
images and return to the menu. Each route has five distinct captures.
|
||||
|
||||
Windowed one-player reaches the two path-offset sites nine times each. The
|
||||
other new sites are cold in this shorter window sample; driving-LOS is reached
|
||||
in the headless replay and boss publication in the generated fixtures.
|
||||
Four-player and movies make no new driver/boss calls. Stereo 48 kHz, 16-bit WAV
|
||||
captures contain nonzero audio. Device underruns remain: 55.0 ms silence in 1P,
|
||||
28.3 ms in 4P and 27.8 ms in movies. These are functional checks, not a timing
|
||||
or flawless-playback claim. Full campaign, a complete final-boss fight and
|
||||
physical-controller/hardware acceptance remain outside this increment.
|
||||
|
||||
## Remaining scope
|
||||
|
||||
Of these two helper families, 12 inverse and 173 forward sites remain outside the
|
||||
native allowlists: 185 total. This is a call-site inventory, not a count of all
|
||||
remaining emulation. Additional inline arithmetic remains separate work.
|
||||
@@ -0,0 +1,96 @@
|
||||
# Native driver forward transforms
|
||||
|
||||
Seven driver forward returns use native XYZ record arithmetic after the
|
||||
[rigid-body forward increment](NATIVE_RIGID_BODY_FORWARD.md). Coverage grows
|
||||
from 106 to 113 of 269 known forward returns (156 remain). Known inverse coverage
|
||||
stays 134 of 134; unknown/historical callers retain the original ABI.
|
||||
BozoEngine stays at `4a8f70a`.
|
||||
|
||||
| Return PC | Owner | Qualified consumer |
|
||||
| --- | --- | --- |
|
||||
| `126618` | `driverGetOffsetFromPoint` | 150-unit world probe, Manhattan gate, actual LOS query and path-offset publication |
|
||||
| `1267f0` | `driverGetOffsetFromPoint` | Actual RPH rotation and bounded-angle producer, lateral path-offset publication |
|
||||
| `1276a4` | `driverCalcLookahead` | Distance/speed prediction and translated target publication |
|
||||
| `128704`, `128744` | `driverCheckDrivingLOS` | Special/ordinary world query start points |
|
||||
| `1287dc`, `12880c` | `driverCheckDrivingLOS` | Special/ordinary world query endpoints, actual LOS and driver-state consumers |
|
||||
|
||||
Native arithmetic preserves separately rounded XYZ, destination W and the VU
|
||||
registers, accumulator, flags and data memory. The original scalar driver logic,
|
||||
collision queries, matrix/trigonometric/angle producers and meaningful inverse
|
||||
outputs remain intact. This change extends the audited native return selection;
|
||||
it does not change steering or collision policy.
|
||||
|
||||
## Generated-code comparisons
|
||||
|
||||
Evidence is under `D:/BozoScratch/driver-forward`, against immediate parent
|
||||
`94ad67d` (PR #51). Retail data, generated bodies and replay artifacts stay
|
||||
outside Git.
|
||||
|
||||
- Added coverage is 3,584 generated sequences / 224 whole-memory comparisons:
|
||||
each return has 256 helper-boundary sequences through its actual tail and 256
|
||||
complete owner entries. Four rounding modes, FTZ/DAZ, RAM aliases, identity and
|
||||
rotated bases, opaque W payloads, zero/tiny/signed vectors and speeds, and
|
||||
lookahead outputs aliasing vehicle/target positions are covered.
|
||||
- Path probes exercise active and gated entries, near/far Manhattan checks,
|
||||
actual `hdLosTest`, `terrainCollision` and `hdWalkColGrid`, clear-path flags and
|
||||
publication. Lateral entries execute real scalar RPH construction, original
|
||||
sine/cosine calls and angle wrapping, zero-width/node gates, signed offsets and
|
||||
path-node width scaling before the final vector addition.
|
||||
- Lookahead entries cover missing targets, stopped targets, near-distance gates,
|
||||
moving/reversing targets, rotated bases and aliased publication. Known complete
|
||||
entries require exact translated results, alongside original/native comparison.
|
||||
- Driving-LOS entries execute counter increment/wrap, actual point subtraction,
|
||||
normalization and matrix construction, speed/height adjustments, short-target
|
||||
endpoint selection, real queries and clear-state/mask publication. Existing
|
||||
inverse consumers run where enabled and their full meaningful W is compared.
|
||||
- Query fixtures use actual empty terrain and endpoints outside the collision
|
||||
grid X bounds. No collision/query result is stubbed. These fixtures qualify
|
||||
real clear-path consumers; they do not claim obstructed-world coverage.
|
||||
Runtime reach is reported separately below.
|
||||
- Explicit per-return and query/producer counts are required. Known-state
|
||||
assertions publish 32 probe cases, 32 lateral offsets, 32 lookahead positions
|
||||
and 64 LOS endpoint pairs. Whole-memory complete-entry samples reach active
|
||||
transforms. CPU outside retired VU, clocks/checkpoints, host FP effects, query
|
||||
endpoints and final RAM agree. Native VU remains untouched through complete
|
||||
producers and consumers.
|
||||
- Opaque forward W is restricted to the actual frame's `SP+ac` (probe), `SP+5c`
|
||||
(lateral), `SP+1c` (lookahead), or `SP+1c`/`SP+2c` (LOS). Exact output counts
|
||||
and addresses are asserted separately for boundary and complete-entry frames.
|
||||
Original W stays live through all real consumers before comparison-only
|
||||
normalization. Inverses replacing forward scratch remove that exclusion and
|
||||
compare full XYZW. No runtime RAM mask or VU-bank reconstruction is added.
|
||||
- Aggregate generated caller coverage is 111,616 sequences / 4,960 whole-memory
|
||||
checks. Historical forward ABI coverage is 6,656 / 416; inverse stays 8,576 /
|
||||
134. Existing hierarchy, geometric, BSP and unknown-ABI coverage remains.
|
||||
Earlier AI, vehicle/light and final inverse publication assertions stay enabled.
|
||||
|
||||
## Replay and window qualification
|
||||
|
||||
Player, headless runner, historical checker and all eleven native test targets
|
||||
build. All eleven native suites and twelve Python tooling tests pass. Earlier AI,
|
||||
vehicle/light and final inverse publication assertions remain enabled.
|
||||
|
||||
Default and strict runs complete 9,500 one-player and 8,500 actual four-player
|
||||
frames. Every recorded field matches immediate parent `94ad67d`: raw RAM,
|
||||
scratchpad, calls, draws, sound, thread state and EE timing/counts. Sampled 32 MiB
|
||||
RAM images are identical. Strict/default recording files and snapshots are byte
|
||||
exact; strict checks report no mismatch.
|
||||
|
||||
One-player reaches the new probe `126618` ten times and LOS sites `128704`,
|
||||
`128744`, `1287dc`, `12880c` 198, 799, 136 and 799 times respectively. Lateral
|
||||
`1267f0` and pursuit `1276a4` are cold on these replay routes and are qualified by
|
||||
complete generated owners and their real scalar consumers. Four-player makes no
|
||||
calls to any of these seven sites.
|
||||
|
||||
Fresh isolated window runs complete 6,500 one-player, 6,500 actual four-player
|
||||
and 4,200 movie frames. Reviewed captures show level loading, advancing driving,
|
||||
AI opponents, combat/effects, four simultaneous views, decoded intro footage and
|
||||
return to the menu. Each route has five distinct captures. Stereo 48 kHz,
|
||||
16-bit WAV recordings contain nonzero audio.
|
||||
|
||||
Windowed one-player reaches the probe five times and the four LOS returns 112,
|
||||
457, 93 and 457 times; lateral/lookahead remain cold. Four-player and movies make
|
||||
no calls to these seven sites. Device underruns remain: 52.7 ms silence in 1P,
|
||||
33.2 ms in 4P and 27.6 ms in movies. These are functional checks, not a timing or
|
||||
flawless-playback claim. Full campaign, every driver/world configuration and
|
||||
physical-controller/hardware acceptance remain outside this increment.
|
||||
@@ -0,0 +1,103 @@
|
||||
# Native helicopter gun and walking pedestrian forward transforms
|
||||
|
||||
[Machine-gun muzzle forwards](NATIVE_MACHINE_GUN_FORWARD.md) follow with the two weapon-initialization sites.
|
||||
|
||||
Two single-site forward returns use native XYZ arithmetic after the
|
||||
[falling junk jet forwards](NATIVE_JET_DEATH_FORWARD.md). Known forward coverage
|
||||
grows from 163 to 165 of 269 returns (104 remain). Known inverse coverage stays 134
|
||||
of 134; BozoEngine stays at `4a8f70a`.
|
||||
|
||||
| Return PC | Owner | Producer and consumer |
|
||||
| --- | --- | --- |
|
||||
| `129c48` | `EnvHeli::UpdateEnvHeli` (`1297e8`) | The gun's muzzle offset (game table `4e50d0`) through the helicopter's basis, in place, plus its position, passed to `Weapons::CreateStaticWeapon` as the shot origin |
|
||||
| `10cc7c` | `AttractPed::updateTrans` (`10cbf0`) | A walking pedestrian's velocity, scaled by 60/update rate, through its basis, added to its position |
|
||||
|
||||
In attack mode, the environment helicopter takes the closest live car from the
|
||||
game's vehicle array (`Launcher::GetClosestCar`). It turns toward the car with
|
||||
`mathfRotationFromPointToPoint`, smoothing, and `UpdateRot` (`mathfRotMatrixH`,
|
||||
`mathfRotMatrixRPH`). On every 30th update with the aim inside its tolerance, it
|
||||
fires from the transformed muzzle point. The result is the frame vector at `+10`,
|
||||
read only by `mathfAddVector` and by `CreateStaticWeapon`. The environment-gun
|
||||
increment already established that `CreateStaticWeapon` reads only X/Y/Z. Frame
|
||||
`+1c` is never read.
|
||||
|
||||
The attract-mode pedestrian, when its coordinate system is on, moves by the
|
||||
transformed velocity. The probe is lifted by 5 for `hdHatTest`, then the height is
|
||||
settled and the walk animation speed set. The result is the frame vector at `+10`.
|
||||
It is read only by `mathfAddVector`. `hdHatTest` receives the same pointer as an
|
||||
output and only writes it (`mathfCopyVector`, `mathfSetFVector`). Frame `+1c` is
|
||||
never read.
|
||||
|
||||
Neither owner reads VU registers, the accumulator or flags. The existing native
|
||||
helper computes separately rounded XYZ, preserves destination W and leaves VU state
|
||||
untouched. It reads its input before writing, so the in-place transform is safe.
|
||||
Unknown and historical callers keep the original ABI. No engine or gameplay formula
|
||||
changes.
|
||||
|
||||
## Generated comparisons
|
||||
|
||||
Evidence is under `D:/BozoScratch/envheli-ped-forward`, against parent `ba9f83e`
|
||||
(PR #67). Parent headless/window binaries are preserved there and match PR #67's
|
||||
qualified build. Generated bodies, retail data and runtime recordings stay outside
|
||||
Git.
|
||||
|
||||
- Added coverage is 1,024 generated sequences / 64 whole-memory comparisons (caller
|
||||
kinds 268 and 269): helper-boundary continuations and full-owner entries, across
|
||||
four rounding modes, FTZ/DAZ, RAM aliases, identity/quarter-turn bases and
|
||||
arbitrary W payloads.
|
||||
- Helicopter entries cover the following, and reaching each stop is asserted:
|
||||
- Car selection, the aim and the matrix rebuild, then the firing update, which
|
||||
stops at `CreateStaticWeapon`.
|
||||
- A non-firing update, which stops at `UpdateTrans` (it has its own native
|
||||
transform).
|
||||
- A non-attacking mode, which stops at its sound update.
|
||||
- Pedestrian entries cover the update-rate scaling, the transform, the probe lift,
|
||||
`hdHatTest` on the empty grid and both height-settling branches. They stop at
|
||||
`getDbId`, ahead of the animation-speed tables. A pedestrian whose coordinate
|
||||
system is off drifts without a transform and stops at its grid reparent.
|
||||
- Helper-boundary outputs are checked against an independent identity or
|
||||
quarter-turn result. Full entries rebuild or scale first, so those are covered by
|
||||
the native/original comparison.
|
||||
- Published values are asserted exactly against the original FPU addition:
|
||||
- the shot origin passed to `CreateStaticWeapon`;
|
||||
- the pedestrian's X/Y position, and the point `hdHatTest` received.
|
||||
|
||||
The helicopter site publishes in 448 cases, the pedestrian in 480.
|
||||
- The VU rule from the earlier weapon increments applies. Only forward scratch W at
|
||||
frame `+1c` is normalized for test comparison, after every real consumer.
|
||||
- New caller kinds shift the shared random fill for later rounding modes, so two
|
||||
data-dependent counts in earlier fixtures moved (vehicle tire jumps 704 → 705,
|
||||
real libm errno cases 813 → 828). All scenario-defined counts and assertions are
|
||||
unchanged.
|
||||
- Aggregate caller coverage is 138,240 generated sequences / 6,624 whole-memory
|
||||
comparisons. Historical forward ABI coverage is 9,984 / 624; inverse remains
|
||||
8,576 / 134.
|
||||
|
||||
## Replay and window qualification
|
||||
|
||||
Player, headless runner, historical checker and all eleven native test targets
|
||||
build. All eleven native suites and twelve Python tooling tests pass, with every
|
||||
previous publication assertion enabled.
|
||||
|
||||
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
|
||||
frames. Every recording field matches parent `ba9f83e`: raw RAM, scratchpad,
|
||||
calls, draws, sound, thread state and EE timing/counts. Sampled 32 MiB RAM images
|
||||
are identical. Strict/default recordings and snapshots are byte exact; strict
|
||||
comparisons report no mismatch. The pedestrian return `10cc7c` is live: it runs
|
||||
natively 390 times on the one-player route (default and strict) with no recorded
|
||||
difference. The helicopter gun return `129c48` is cold on these routes and is
|
||||
qualified by the generated owner suite above.
|
||||
|
||||
Fresh isolated window runs, started after the headless replays had finished,
|
||||
complete 6,500 one-player, 6,500 actual four-player and 4,200 movie frames.
|
||||
Reviewed captures show the intro and credits, menus, vehicle and level selection,
|
||||
driving with the HUD and four simultaneous views. Each route has five distinct
|
||||
captures. In the qualification movie run, the frame-1,000 capture landed in a fade
|
||||
and was nearly black. Two back-to-back short reruns (new build, then parent)
|
||||
captured frames 900 to 1,100. Both show the same fade at 900 and the intro at
|
||||
1,000, with comparable brightness. The black frame was real-time movie timing,
|
||||
not this change. Stereo 48 kHz, 16-bit WAV recordings contain nonzero audio.
|
||||
Audio device underruns: 55.8 ms of silence in one-player, 32.9 ms in four-player
|
||||
and 37.7 ms in the movie run. These are functional checks, not a performance or
|
||||
flawless-playback claim. The attacking helicopter in actual play, full campaign and
|
||||
physical controller/hardware acceptance remain open.
|
||||
@@ -0,0 +1,79 @@
|
||||
# Native environment gun forward transforms
|
||||
|
||||
[Ferris wheel fall and smasher camera forwards](NATIVE_FERRIS_SMASHER_FORWARD.md) follow with two environment sites.
|
||||
|
||||
The two `Launcher::UpdateEnvWeapon` (`14d3a0`) forward returns use native XYZ
|
||||
arithmetic after the [Cop SUV laser-aim forwards](NATIVE_COPSUV_AIM_FORWARD.md).
|
||||
Known forward coverage grows from 144 to 146 of 269 returns (123 remain). Known
|
||||
inverse coverage stays 134 of 134; BozoEngine stays at `4a8f70a`.
|
||||
|
||||
| Return PC | Producer and consumer |
|
||||
| --- | --- |
|
||||
| `14d62c` | Muzzle offset table `23d240` through the gun's basis, plus the gun position, passed to `Weapons::CreateStaticWeapon` as the shot origin (toggle at `+f0` set) |
|
||||
| `14d678` | Same with the alternate muzzle table `23d250` (toggle clear) |
|
||||
|
||||
The game-mode jump table at `4e71c0` selects the environment-gun case. It aims
|
||||
the gun at the nearest valid vehicle and fires every tenth update, alternating
|
||||
muzzles. The result is the owner's frame vector at `+0`. `mathfAddVector` reads its
|
||||
XYZ, and `CreateStaticWeapon` (`1b7590`) reads the position only through two
|
||||
scalar `mathfCopyVector` calls; its `InitWeapon` and `activateWeaponSound` calls do
|
||||
not receive it. The owner never reads frame `+0c` (the output W) and reads no VU
|
||||
registers, accumulator or flags. The existing native helper computes separately
|
||||
rounded XYZ, preserves destination W and leaves VU state untouched. Unknown and
|
||||
historical callers keep the original ABI. No engine or gameplay formula changes.
|
||||
|
||||
## Generated comparisons
|
||||
|
||||
Evidence is under `D:/BozoScratch/envweapon-forward`, against parent `aadc76b`
|
||||
(PR #60). Parent headless/window binaries are preserved there and match PR #60's
|
||||
qualified build. Generated bodies, retail data and runtime recordings stay
|
||||
outside Git.
|
||||
|
||||
- Added coverage is 1,024 generated sequences / 64 whole-memory comparisons
|
||||
(caller kinds 249 and 250): helper-boundary continuations and full-owner
|
||||
entries, across four rounding modes, FTZ/DAZ, RAM aliases, identity/quarter-turn
|
||||
bases and arbitrary W payloads.
|
||||
- Full entries go through the real jump table, the nearest-vehicle search over the
|
||||
game's embedded vehicle array, the aim smoothing and basis rebuild, and the fire
|
||||
counter. Each fire stops at `CreateStaticWeapon`, whose position argument is
|
||||
captured; the toggled muzzle state is asserted. The no-fire update count returns
|
||||
normally without a transform. Producer reach is asserted in every case.
|
||||
- Helper-boundary outputs are checked against an independent identity or
|
||||
quarter-turn result. Full entries rebuild the gun basis from its aim angles first,
|
||||
so those are covered by the native/original comparison. The shot origin passed
|
||||
to `CreateStaticWeapon` is asserted exactly against the original FPU addition.
|
||||
Each site publishes in 480 cases.
|
||||
- The VU rule from the earlier weapon increments applies. Only forward scratch W
|
||||
at frame `+0c` is normalized for test comparison, after every real consumer.
|
||||
- New caller kinds shift the shared random fill for later rounding modes, so two
|
||||
data-dependent counts in earlier fixtures moved (vehicle tire jumps 715 → 718,
|
||||
real libm errno cases 850 → 802). All scenario-defined counts and assertions are
|
||||
unchanged.
|
||||
- Aggregate caller coverage is 128,512 generated sequences / 6,016 whole-memory
|
||||
comparisons. Historical forward ABI coverage is 8,768 / 548; inverse remains
|
||||
8,576 / 134.
|
||||
|
||||
## Replay and window qualification
|
||||
|
||||
Player, headless runner, historical checker and all eleven native test targets
|
||||
build. All eleven native suites and twelve Python tooling tests pass, with every
|
||||
previous publication assertion enabled.
|
||||
|
||||
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
|
||||
frames. Every recording field matches parent `aadc76b`: raw RAM, scratchpad,
|
||||
calls, draws, sound, thread state and EE timing/counts. Sampled 32 MiB RAM images
|
||||
are identical. Strict/default recordings and snapshots are byte exact; strict
|
||||
comparisons report no mismatch. Both environment-gun sites are cold on these
|
||||
routes, so the generated owner suite above is their qualification. The Cop SUV site `1502cc` still runs natively 1,638 times (one-player)
|
||||
and 845 times (four-player), exact.
|
||||
|
||||
Fresh isolated window runs complete 6,500 one-player, 6,500 actual four-player
|
||||
and 4,200 movie frames. Reviewed captures show the intro and credits, menus,
|
||||
vehicle and level selection, driving with the HUD and four simultaneous views.
|
||||
Each route has five distinct captures. Stereo 48 kHz, 16-bit WAV recordings
|
||||
contain nonzero audio.
|
||||
|
||||
Audio device underruns remain: 56.0 ms silence in one-player, 56.3 ms in
|
||||
four-player and 15.7 ms in the movie run. These are functional checks, not a
|
||||
performance or flawless-playback claim. A level with the environment gun firing,
|
||||
full campaign and physical controller/hardware acceptance remain open.
|
||||
@@ -0,0 +1,77 @@
|
||||
# Native Ferris wheel and final boss hit-test forward transforms
|
||||
|
||||
[The special-weapon torch batch](NATIVE_SPECIAL_TORCH_FORWARD.md) follows with the last ten UpdateSpecial sites.
|
||||
|
||||
Four more hit-test forward returns use native XYZ arithmetic after the
|
||||
[weapon hit-test batch](NATIVE_WEAPON_HIT_FORWARD.md). Known forward coverage grows
|
||||
from 222 to 226 of 269 returns (43 remain). Known inverse coverage stays 134 of 134;
|
||||
BozoEngine stays at `4a8f70a`.
|
||||
|
||||
| Return PC | Producer and consumer |
|
||||
| --- | --- |
|
||||
| `12a6d8` | `FerrisWheel::UpdateFerrisWheel` (`12a580`): the wheel's offset at `+30` goes through its coordinate system (pointer at `+90`) into frame `+0`. `mathfAddVector` adds it into the system's position, which is raised by 20 and height-tested (`hdHatTest`) |
|
||||
| `12a930` | A random car offset in frame `+10` goes through the system into frame `+0`, plus the position. It becomes `hdPntSphereTest`'s point against the wheel; on a hit, `mathfSubVector` rewrites its XYZ and `DispatchHit` gets it |
|
||||
| `12a9e8` | The seat offset in frame `+20` the same way, after the first test's hit dispatch: `hdPntSphereTest`, then `mathfSubVector` and `DispatchHit` |
|
||||
| `11201c` | `FinalBoss::CheckCollision` (`111f80`): each collision point from the table at `+710` goes through the boss's coordinate system (`+e0`) into frame `+0`, plus the position. It becomes `hdPntSphereTest`'s point; on a hit, `mathfSubVector` and `DispatchHit` |
|
||||
|
||||
The consumers are the ones audited for the
|
||||
[weapon hit-test batch](NATIVE_WEAPON_HIT_FORWARD.md): `hdPntSphereTest` and every
|
||||
reader of its globals, all twelve `DispatchHit` handlers, and the XYZ helpers. They
|
||||
read the point only as XYZ, and nothing copies its W. `12a6d8`'s result reaches only
|
||||
`mathfAddVector`; `hdHatTest` gets the coordinate system's position, whose W no
|
||||
forward writes. Neither owner ever loads frame `+0c`, and neither reads VU
|
||||
registers, accumulator or flags. The existing native helper computes separately
|
||||
rounded XYZ, preserves destination W and leaves VU state untouched. Unknown and
|
||||
historical callers keep the original ABI. No engine or gameplay formula changes.
|
||||
|
||||
## Generated comparisons
|
||||
|
||||
Evidence is under `D:/BozoScratch/ferris-boss-forward`, against parent `eefb151`
|
||||
(PR #81). Parent headless/window binaries are preserved there and match PR #81's
|
||||
qualified build. Generated bodies, retail data and runtime recordings stay outside
|
||||
Git.
|
||||
|
||||
- Added coverage is 2,048 generated sequences / 128 whole-memory comparisons (caller
|
||||
kinds 327 to 330): helper-boundary continuations and full entries, across four
|
||||
rounding modes, FTZ/DAZ, RAM aliases, identity/quarter-turn bases and arbitrary W
|
||||
payloads.
|
||||
- `11201c` runs from the owner's start and stops at `hdPntSphereTest`. The Ferris
|
||||
wheel sites start at the call-return label before each transform (`12a6c4`,
|
||||
`12a918`, `12a9c8`); `12a6d8` stops at `hdHatTest`, the other two at
|
||||
`hdPntSphereTest`.
|
||||
- The harness requires each full entry to reach exactly its own transform. Every
|
||||
basis is fixture-known, so every site is checked against an independent identity
|
||||
or quarter-turn result.
|
||||
- Published values are asserted exactly against the original FPU arithmetic: the
|
||||
point each hit test receives, and that it receives that address; for `12a6d8`,
|
||||
the position after the raise by 20. Publications: 512 for each site.
|
||||
- The VU rule from the earlier weapon increments applies. Only forward scratch W at
|
||||
frame `+0c` is normalized for test comparison, after every real consumer.
|
||||
- New caller kinds shift the shared random fill for later rounding modes, so two
|
||||
data-dependent counts in earlier fixtures moved (vehicle tire jumps 718 → 709,
|
||||
real libm errno cases 842 → 843). All scenario-defined counts and assertions are
|
||||
unchanged.
|
||||
- Aggregate caller coverage is 169,472 generated sequences / 8,576 whole-memory
|
||||
comparisons. Historical forward ABI coverage is 13,888 / 868; inverse remains
|
||||
8,576 / 134.
|
||||
|
||||
## Replay and window qualification
|
||||
|
||||
Player, headless runner, historical checker and all eleven native test targets
|
||||
build. All eleven native suites and twelve Python tooling tests pass, with every
|
||||
previous publication assertion enabled.
|
||||
|
||||
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
|
||||
frames. Every recording field matches parent `eefb151`, including the RAM hash on
|
||||
every frame: scratchpad, calls, draws, sound, thread state and EE timing/counts.
|
||||
Sampled 32 MiB RAM images are identical. Strict/default recordings and snapshots
|
||||
are byte exact; strict comparisons report no mismatch. The four returns are cold on these routes and are qualified by the generated owner suite above.
|
||||
|
||||
Fresh isolated window runs, started after the headless replays had finished,
|
||||
complete 6,500 one-player, 6,500 actual four-player and 4,200 movie frames.
|
||||
Reviewed captures show the intro and credits, menus, vehicle and level selection,
|
||||
driving with the HUD and four simultaneous views. Each route has five distinct
|
||||
captures. Stereo 48 kHz, 16-bit WAV recordings contain nonzero audio. Audio device
|
||||
underruns: 44.9 ms of silence in one-player, 26.9 ms in four-player and 21.7 ms in
|
||||
the movie run. These are functional checks, not a performance or flawless-playback
|
||||
claim. The Ferris wheel and final boss in actual play, full campaign and physical controller/hardware acceptance remain open.
|
||||
@@ -0,0 +1,83 @@
|
||||
# Native Ferris wheel fall and smasher camera forward transforms
|
||||
|
||||
[Falling helicopter forwards](NATIVE_HELI_DEATH_FORWARD.md) follow with two more environment sites.
|
||||
|
||||
Two environment forward returns use native XYZ arithmetic after the
|
||||
[environment gun forwards](NATIVE_ENVWEAPON_FORWARD.md). Known forward coverage
|
||||
grows from 146 to 148 of 269 returns (121 remain). Known inverse coverage stays 134
|
||||
of 134; BozoEngine stays at `4a8f70a`.
|
||||
|
||||
| Return PC | Owner | Producer and consumer |
|
||||
| --- | --- | --- |
|
||||
| `12aad4` | `FerrisWheel::UpdateFalling` (`12aa98`) | The falling car's velocity through its coordinate system, added to its position; the resulting height selects the landing state at `gp-312c` |
|
||||
| `169ed0` | `Smashers::SmasherHit` (`169d48`) | Camera offset `(0, -200, 60)` through the slot camera's basis, added to the hit vehicle's position and handed to `TheGame::DetachCamera` |
|
||||
|
||||
The Ferris wheel result is the owner's frame vector at `+0`, read only by
|
||||
`mathfAddVector`. Later stack use starts at `+10`, so frame `+0c` is never read.
|
||||
The smasher result is at frame `+10`. `mathfAddVector` and `Camera::DetachCamera`
|
||||
read it only as XYZ: a scalar `mathfCopyVector` into the camera, then the real
|
||||
point-to-point rotation and matrix rebuild. Frame `+1c` is never read. Neither
|
||||
owner reads VU registers, the accumulator or flags; `vehicleStunCar` only writes
|
||||
one vehicle field. The existing native helper computes separately rounded XYZ,
|
||||
preserves destination W and leaves VU state untouched. Unknown and historical
|
||||
callers keep the original ABI. No engine or gameplay formula changes.
|
||||
|
||||
## Generated comparisons
|
||||
|
||||
Evidence is under `D:/BozoScratch/ferris-smasher-forward`, against parent
|
||||
`9057db2` (PR #61). Parent headless/window binaries are preserved there and match
|
||||
PR #61's qualified build. Generated bodies, retail data and runtime recordings
|
||||
stay outside Git.
|
||||
|
||||
- Added coverage is 1,024 generated sequences / 64 whole-memory comparisons
|
||||
(caller kinds 251 and 252): helper-boundary continuations and full-owner
|
||||
entries, across four rounding modes, FTZ/DAZ, RAM aliases, identity/quarter-turn
|
||||
bases and arbitrary W payloads.
|
||||
- Ferris wheel full entries run the whole owner. Both landing states are covered
|
||||
(still falling above height 10, landed below), and the published position and
|
||||
state are asserted. All 512 cases publish.
|
||||
- Smasher full entries run the stun, the slot search and the real
|
||||
`Camera::DetachCamera`. A new 0x20-byte snapshot region covers the game's camera
|
||||
mode table at `4ac0d0`, which DetachCamera writes. The camera's copied position,
|
||||
the claimed smasher slot and the camera mode are asserted. The inactive-smasher,
|
||||
no-camera-slot and occupied-slot scenarios return without a transform, and
|
||||
producer reach is asserted in every case. 416 cases publish.
|
||||
- Transform outputs are checked against an independent identity or quarter-turn
|
||||
result in every reached case. Published points are exact against the original
|
||||
FPU addition.
|
||||
- The VU rule from the earlier weapon increments applies. Only forward scratch W
|
||||
(frame `+0c` and `+1c` respectively) is normalized for test comparison, after
|
||||
every real consumer.
|
||||
- New caller kinds and the new region shift the shared random fill for later
|
||||
rounding modes, so two data-dependent counts in earlier fixtures moved (vehicle
|
||||
tire jumps 718 → 715, real libm errno cases 802 → 830). All scenario-defined
|
||||
counts and assertions are unchanged.
|
||||
- Aggregate caller coverage is 129,536 generated sequences / 6,080 whole-memory
|
||||
comparisons. Historical forward ABI coverage is 8,896 / 556; inverse remains
|
||||
8,576 / 134.
|
||||
|
||||
## Replay and window qualification
|
||||
|
||||
Player, headless runner, historical checker and all eleven native test targets
|
||||
build. All eleven native suites and twelve Python tooling tests pass, with every
|
||||
previous publication assertion enabled.
|
||||
|
||||
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
|
||||
frames. Every recording field matches parent `9057db2`: raw RAM, scratchpad,
|
||||
calls, draws, sound, thread state and EE timing/counts. Sampled 32 MiB RAM images
|
||||
are identical. Strict/default recordings and snapshots are byte exact; strict
|
||||
comparisons report no mismatch. Both new sites are cold on these routes, so the
|
||||
generated owner suite above is their qualification. The Cop SUV site `1502cc`
|
||||
still runs natively 1,638 times (one-player) and 845 times (four-player), exact.
|
||||
|
||||
Fresh isolated window runs complete 6,500 one-player, 6,500 actual four-player
|
||||
and 4,200 movie frames. Reviewed captures show the intro and credits, menus,
|
||||
vehicle and level selection, combat with the HUD and four simultaneous views.
|
||||
Each route has five distinct captures. Stereo 48 kHz, 16-bit WAV recordings
|
||||
contain nonzero audio.
|
||||
|
||||
Audio device underruns remain: 46.1 ms silence in one-player, 69.8 ms in
|
||||
four-player and 28.3 ms in the movie run. These are functional checks, not a
|
||||
performance or flawless-playback claim. A level with a falling Ferris wheel car or
|
||||
a smasher hit in actual play, full campaign and physical controller/hardware
|
||||
acceptance remain open.
|
||||
@@ -0,0 +1,121 @@
|
||||
# Final native inverse-helper returns
|
||||
|
||||
The final six known inverse-helper returns now use native record arithmetic,
|
||||
following the [vehicle/light increment](NATIVE_VEHICLE_LIGHT_INVERSES.md).
|
||||
All 134 static return sites for `mathfMulVec` (`1da1e8`) are now in the native
|
||||
allowlist. Forward coverage stays at 96 of 269. BozoEngine stays at `4a8f70a`.
|
||||
|
||||
| Return PC | Owner | Qualified consumer |
|
||||
| --- | --- | --- |
|
||||
| `12d0b0` | `forceFieldTakeHit` | Axis scaling, normalization, scalar response and hit-state publication |
|
||||
| `136ce8` | `healthStandInit` | Four local vertices transformed and translated into a stand record |
|
||||
| `13f814` | `Hud::BuildRadarStuff` | Distance-dependent alpha and real packet stores |
|
||||
| `13fe54` | `Hud::BuildRadarStuff` | Nearest-target distance/ID publication and draw-argument staging |
|
||||
| `14037c` | `Hud::AddRadarSignal` | Range/direction placement, height flashing, color and signal-count stores |
|
||||
| `1e9778` | `particleDraw` | Camera-space visibility and sorted depth/index publication |
|
||||
|
||||
The inverse implementation is unchanged: separately rounded XYZ and meaningful
|
||||
first-basis W remain exact. No W exclusion is added. Native leaves do not write
|
||||
VU registers, accumulator, flags or data memory. Unknown returns and historical
|
||||
hosts keep the original ABI; the original implementation remains for those
|
||||
contracts. This completes the known static inverse call-site inventory, not all
|
||||
remaining emulation or all inline VU arithmetic.
|
||||
|
||||
## Generated-code comparisons
|
||||
|
||||
Evidence is under `D:/BozoScratch/final-inverses`, against main `9298010`
|
||||
(PR #49). Generated code, retail data, recordings and captures stay outside Git.
|
||||
|
||||
- Added coverage is 3,072 generated sequences / 192 whole-memory comparisons.
|
||||
Aggregate coverage is 102,912 / 4,416. Each return has 256 helper-boundary cases
|
||||
through its actual consumer and 256 producer cases. Four host rounding modes,
|
||||
denormal controls, RAM aliases, rotated bases and arbitrary basis W are covered.
|
||||
Whole-memory producer samples select active transforms.
|
||||
- Force-field fixtures include complete `12d038` entries and inactive/null-input
|
||||
gates. The original inline VU subtraction before the inverse is retained;
|
||||
its pre-inverse VU effects agree between original/native runs. The native leaf
|
||||
and complete scalar tail preserve that producer state. Real normalization,
|
||||
dot products, axis scaling, square-root response and hit-state publication run.
|
||||
Meaningful inverse W is checked explicitly. Hit publication is required in
|
||||
448 cases. This increment does not retire the inline subtraction itself.
|
||||
- Health-stand fixtures execute the complete `136c70` entry and four-vertex loop,
|
||||
including real scalar translations, record pointers and count update. Each
|
||||
transformed vertex must match known identity/rotated positions, rather than
|
||||
merely match a second implementation. Helper-boundary cases also complete all
|
||||
four iterations. All inverse output lanes remain compared in memory.
|
||||
- First radar-distance producers begin at `13f7b0`, after earlier viewport and
|
||||
vehicle-loop setup. They run visibility/class gates, actual position subtraction,
|
||||
inverse, square-root distance, scalar/double alpha interpolation and packet
|
||||
stores, stopping at the next vehicle-loop checkpoint `13f378`. Five packet
|
||||
records and exact near/interpolated/far alpha are required. Packet publication
|
||||
occurs in 480 cases. Earlier HUD setup and the enclosing loop are outside these
|
||||
bounded fixtures.
|
||||
- Nearest-target producers begin at `13fd58`; actual visibility/class gates,
|
||||
position subtraction, inverse and distance-to-target stores run. The fixtures
|
||||
stop at draw helper `141af0` after real draw arguments are staged, or the next
|
||||
loop checkpoint `13fb10` when drawing is skipped. Nearest-target publication
|
||||
is required in 224 cases. The draw helper itself and full HUD loop are outside
|
||||
this fixture; they are not replaced by test stubs.
|
||||
- Signal fixtures execute complete `1402a0` entries, including disabled/self-point
|
||||
gates, actual relative-position producers, inverse, distance scaling, directional
|
||||
signal trigonometry, height flashing, real color helpers and signal-count stores.
|
||||
Count publication is asserted. Near/far signals, direction-signal variants,
|
||||
zero displacement and high/low relative height are covered. The full 100-signal
|
||||
saturation/reporting path is outside these fixtures.
|
||||
- Particle producers begin at the actual type traversal `1e9700`. They use real
|
||||
view translation/matrix getters and position subtraction, inverse, frustum/type/
|
||||
live-count gates, depth bias and actual insertion sorting. Two visible types
|
||||
must publish indices `[1,0]` and exact depths `[8,4]` (32 producer cases); one-
|
||||
and zero-visible cases are checked too. Getter counts must match transform
|
||||
reach. Execution stops before texture setup `1f91e8`, or synchronization
|
||||
`203c18` when none survive. Earlier FOV setup, texture/draw submission and the
|
||||
optional lens-flare call are outside these bounded fixtures.
|
||||
- Per-site reach assertions distinguish active transforms and gates. CPU outside
|
||||
retired VU, host FP effects, clocks/checkpoints, helper/action counts and final
|
||||
memory agree. Native VU stays untouched through the consumers, retaining the
|
||||
force-field producer effects described above. No RAM masking or VU-state
|
||||
reconstruction is introduced.
|
||||
- Historical inverse ABI coverage grows to 8,576 cases / 134 whole-memory checks;
|
||||
forward remains 5,568 / 348. Existing coverage retains 786,432 hierarchy helper
|
||||
cases / 384 whole-memory, 8,000 geometric edges, 1,024 complete BSP callers /
|
||||
32 whole-memory and 2,048 unknown ABI cases.
|
||||
|
||||
## Replay and window qualification
|
||||
|
||||
Player, headless runner, historical checker and all eleven native test targets
|
||||
build. All eleven native suites and twelve Python tooling tests pass. Existing
|
||||
front/rear AI publication assertions pass in 392 / 352 cases; vehicle/light
|
||||
publication assertions remain enabled too.
|
||||
|
||||
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
|
||||
frames. Every recorded field matches the immediate parent: raw RAM, scratchpad,
|
||||
calls, draws, sound, thread state and EE timing/counts. Sampled 32 MiB RAM images
|
||||
are identical. Strict/default recording files and snapshots are byte exact;
|
||||
strict comparisons report no mismatch.
|
||||
|
||||
One-player reaches four health-stand calls, 5,133 calls to each HUD distance site
|
||||
and 31,216 radar-signal calls. Four-player reaches 6,248 calls to each HUD distance
|
||||
site and 45,576 radar-signal calls. Force-field and particle-draw inverse returns
|
||||
are cold in these replay routes; their behavior is qualified by the generated
|
||||
producer/consumer fixtures above, not claimed as runtime route coverage.
|
||||
|
||||
Fresh isolated window runs complete 6,500 one-player, 6,500 actual four-player
|
||||
and 4,200 movie frames. Reviewed captures show level loading, advancing driving,
|
||||
combat/effects, AI opponents, four simultaneous views, decoded intro images and
|
||||
return to the menu. Each route has five distinct captures.
|
||||
|
||||
Windowed 1P reaches four health-stand, 430 calls to each HUD distance return and
|
||||
13,648 radar-signal calls. 4P reaches 3,296 calls to each HUD distance return and
|
||||
21,588 radar-signal calls. Movies make no new inverse calls. Force-field/particle
|
||||
inverse sites remain cold in these window routes. Stereo 48 kHz, 16-bit WAV
|
||||
captures contain nonzero audio. Device underruns remain: 56.4 ms silence in 1P,
|
||||
31.4 ms in 4P and 23.8 ms in movies. These are functional checks, not a timing or
|
||||
flawless-playback claim. Full campaign, every HUD/particle/force-field state and
|
||||
physical-controller/hardware acceptance remain outside this increment.
|
||||
|
||||
## Remaining scope
|
||||
|
||||
No known static inverse return remains outside the native allowlist. There are
|
||||
still 173 forward returns outside its separate allowlist. Other inline arithmetic,
|
||||
remaining hierarchy/VU helpers and historical/unknown ABI support are separate
|
||||
work; this is not a claim that all emulation has been removed.
|
||||
@@ -0,0 +1,84 @@
|
||||
# Native FireSpecial forward transforms (type a0 lock-on launch points)
|
||||
|
||||
[The FireSpecial types c0/1e0/220 batch](NATIVE_FIRE_TORCH_FORWARD.md) follows with the last frame-output sites.
|
||||
|
||||
Six more `Launcher::FireSpecial` forward returns use native XYZ arithmetic after the
|
||||
[first FireSpecial batch](NATIVE_FIRE_SPECIAL_FORWARD.md). Known forward coverage
|
||||
grows from 243 to 249 of 269 returns (20 remain). Known inverse coverage stays 134 of
|
||||
134; BozoEngine stays at `4a8f70a`.
|
||||
|
||||
Vehicle type `a0` fires at its locked-on target (`+2f4`) in three blocks. Each block
|
||||
bounds a heading (frame `+120`, `+124`, `+128`) and uses its window thresholds
|
||||
(`gp-6408`, `gp-63f0`, `gp-63d8`) to pick one of four table slots, frame `+50` to
|
||||
`+80`. The slot goes through the target's coordinate system into frame `+40`:
|
||||
|
||||
| Return PC | Block | Producer and consumer |
|
||||
| --- | --- | --- |
|
||||
| `14a4d4` | first | Slot `+50`, `+60` or `+70` |
|
||||
| `14a518` | first | Slot `+80` |
|
||||
| `14a73c` | second | Slot `+50`, `+60` or `+70` |
|
||||
| `14a780` | second | Slot `+80` |
|
||||
| `14a98c` | third | Slot `+50`, `+60` or `+70` |
|
||||
| `14a9d0` | third | Slot `+80` |
|
||||
|
||||
`mathfAddVector` then adds the target's position into frame `+40`. The first two
|
||||
blocks emit particles at that point (`particleCreateFx`). The third block hands it
|
||||
to the take-hit info and calls `DispatchHit`.
|
||||
|
||||
The take-hit point pointer is dereferenced only by `mathfManhatDist` and by
|
||||
`forceFieldTakeHit`'s xyz-masked VU subtraction. `DispatchHit` itself gets a
|
||||
different vector. None of these consumers reads W. FireSpecial never loads frame
|
||||
`+4c`, 64 bits at `+48`, or 128 bits from its frame. It reads no VU registers,
|
||||
accumulator or flags. The existing native helper computes separately rounded XYZ,
|
||||
preserves destination W and leaves VU state untouched. Unknown and historical
|
||||
callers keep the original ABI. No engine or gameplay formula changes.
|
||||
|
||||
## Generated comparisons
|
||||
|
||||
Evidence is under `D:/BozoScratch/fire-lockon-forward`, against parent `8cd62cd`
|
||||
(PR #85). Parent headless/window binaries are preserved there and match PR #85's
|
||||
qualified build. Generated bodies, retail data and runtime recordings stay outside
|
||||
Git.
|
||||
|
||||
- Added coverage is 3,072 generated sequences / 192 whole-memory comparisons (caller
|
||||
kinds 348 to 353). They are helper-boundary continuations and entries at the
|
||||
call-return label after each block's heading bound (`14a44c`, `14a6b4`,
|
||||
`14a900`), across four rounding modes, FTZ/DAZ, RAM aliases, identity/quarter-turn
|
||||
bases and arbitrary W payloads.
|
||||
- The real window comparisons select the slot from the heading. Each run stops at
|
||||
`particleCreateFx` (first two blocks) or `DispatchHit` (third block), after
|
||||
frame `+40` has been consumed.
|
||||
- The harness requires each entry to reach exactly its own transform. Every basis is
|
||||
fixture-known, so every site is checked against an independent identity or
|
||||
quarter-turn result. The launch point in frame `+40` is asserted exactly against
|
||||
the original FPU arithmetic. Publications: 512 for each site.
|
||||
- The VU rule from the earlier weapon increments applies. Only forward scratch W at
|
||||
frame `+4c` is normalized for test comparison, after every real consumer.
|
||||
- New caller kinds shift the shared random fill for later rounding modes, so two
|
||||
data-dependent counts in earlier fixtures moved (vehicle tire jumps 711 → 714,
|
||||
real libm errno cases 839 → 835). All scenario-defined counts and assertions are
|
||||
unchanged.
|
||||
- Aggregate caller coverage is 181,248 generated sequences / 9,312 whole-memory
|
||||
comparisons. Historical forward ABI coverage is 15,360 / 960; inverse remains
|
||||
8,576 / 134.
|
||||
|
||||
## Replay and window qualification
|
||||
|
||||
Player, headless runner, historical checker and all eleven native test targets
|
||||
build. All eleven native suites and twelve Python tooling tests pass, with every
|
||||
previous publication assertion enabled.
|
||||
|
||||
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
|
||||
frames. Every recording field matches parent `8cd62cd`, including the RAM hash on
|
||||
every frame: scratchpad, calls, draws, sound, thread state and EE timing/counts.
|
||||
Sampled 32 MiB RAM images are identical. Strict/default recordings and snapshots
|
||||
are byte exact; strict comparisons report no mismatch. The six returns are cold on these routes and are qualified by the generated owner suite above.
|
||||
|
||||
Fresh isolated window runs, started after the headless replays had finished,
|
||||
complete 6,500 one-player, 6,500 actual four-player and 4,200 movie frames.
|
||||
Reviewed captures show the intro and credits, menus, vehicle and level selection,
|
||||
driving with the HUD and four simultaneous views. Each route has five distinct
|
||||
captures. Stereo 48 kHz, 16-bit WAV recordings contain nonzero audio. Audio device
|
||||
underruns: 58.7 ms of silence in one-player, 35.4 ms in four-player and 23.6 ms in
|
||||
the movie run. These are functional checks, not a performance or flawless-playback
|
||||
claim. The type a0 special in actual play, full campaign and physical controller/hardware acceptance remain open.
|
||||
@@ -0,0 +1,93 @@
|
||||
# Native FireSpecial forward transforms (types 20, 40, 60)
|
||||
|
||||
[The FireSpecial type a0 batch](NATIVE_FIRE_LOCKON_FORWARD.md) follows with six lock-on launch points.
|
||||
|
||||
Five `Launcher::FireSpecial` forward returns use native XYZ arithmetic after the
|
||||
[LoopTank batch](NATIVE_LOOPTANK_FORWARD.md). Known forward coverage grows from 238 to
|
||||
243 of 269 returns (26 remain). Known inverse coverage stays 134 of 134; BozoEngine
|
||||
stays at `4a8f70a`.
|
||||
|
||||
`Launcher::FireSpecial` (`149718`) dispatches on the vehicle type at `+20a8`:
|
||||
|
||||
| Return PC | Vehicle type | Producer and consumer |
|
||||
| --- | --- | --- |
|
||||
| `1499d4` | `20` | For each shot, the table offset at `23cfe0` goes through the vehicle's coordinate system into frame `+0`. `mathfAddVector` adds the vehicle position and stores the result in the launcher's `+620`, the weapon's start |
|
||||
| `149bb8` | `40` | Each of eight table points is copied into frame `+0` with zero height. It goes through the aim matrix at frame `+50` in place; its height and its distance from frame `+30` (`mathfDist3`) aim the shot |
|
||||
| `149c28` | `40` | The next table point goes through that matrix into frame `+0`, plus the vehicle position, into `+620` |
|
||||
| `149d8c` | `60` | With a shot armed (`+27c`, `+374`): `23cfa0` goes through the vehicle's system, plus the vehicle position, into `+620` |
|
||||
| `149e14` | `60` | `23cfb0` goes through the matrix rebuilt from the launcher's angles at frame `+50` into frame `+0`, added into `+620` |
|
||||
|
||||
A consumer audit covered every path from each return until the owner returns or the
|
||||
slot is rewritten. It found these consumers:
|
||||
- `mathfAddVector`;
|
||||
- the 32-bit height load (`149bb8`);
|
||||
- `mathfDist3`, which reads `+0/+4/+8` only.
|
||||
|
||||
The weapon constructors, `GetLockOn` and the sound calls do not receive the frame
|
||||
vector. They copy `+620` with `mathfCopyVector`, and launcher `+62c` has no reader.
|
||||
FireSpecial never loads frame `+0c`, never loads 64 bits at frame `+08`, and never
|
||||
loads 128 bits from its frame. It reads no VU registers, accumulator or flags.
|
||||
|
||||
`149bb8` is in place, so the input is read whole before the output is written. The
|
||||
existing native helper computes separately rounded XYZ, preserves destination W and
|
||||
leaves VU state untouched. Unknown and historical callers keep the original ABI. No
|
||||
engine or gameplay formula changes.
|
||||
|
||||
## Generated comparisons
|
||||
|
||||
Evidence is under `D:/BozoScratch/fire-special-forward`, against parent `3c65abe`
|
||||
(PR #84). Parent headless/window binaries are preserved there and match PR #84's
|
||||
qualified build. Generated bodies, retail data and runtime recordings stay outside
|
||||
Git.
|
||||
|
||||
- Added coverage is 2,560 generated sequences / 160 whole-memory comparisons (caller
|
||||
kinds 343 to 347). They are helper-boundary continuations and entries across four
|
||||
rounding modes, FTZ/DAZ, RAM aliases, identity/quarter-turn bases and arbitrary W
|
||||
payloads.
|
||||
- Entries:
|
||||
- `149d8c` runs from the owner's start through the type dispatch and the armed
|
||||
check.
|
||||
- The others start at the call-return label before their transform: `149998`,
|
||||
`149ba0` and `149c14` (all after the type's hardware timer read), and `149e00`.
|
||||
- Each run stops at the first call after its result is consumed: `boundFAngle`,
|
||||
`mathfDist3` or `GetLockOn`. A transform read only by `mathfDist3` is recorded at
|
||||
that call with a zero base.
|
||||
- Every basis is fixture-known, so every site is checked against an independent
|
||||
identity or quarter-turn result. Published values are asserted exactly against the
|
||||
original FPU arithmetic:
|
||||
- the launcher's `+620`;
|
||||
- the point `mathfDist3` receives, and that it receives that address.
|
||||
|
||||
Publications: 512 for each site.
|
||||
- The volley fixture from PR #78 now sets the two registers a trailing comment had
|
||||
hidden. All of its assertions still pass unchanged.
|
||||
- The VU rule from the earlier weapon increments applies. Only forward scratch W at
|
||||
frame `+0c` is normalized for test comparison, after every real consumer.
|
||||
- New caller kinds shift the shared random fill for later rounding modes, so two
|
||||
data-dependent counts in earlier fixtures moved (vehicle tire jumps 705 → 711,
|
||||
real libm errno cases 802 → 839). All scenario-defined counts and assertions are
|
||||
unchanged.
|
||||
- Aggregate caller coverage is 178,176 generated sequences / 9,120 whole-memory
|
||||
comparisons. Historical forward ABI coverage is 14,976 / 936; inverse remains
|
||||
8,576 / 134.
|
||||
|
||||
## Replay and window qualification
|
||||
|
||||
Player, headless runner, historical checker and all eleven native test targets
|
||||
build. All eleven native suites and twelve Python tooling tests pass, with every
|
||||
previous publication assertion enabled.
|
||||
|
||||
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
|
||||
frames. Every recording field matches parent `3c65abe`, including the RAM hash on
|
||||
every frame: scratchpad, calls, draws, sound, thread state and EE timing/counts.
|
||||
Sampled 32 MiB RAM images are identical. Strict/default recordings and snapshots
|
||||
are byte exact; strict comparisons report no mismatch. `149bb8` and `149c28` are live on the one-player route: each runs natively 8 times with no recorded difference. The other three are cold on these routes and are qualified by the generated owner suite above.
|
||||
|
||||
Fresh isolated window runs, started after the headless replays had finished,
|
||||
complete 6,500 one-player, 6,500 actual four-player and 4,200 movie frames.
|
||||
Reviewed captures show the intro and credits, menus, vehicle and level selection,
|
||||
driving with the HUD and four simultaneous views. Each route has five distinct
|
||||
captures. Stereo 48 kHz, 16-bit WAV recordings contain nonzero audio. Audio device
|
||||
underruns: 52.0 ms of silence in one-player, 20.6 ms in four-player and 29.0 ms in
|
||||
the movie run. These are functional checks, not a performance or flawless-playback
|
||||
claim. The first window qualification's one-player run stopped at frame 4,340 on the vehicle-select screen. The main loop was waiting in `switchThread` from `updateMpegMovieDecoding` for 600 fields: the menu's background movie decoder stalled, before any gameplay (FireSpecial cannot run there). Four reruns of the same route (three with this build, one with the parent) and the fresh qualification above completed normally. The stall has not been seen before and is tracked separately; the evidence is in `fault-run/`. The FireSpecial specials in actual play, full campaign and physical controller/hardware acceptance remain open.
|
||||
@@ -0,0 +1,83 @@
|
||||
# Native FireSpecial forward transforms (types c0, 1e0, 220)
|
||||
|
||||
[The UpdateLauncher batch](NATIVE_UPDATE_LAUNCHER_FORWARD.md) follows with its three aim and muzzle points.
|
||||
|
||||
Six more `Launcher::FireSpecial` forward returns use native XYZ arithmetic after the
|
||||
[FireSpecial type a0 batch](NATIVE_FIRE_LOCKON_FORWARD.md). Known forward coverage
|
||||
grows from 249 to 255 of 269 returns (14 remain). Known inverse coverage stays 134 of
|
||||
134; BozoEngine stays at `4a8f70a`. With these, every frame-output forward return in
|
||||
FireSpecial is native. The remaining one, `14aff4`, writes the persistent vehicle
|
||||
velocity and is handled with the other persistent slots.
|
||||
|
||||
| Return PC | Vehicle type | Producer and consumer |
|
||||
| --- | --- | --- |
|
||||
| `14acf0` | `c0` | The offset at `+400` goes through the vehicle's coordinate system into frame `+0`, added to the vehicle position into the launcher's `+620` |
|
||||
| `14b3ec` | `1e0` (Minion) | The nozzle at `+3a0` goes through the matrix rebuilt at frame `+90` into `+620`, plus the vehicle position |
|
||||
| `14b424` | `1e0` | The offset at `+3b0` goes through the matrix at frame `+40` into frame `+0`, added into `+620` |
|
||||
| `14b618` | `220` (Tanker) | `23d1f0` goes through the matrix at frame `+30` into `+620`, plus the vehicle position; then it is aimed at the target (`mathfRotationFromPointToPoint`) |
|
||||
| `14b65c` | `220` | `23d200` goes through frame `+30` into frame `+0`. Its only consumer is the next transform |
|
||||
| `14b670` | `220` | That point goes through the turret node's matrix (`+2a0`, `+10`) in place, then is added into `+620`. `mathfSubVector` measures from `+620` |
|
||||
|
||||
The consumers are `mathfAddVector`, the next transform's input (whose W the
|
||||
transform ignores), `mathfRotationFromPointToPoint` and `mathfSubVector`. They read
|
||||
only XYZ. The weapon constructors copy `+620` with `mathfCopyVector`, and launcher
|
||||
`+62c` has no reader. FireSpecial never loads frame `+0c`, and it reads no VU
|
||||
registers, accumulator or flags.
|
||||
|
||||
`14b670` is in place, so the input is read whole before the output is written. The
|
||||
existing native helper computes separately rounded XYZ, preserves destination W and
|
||||
leaves VU state untouched. Unknown and historical callers keep the original ABI. No
|
||||
engine or gameplay formula changes.
|
||||
|
||||
## Generated comparisons
|
||||
|
||||
Evidence is under `D:/BozoScratch/fire-torch-forward`, against parent `0676443`
|
||||
(PR #86). Parent headless/window binaries are preserved there and match PR #86's
|
||||
qualified build. Generated bodies, retail data and runtime recordings stay outside
|
||||
Git.
|
||||
|
||||
- Added coverage is 3,072 generated sequences / 192 whole-memory comparisons (caller
|
||||
kinds 354 to 359). They are helper-boundary continuations and entries at the
|
||||
call-return label before each transform (`14acdc`, `14b3dc`, `14b414`, `14b604`,
|
||||
`14b648`, `14b65c`), across four rounding modes, FTZ/DAZ, RAM aliases,
|
||||
identity/quarter-turn bases and arbitrary W payloads.
|
||||
- Each run stops at the first call after its result is consumed: `GetLockOn`,
|
||||
`mathfMulMatrix`, `mathfRotMatrixPH`, `mathfRotationFromPointToPoint` or
|
||||
`mathfSubVector`.
|
||||
- A run from `14b648` reaches both Tanker turret transforms. The first output is
|
||||
recorded, with a zero base, when the second transform reads it.
|
||||
- Every basis is fixture-known, so every site is checked against an independent
|
||||
identity or quarter-turn result. The launcher's `+620` is asserted exactly
|
||||
against the original FPU arithmetic. Publications: 512 for each site, and 1,024
|
||||
for `14b670`, which every `14b648` run also reaches.
|
||||
- The VU rule from the earlier weapon increments applies. Only forward scratch W
|
||||
(frame `+0c` or launcher `+62c`) is normalized for test comparison, after every
|
||||
real consumer.
|
||||
- New caller kinds shift the shared random fill for later rounding modes, so two
|
||||
data-dependent counts in earlier fixtures moved (vehicle tire jumps 714 → 708,
|
||||
real libm errno cases 835 → 831). All scenario-defined counts and assertions are
|
||||
unchanged.
|
||||
- Aggregate caller coverage is 184,320 generated sequences / 9,504 whole-memory
|
||||
comparisons. Historical forward ABI coverage is 15,744 / 984; inverse remains
|
||||
8,576 / 134.
|
||||
|
||||
## Replay and window qualification
|
||||
|
||||
Player, headless runner, historical checker and all eleven native test targets
|
||||
build. All eleven native suites and twelve Python tooling tests pass, with every
|
||||
previous publication assertion enabled.
|
||||
|
||||
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
|
||||
frames. Every recording field matches parent `0676443`, including the RAM hash on
|
||||
every frame: scratchpad, calls, draws, sound, thread state and EE timing/counts.
|
||||
Sampled 32 MiB RAM images are identical. Strict/default recordings and snapshots
|
||||
are byte exact; strict comparisons report no mismatch. The six returns are cold on these routes and are qualified by the generated owner suite above.
|
||||
|
||||
Fresh isolated window runs, started after the headless replays had finished,
|
||||
complete 6,500 one-player, 6,500 actual four-player and 4,200 movie frames.
|
||||
Reviewed captures show the intro and credits, menus, vehicle and level selection,
|
||||
driving with the HUD and four simultaneous views. Each route has five distinct
|
||||
captures. Stereo 48 kHz, 16-bit WAV recordings contain nonzero audio. Audio device
|
||||
underruns: 56.7 ms of silence in one-player, 32.4 ms in four-player and 24.8 ms in
|
||||
the movie run. These are functional checks, not a performance or flawless-playback
|
||||
claim. The c0, Minion and Tanker specials in actual play, full campaign and physical controller/hardware acceptance remain open.
|
||||
@@ -0,0 +1,89 @@
|
||||
# Native junk jet and blimp flight forward transforms
|
||||
|
||||
[Gas tank forwards](NATIVE_GASTANK_FORWARD.md) follow with three more environment sites.
|
||||
|
||||
Two waypoint-flyer forward returns use native XYZ arithmetic after the
|
||||
[falling helicopter forwards](NATIVE_HELI_DEATH_FORWARD.md). Known forward coverage
|
||||
grows from 150 to 152 of 269 returns (117 remain). Known inverse coverage stays 134
|
||||
of 134; BozoEngine stays at `4a8f70a`.
|
||||
|
||||
| Return PC | Owner | Producer and consumer |
|
||||
| --- | --- | --- |
|
||||
| `143468` | `JunkJet::UpdateJet` (`143310`) | Speed vector at `+20` through the jet's freshly rebuilt coordinate-system basis, added to its position |
|
||||
| `10eca0` | `Blimp::UpdateBlimp` (`10eae8`) | The same for the blimp |
|
||||
|
||||
Each frame, the flyer steers toward its current waypoint (`atan2f`, bounded and
|
||||
smoothed heading/pitch) and rebuilds its matrix with `mathfRotMatrixRPH`. It
|
||||
smooths its speed and moves by the transformed speed vector. It then measures the
|
||||
Manhattan distance to the waypoint and advances it when close. The jet then
|
||||
updates its engine sound and grid membership, the blimp its grid membership and
|
||||
sound. The result is the owner's frame vector at `+0`, read only by
|
||||
`mathfAddVector`; frame `+10`/`+14` hold angles, and `+0c` is never read. Neither
|
||||
owner reads VU registers, the accumulator or flags. The existing native helper
|
||||
computes separately rounded XYZ, preserves destination W and leaves VU state
|
||||
untouched. Unknown and historical callers keep the original ABI. No engine or
|
||||
gameplay formula changes.
|
||||
|
||||
## Generated comparisons
|
||||
|
||||
Evidence is under `D:/BozoScratch/flyer-forward`, against parent `7e19e2b` (PR #63).
|
||||
Parent headless/window binaries are preserved there and match PR #63's qualified
|
||||
build. Generated bodies, retail data and runtime recordings stay outside Git.
|
||||
|
||||
- Added coverage is 1,024 generated sequences / 64 whole-memory comparisons
|
||||
(caller kinds 255 and 256): helper-boundary continuations and full-owner
|
||||
entries, across four rounding modes, FTZ/DAZ, RAM aliases, identity/quarter-turn
|
||||
bases and arbitrary W payloads.
|
||||
- Full entries run the steering, matrix rebuild, speed smoothing, transform,
|
||||
position update and waypoint check, with both a distant and a nearby waypoint.
|
||||
They stop at the jet's `JetSound::updateJetSound` or the blimp's
|
||||
`hdReparentCsGrid`, and reaching that boundary is asserted. The parked scenario
|
||||
(jet inactive, blimp switched off) returns without a transform. Producer reach is
|
||||
asserted in every case.
|
||||
- Helper-boundary outputs are checked against an independent identity or
|
||||
quarter-turn result. Full entries rebuild the basis from the steering angles
|
||||
first, so those are covered by the native/original comparison. The published
|
||||
position is asserted exactly against the original FPU addition. Each site
|
||||
publishes in 480 cases.
|
||||
- The VU rule from the earlier weapon increments applies. Only forward scratch W
|
||||
at frame `+0c` is normalized for test comparison, after every real consumer.
|
||||
- New caller kinds shift the shared random fill for later rounding modes, so two
|
||||
data-dependent counts in earlier fixtures moved (vehicle tire jumps 709 → 718,
|
||||
real libm errno cases 827 → 847). All scenario-defined counts and assertions are
|
||||
unchanged.
|
||||
- Aggregate caller coverage is 131,584 generated sequences / 6,208 whole-memory
|
||||
comparisons. Historical forward ABI coverage is 9,152 / 572; inverse remains
|
||||
8,576 / 134.
|
||||
|
||||
## Replay and window qualification
|
||||
|
||||
Player, headless runner, historical checker and all eleven native test targets
|
||||
build. All eleven native suites and twelve Python tooling tests pass, with every
|
||||
previous publication assertion enabled.
|
||||
|
||||
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
|
||||
frames. Every recording field matches parent `7e19e2b`: raw RAM, scratchpad,
|
||||
calls, draws, sound, thread state and EE timing/counts. Sampled 32 MiB RAM images
|
||||
are identical. Strict/default recordings and snapshots are byte exact; strict
|
||||
comparisons report no mismatch. The junk jet return `143468` is live: it runs
|
||||
natively 3,902 times on the one-player route with no recorded difference. The
|
||||
blimp return `10eca0` is cold on these routes and is qualified by the generated
|
||||
owner suite above.
|
||||
|
||||
Fresh isolated window runs complete 6,500 one-player, 6,500 actual four-player
|
||||
and 4,200 movie frames. In the qualification one-player window run, the game ran
|
||||
at 15-30 game frames per second from about game frame 3,750 (607 audio underruns,
|
||||
4.9 s of silence). Other desktop programs were using CPU at the time. Two
|
||||
back-to-back reruns of that route under the same conditions separate the build
|
||||
from the machine. The new build averaged 59.7 game frames per second after frame
|
||||
3,700 (11 underruns, 58.9 ms). The parent build, run right after, averaged
|
||||
47.8 (49 underruns, 248.5 ms). The junk jet site ran about 1,706 times in each.
|
||||
The slowdown is therefore machine load, not this change. Reviewed captures show
|
||||
the intro and credits, menus, vehicle and level selection, driving with the HUD
|
||||
and four simultaneous views. Each route has five distinct captures. Stereo
|
||||
48 kHz, 16-bit WAV recordings contain nonzero audio.
|
||||
|
||||
Audio device underruns in the other routes: 30.6 ms silence in four-player and
|
||||
20.9 ms in the movie run. These are functional checks, not a performance or
|
||||
flawless-playback claim. The blimp in actual play, full campaign and physical
|
||||
controller/hardware acceptance remain open.
|
||||
@@ -0,0 +1,100 @@
|
||||
# Native gas tank forward transforms
|
||||
|
||||
[Sinking blimp forwards](NATIVE_BLIMP_DEATH_FORWARD.md) follow with two more environment sites.
|
||||
|
||||
Three gas tank forward returns use native XYZ arithmetic after the
|
||||
[junk jet and blimp flight forwards](NATIVE_FLYER_FORWARD.md). Known forward coverage
|
||||
grows from 152 to 155 of 269 returns (114 remain). Known inverse coverage stays 134
|
||||
of 134; BozoEngine stays at `4a8f70a`.
|
||||
|
||||
| Return PC | Owner | Producer and consumer |
|
||||
| --- | --- | --- |
|
||||
| `135cf8` | `GasTank::UpdateGasTank` (`135c20`) | The rolling tank's velocity at `+30` through its own stored basis at `+40`, added to its coordinate-system position |
|
||||
| `136200` | `GasTank::UpdateFalling` (`135fd8`) | A burst offset `(0,140,0)` through a random-heading matrix, transformed in place and added to the tank's home position |
|
||||
| `1362ec` | `GasTank::UpdateFalling` (`135fd8`) | The same with offset `(0,150,0)` on the second, independent roll |
|
||||
|
||||
`UpdateGasTank` smooths the tank's spin, moves it by the transformed velocity, then
|
||||
accumulates its spin angles and rebuilds its matrix with `mathfRotMatrixRPH`. Below
|
||||
the floor it bounces: the height is clamped, the position is copied to the frame
|
||||
vector, and sparks and a bounce sound follow. Otherwise it measures the Manhattan
|
||||
distance to its home position from the game's table and lands when close (switch,
|
||||
animation, falling sound and debris). The transform result is the frame vector at
|
||||
`+10`. It is read only by `mathfAddVector`, then overwritten by `mathfCopyVector`
|
||||
or `mathfSetFVector` (both XYZ-only) before `particleCreateFx` sees it. Frame `+1c`
|
||||
is never read.
|
||||
|
||||
`UpdateFalling` waits for the fall animation to pass 75%. Then, unless the tank is
|
||||
already down, a 1-in-16 roll throws a burst 140 units up along a random heading
|
||||
(`mathfRotMatrixH`), and a 1-in-9 roll throws one 150 units up. Each offset is
|
||||
transformed in place in the frame vector at `+20`, added to the home position,
|
||||
its height randomized, and handed to `particleCreateFx`. That function reads its
|
||||
point only through `mathfAddVector`, including in `particlePostInitFx` and its
|
||||
recursive child effects. Frame `+2c` is never read; `+20..+28` are always rewritten
|
||||
by `memset`, the per-axis random stores or `mathfSetFVector` before each use.
|
||||
|
||||
Neither owner reads VU registers, the accumulator or flags. The existing native
|
||||
helper computes separately rounded XYZ, preserves destination W and leaves VU state
|
||||
untouched. It reads its input before writing, so the in-place transforms are safe.
|
||||
Unknown and historical callers keep the original ABI. No engine or gameplay formula
|
||||
changes.
|
||||
|
||||
## Generated comparisons
|
||||
|
||||
Evidence is under `D:/BozoScratch/gastank-forward`, against parent `7b71504` (PR #64).
|
||||
Parent headless/window binaries are preserved there and match PR #64's qualified
|
||||
build. Generated bodies, retail data and runtime recordings stay outside Git.
|
||||
|
||||
- Added coverage is 1,536 generated sequences / 96 whole-memory comparisons
|
||||
(caller kinds 257 to 259): helper-boundary continuations and full-owner entries,
|
||||
across four rounding modes, FTZ/DAZ, RAM aliases, identity/quarter-turn bases and
|
||||
arbitrary W payloads.
|
||||
- Rolling-tank entries run the spin smoothing, transform, position update, matrix
|
||||
rebuild and home check. Scenarios cover a free roll (normal return), a bounce
|
||||
(stops at the spark effect; clamped height and bounce factor asserted), a landing
|
||||
near home (stops at `hierSetSwitch`; landed flag asserted) and an inactive tank
|
||||
(no transform).
|
||||
- Falling-tank entries run the real animation query (no animation is loaded, so the
|
||||
percentage is -1), the tank-down gate and the real libc `rand` rolls. The fixture
|
||||
seeds the game's actual `rand` state so each roll takes the intended branch.
|
||||
Entries cover the first burst, the second burst, neither roll (normal return) and
|
||||
a tank already down (no transform). Burst cases stop at `particleCreateFx`.
|
||||
- Helper-boundary outputs, and rolling-tank entries whose basis is fixture-known,
|
||||
are checked against an independent identity or quarter-turn result. Falling
|
||||
entries build a random-heading basis first, so those are covered by the
|
||||
native/original comparison. The published position (rolling) or burst point X/Y
|
||||
(falling) is asserted exactly against the original FPU addition. The rolling site
|
||||
publishes in 480 cases, the bursts in 480 and 448.
|
||||
- The VU rule from the earlier weapon increments applies. Only forward scratch W
|
||||
(frame `+1c` rolling, `+2c` falling) is normalized for test comparison, after
|
||||
every real consumer.
|
||||
- New caller kinds shift the shared random fill for later rounding modes, so two
|
||||
data-dependent counts in earlier fixtures moved (vehicle tire jumps 718 → 709,
|
||||
real libm errno cases 847 → 820). All scenario-defined counts and assertions are
|
||||
unchanged.
|
||||
- Aggregate caller coverage is 133,120 generated sequences / 6,304 whole-memory
|
||||
comparisons. Historical forward ABI coverage is 9,344 / 584; inverse remains
|
||||
8,576 / 134.
|
||||
|
||||
## Replay and window qualification
|
||||
|
||||
Player, headless runner, historical checker and all eleven native test targets
|
||||
build. All eleven native suites and twelve Python tooling tests pass, with every
|
||||
previous publication assertion enabled.
|
||||
|
||||
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
|
||||
frames. Every recording field matches parent `7b71504`: raw RAM, scratchpad,
|
||||
calls, draws, sound, thread state and EE timing/counts. Sampled 32 MiB RAM images
|
||||
are identical. Strict/default recordings and snapshots are byte exact; strict
|
||||
comparisons report no mismatch. None of the three gas tank returns runs on these
|
||||
routes, so they are qualified by
|
||||
the generated owner suite above.
|
||||
|
||||
Fresh isolated window runs, started after the headless replays had finished,
|
||||
complete 6,500 one-player, 6,500 actual four-player and 4,200 movie frames.
|
||||
Reviewed captures show the intro and credits, menus, vehicle and level selection,
|
||||
driving with the HUD and four simultaneous views. Each route has five distinct
|
||||
captures. Stereo 48 kHz, 16-bit WAV recordings contain nonzero audio. Audio device
|
||||
underruns: 73.0 ms of silence in one-player, 30.2 ms in four-player and 25.7 ms in
|
||||
the movie run. These are functional checks, not a performance or flawless-playback
|
||||
claim. Gas tanks in actual play, full campaign and physical controller/hardware
|
||||
acceptance remain open.
|
||||
@@ -0,0 +1,82 @@
|
||||
# Native graphics submission and completion
|
||||
|
||||
The player no longer drives the graphics DMA/register model. This change removes that dependency from execution;
|
||||
the original instructions and BozoEngine's register model remain available to the historical call-log checker.
|
||||
|
||||
## Submission and ownership
|
||||
|
||||
- Mesh, particle, font/HUD and loading-screen hooks copy their draws into the native renderer in the game's order.
|
||||
- `hierCheckVifComplete` submits the current view and reports it reusable immediately. This is completion of the
|
||||
**game-side copy**, not completion of GPU rendering. No GPU fence or `glFinish` is required to release that queue.
|
||||
- `hierFlushObjQ` clears the game's queued-view flags directly. The split-view flush submits its view and clears
|
||||
its pending flags directly. Neither sends a dummy transfer or waits for a fabricated DMA interrupt.
|
||||
- Native VU0 routine selection happens explicitly at the three program-selection sites. No upload or channel state
|
||||
is involved. VU0 calculations themselves retain their existing arithmetic and context.
|
||||
- Movie images are handed to native presentation. Their held-picture flag and decoded-picture count are released
|
||||
directly, including an empty presentation. Field parity comes from the native frame clock.
|
||||
|
||||
## Retired hardware output
|
||||
|
||||
`runtime/tmb_graphics.cpp` lists 109 instruction sites in the USA executable. `bozo:native` exports these
|
||||
sites to `bozo-externals` and `bozo-recomp`. The generated code calls an inline native replacement **before** the
|
||||
original memory operation; handled sites never enter the MMIO dispatcher. This also works in branch delay slots.
|
||||
The native completion tests never read `CPCOND0`. There is no replacement register bank or packet-chain decoder.
|
||||
|
||||
The packet/data builders that feed native hooks can still run; removing their unused construction work is a separate
|
||||
optimization. Native materials accompany the draws, so the player also skips `sceGsPutDrawEnv`'s register mirroring.
|
||||
|
||||
BozoEngine's free host faults if this port reaches a retired GIF/VIF register/FIFO, graphics DMA channel, VU1 memory,
|
||||
GS privileged register, or legacy DMA-condition poll. An uncovered path therefore fails visibly instead of falling
|
||||
back to the model. The checker host leaves native instruction replacements unhandled and executes the originals;
|
||||
existing store patches retain their instruction PC in that path.
|
||||
|
||||
## Deliberately retained
|
||||
|
||||
- Movie **input** synchronization (channel 4 and the FFmpeg decoder's demand) is separate from graphics output.
|
||||
- The game timer, scheduler, native VU0 calculations, guest memory and audio behavior are unchanged in scope.
|
||||
- SDK functions can still build PS2-format structures that the game or native material hooks inspect. These are
|
||||
data compatibility, rather than transfers to a graphics device.
|
||||
|
||||
## Validation
|
||||
|
||||
Local artifacts are under `D:/BozoScratch/native-graphics` and are not committed with game data.
|
||||
|
||||
- The first guarded headless comparison completed 8,500 frames, including boot movies, menus, a level load and
|
||||
2,909 gameplay frame ends. There were no unknown-register accesses or retired-graphics faults.
|
||||
- Batch and vertex counts match the previous runtime on all 8,500 frames. Draw hashes match on 8,450 frames.
|
||||
A diagnostic comparison of the first differing frame (6853) found the same batch order, materials and counts;
|
||||
one transform and one vertex batch differ in small floating-point values. This is **not** a bit-exact draw claim.
|
||||
Sound hashes also differ after gameplay starts; removing simulated completion events changes the scheduling trace.
|
||||
- The original 9,001-frame windowed 1P smoke run completed at about 60 updates/s. Captures show the intro movie,
|
||||
menus, the loaded arena, bots, rain, weapons and explosions. The output WAV contains the native audio stream.
|
||||
Device statistics report 49.7 ms of underrun silence across the 150.7-second run; this is not an audio-perfection claim.
|
||||
|
||||
Final-build checks (BozoEngine `f715d57`):
|
||||
|
||||
- All **5 CTest checks pass**, including all **146 instruction cases**. The six new cases cover inline output,
|
||||
output in a delay slot, native completion and the checker's original-operation fallback. Address-isolation checks
|
||||
keep movie input, the game timer and VU0 data outside the retired-graphics guard.
|
||||
- A fresh 8,500-frame headless run matches the first native run on every draw hash, batch/vertex count, sound hash
|
||||
and EE clock value. No retired-graphics access or unknown register is reported.
|
||||
- A no-input, no-skip movie/menu run completes **4,201 frames** and returns to the main menu. Captures of the intro
|
||||
and main menu were inspected. Clock checks pass: **1.0000x**, **575,962 menu ticks/s**, **59.97 fields/s**;
|
||||
the two measured movie sequences deliver **29.9987 and 29.9948 pictures/s**.
|
||||
- Actual four-player split-screen completes **9,001 frames** on the snow arena. Captures at 5,500 and 8,000 were
|
||||
inspected: four views, vehicles, HUD, pickups, snow and movement. The native audio stream is non-silent stereo
|
||||
48 kHz; device statistics report 27.7 ms of underrun silence across 150.9 seconds.
|
||||
- The historical boot checker reports **MATCH** on all **3,000 state frames**, with the established final-record-only
|
||||
draw exception (2,999/3,000 draw hashes). This validates the retained diagnostic path; it is not the native player's
|
||||
execution of hardware-output instructions.
|
||||
- The historical 1P checker also reports **MATCH** on all **16,000 state frames**, with 15,999/16,000 draw hashes
|
||||
matching (the same final-record exception). Its existing pinned-event allowances remain in force, and sound hashes
|
||||
are reported rather than checked. Both historical checkers and the final native run exit successfully.
|
||||
|
||||
Full campaign/endings and additional physical controllers/hardware remain outside this smoke-test coverage.
|
||||
|
||||
## Main integration
|
||||
|
||||
BozoEngine's graphics change is merged through [engine PR #3](https://github.com/TheBozos/BozoEngine/pull/3),
|
||||
at `5bb4efb`. The combined tree includes the current shared native port services and passes all **8 local CTest
|
||||
checks**, plus Windows/Linux CI. Its 8,500-frame native run reproduces the previously tested native build exactly
|
||||
on RAM, scratchpad, draw hashes/counts, sound hashes and EE clocks. A further **6,501-frame** windowed run passes
|
||||
boot movies, loading and four-player play; inspected captures show the intro and the four snow-arena views.
|
||||
@@ -0,0 +1,47 @@
|
||||
# Native graphics services and readback boundary
|
||||
|
||||
TMB pins BozoEngine main `4a8f70a`, the merge of
|
||||
[engine PR #5](https://github.com/TheBozos/BozoEngine/pull/5), discussed and qualified with DC and VP2S.
|
||||
The engine removes `Libraries::gs`, the privileged register bank and its runtime GIF readers. SDK DMA
|
||||
configuration/completion uses native jobs and callbacks; unknown device accesses and unowned readbacks
|
||||
fail explicitly. This does not claim that every TMB packet-only producer or VU calculation is removed.
|
||||
|
||||
TMB also retires its old `sceGsExecStoreImageOverride` and `patchFlareDepth` adapter. They scanned image
|
||||
packets for BITBLTBUF/TRXPOS/TRXREG even though the default particle path already uses game screen
|
||||
coordinates with `flareDepthBlock` / `Renderer::depthAt`. The retired adapter and its packet logger are
|
||||
gone. Native flare sampling uses the direct renderer interface.
|
||||
|
||||
The old depth-off/original-particle comparison branches are not a native device backend. A request for
|
||||
SDK readback through them now stops with `sceGsExecStoreImage requires a native renderer readback override`.
|
||||
This was checked with `TMB_NATIVE_FLARE_DEPTH=0`; no packet/device shadow or fabricated readback is supplied.
|
||||
Full native coverage of those diagnostic branches is separate work.
|
||||
|
||||
## Independent qualification
|
||||
|
||||
Artifacts are local under `D:/BozoScratch/engine-pr5-baseline`.
|
||||
|
||||
- Unchanged published TMB source `74fd638` was exported into a separate source/build directory and
|
||||
compiled against engine candidate `0c980b29`. Its window, headless and historical-checker tools build.
|
||||
- The 9,500-frame 1P and 8,500-frame 4P routes complete with baseline-exact draw hashes/counts, sound
|
||||
hashes/sample counts, calls, EE clocks, scratchpad and thread records against engine `149bf90`.
|
||||
RAM hashes differ after the retired SDK state/packet writes; whole-RAM equality is not claimed.
|
||||
- Windowed movie/menu playback completes 4,201 frames; 1P and 4P each complete 6,501. Direct captures
|
||||
show decoded movie pictures, textured 1P combat and all four snow-arena views after loading.
|
||||
- The final candidate `94b688d5` has the identical runtime tree. Its compiler includes the separately
|
||||
merged guarded-adaptation and explicit-entry options. With no new options enabled, all 34 TMB
|
||||
generated files are byte-identical to the qualified build. The merged engine tree matches that head.
|
||||
|
||||
## Combined TMB integration
|
||||
|
||||
- Vehicle main `92a7cfb`, the merged engine and the packet-adapter removal build all player/check tools.
|
||||
The three native math/HUD/vehicle suites pass, together with all 13 local engine CTest checks.
|
||||
- Combined 1P (9,500 frames) and 4P (8,500) reproduce every field of the independently qualified engine
|
||||
records, including RAM, draws, sound, calls and clocks. This is separate from the old-engine RAM claim.
|
||||
- Another windowed 6,501-frame movie/menu/loading/4P run completes. Direct captures show all four views
|
||||
with textures, HUD and effects. Its audio log records 31.2 ms of silence; the separate movie/1P/4P
|
||||
windows record 21.5/60.4/29.2 ms. Deterministic sound is exact, without a flawless device-audio or
|
||||
subjective listening claim.
|
||||
|
||||
These are bounded smoke routes, not full campaign or console visual-parity acceptance. The historical
|
||||
checker executable still builds; obsolete readback/device paths are not promised as replay-compatible.
|
||||
TMB does not enable the new compiler `--patches` or `--entries` options in this pin change.
|
||||
@@ -0,0 +1,82 @@
|
||||
# Native falling helicopter forward transforms
|
||||
|
||||
[Junk jet and blimp flight forwards](NATIVE_FLYER_FORWARD.md) follow with two more environment sites.
|
||||
|
||||
The two helicopter death forward returns use native XYZ arithmetic after the
|
||||
[Ferris wheel fall and smasher camera forwards](NATIVE_FERRIS_SMASHER_FORWARD.md).
|
||||
Known forward coverage grows from 148 to 150 of 269 returns (119 remain). Known
|
||||
inverse coverage stays 134 of 134; BozoEngine stays at `4a8f70a`.
|
||||
|
||||
| Return PC | Owner | Producer and consumer |
|
||||
| --- | --- | --- |
|
||||
| `12a180` | `EnvHeli::UpdateDeath` (`12a0f0`) | Smoothed fall velocity through the craft's stored basis at `+40`, added to its coordinate-system position |
|
||||
| `1392e4` | `Helicopter::UpdateDeath` (`139250`) | The same with the basis at `+50`; at death frame 60 it then bursts into debris |
|
||||
|
||||
While the death timer runs (under 120 frames), each owner sinks and rolls the
|
||||
craft (rebuilding the coordinate system's matrix with `mathfRotMatrixRPH`), smooths
|
||||
the fall speed and moves the craft by the transformed velocity. The result is the
|
||||
owner's frame vector at `+0`, read only by `mathfAddVector`. Neither owner touches
|
||||
its frame after that, so `+0c` is never read, and neither reads VU registers, the
|
||||
accumulator or flags. The existing native helper computes separately rounded XYZ,
|
||||
preserves destination W and leaves VU state untouched. Unknown and historical
|
||||
callers keep the original ABI. No engine or gameplay formula changes.
|
||||
|
||||
## Generated comparisons
|
||||
|
||||
Evidence is under `D:/BozoScratch/heli-death-forward`, against parent `9daca2b`
|
||||
(PR #62). Parent headless/window binaries are preserved there and match PR #62's
|
||||
qualified build. Generated bodies, retail data and runtime recordings stay
|
||||
outside Git.
|
||||
|
||||
- Added coverage is 1,024 generated sequences / 64 whole-memory comparisons
|
||||
(caller kinds 253 and 254): helper-boundary continuations and full-owner
|
||||
entries, across four rounding modes, FTZ/DAZ, RAM aliases, identity/quarter-turn
|
||||
bases and arbitrary W payloads.
|
||||
- Full entries run the sink, roll, matrix rebuild, fall-speed smoothing,
|
||||
transform and position update. The timeout scenario (timer reaching 120) takes
|
||||
no transform and stops at the original `BlowDebris` (EnvHeli) or `Regen`
|
||||
(Helicopter). The Helicopter's frame-60 scenario stops at `BlowDebris` after the
|
||||
position update, and reaching it is asserted. `BlowDebris` and `Regen` have their
|
||||
own transforms and effects and are not claimed here. Producer reach is asserted
|
||||
in every case.
|
||||
- Transform outputs are checked against an independent identity or quarter-turn
|
||||
result in every reached case. The published position is asserted exactly
|
||||
against the original FPU addition. Each site publishes in 480 cases.
|
||||
- The VU rule from the earlier weapon increments applies. Only forward scratch W
|
||||
at frame `+0c` is normalized for test comparison, after every real consumer.
|
||||
- New caller kinds shift the shared random fill for later rounding modes, so two
|
||||
data-dependent counts in earlier fixtures moved (vehicle tire jumps 715 → 709,
|
||||
real libm errno cases 830 → 827). All scenario-defined counts and assertions are
|
||||
unchanged.
|
||||
- Aggregate caller coverage is 130,560 generated sequences / 6,144 whole-memory
|
||||
comparisons. Historical forward ABI coverage is 9,024 / 564; inverse remains
|
||||
8,576 / 134.
|
||||
|
||||
## Replay and window qualification
|
||||
|
||||
Player, headless runner, historical checker and all eleven native test targets
|
||||
build. All eleven native suites and twelve Python tooling tests pass, with every
|
||||
previous publication assertion enabled.
|
||||
|
||||
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
|
||||
frames. Every recording field matches parent `9daca2b`: raw RAM, scratchpad,
|
||||
calls, draws, sound, thread state and EE timing/counts. Sampled 32 MiB RAM images
|
||||
are identical. Strict/default recordings and snapshots are byte exact; strict
|
||||
comparisons report no mismatch. Both new sites are cold on these routes, so the
|
||||
generated owner suite above is their qualification. The Cop SUV site `1502cc`
|
||||
still runs natively 1,638 times (one-player) and 845 times (four-player), exact.
|
||||
|
||||
Fresh isolated window runs complete 6,500 one-player, 6,500 actual four-player
|
||||
and 4,200 movie frames. The first four-player window run, made while both headless
|
||||
replays were running, drifted from its frame-scripted pad input and stayed on the
|
||||
opponent-selection menu. That run is kept under `first-four-player` in the evidence
|
||||
folder. A solo rerun of the same route reached the four-way match as usual, with
|
||||
`1502cc` running natively 197 times. Reviewed captures show the intro and credits,
|
||||
menus, vehicle and level selection, driving with the HUD and four simultaneous
|
||||
views. Each route has five distinct captures. Stereo 48 kHz, 16-bit WAV recordings
|
||||
contain nonzero audio.
|
||||
|
||||
Audio device underruns remain: 58.5 ms silence in one-player, 39.4 ms in the
|
||||
four-player rerun and 21.5 ms in the movie run. These are functional checks, not a
|
||||
performance or flawless-playback claim. A helicopter destroyed in actual play, full
|
||||
campaign and physical controller/hardware acceptance remain open.
|
||||
@@ -0,0 +1,104 @@
|
||||
# Native hierarchy collision calculations
|
||||
|
||||
The later [BSP/vehicle inverse increment](NATIVE_BSP_INVERSES.md) extends the eleven-entry allowlist
|
||||
described below to fifteen and records its paired continuation checks and contact-W RAM boundary.
|
||||
The subsequent [sphere/LOD increment](NATIVE_SPHERE_LOD.md) adds five collision-node/point returns,
|
||||
bringing the inverse allowlist to twenty, and qualifies their scalar consumers.
|
||||
The later [helper-consumer increment](NATIVE_HIERARCHY_HELPERS.md) extends it to twenty-four and
|
||||
also retires eight height/BSP/line-of-sight forward returns.
|
||||
The subsequent [query/lighting increment](NATIVE_HIERARCHY_QUERY_RESULTS.md) extends the inverse
|
||||
allowlist to twenty-six and the forward allowlist to twenty-seven.
|
||||
The later [BSP crossing increment](NATIVE_BSP_CROSSINGS.md) brings both allowlists to thirty-three,
|
||||
with actual scalar crossing-point emission and meaningful inverse-W overwrite checks.
|
||||
|
||||
This increment replaces three calculation boundaries in the USA collision/height hierarchy. The player path
|
||||
uses game records directly and leaves VU registers, accumulator, flags and data memory untouched.
|
||||
BozoEngine stays at the previously qualified `4a8f70a`; no engine API or renderer change is included.
|
||||
|
||||
- `hdHatSphereTestAsm` (`1cf7c0`) now calculates the height-test sphere/projection result directly. It retains
|
||||
the game's strict boundary rules, separately rounded arithmetic and scalar large-object shortcut. The
|
||||
shortcut returns without reading any vector pointers. Radius comes from the first record's W; the scalar
|
||||
argument controls the shortcut. The old `0xab0` microprogram is not called on this player path.
|
||||
- Eleven audited `mathfMulVec` (`1da1e8`) call sites in `hdColGrid`, `hdHatTraverse`, `hdTraverse` and animated
|
||||
hierarchy nodes use native inverse direction transforms. Inputs are snapped before writing, including
|
||||
overlapping records. All four output components match: W is copied from the first basis record.
|
||||
- `bspPlaneTest2Vec` (`201660`) uses native plane-distance pairs for `bspVecTestIn` (return `20134c`). The
|
||||
two dot products keep their different X/Y addition orders. Only XY belongs to the distance result; Z/W
|
||||
remain the destination's existing payload. The BSP caller reads only XY and performs its interpolation,
|
||||
recursive branches, classification writes, timing and checkpoints in the existing scalar generated code.
|
||||
|
||||
Other inverse-transform callers and other plane-helper entries retain their original complete ABI. In
|
||||
particular, the unused `bspInterp` helper expects the old register inputs; it is not silently redirected.
|
||||
The historical checker retains the original helpers. `TMB_NATIVE_HIERARCHY_CHECK=1` independently executes
|
||||
original helpers on copied contexts and compares their meaningful outputs; normal player runs do not.
|
||||
|
||||
## Validation
|
||||
|
||||
Local artifacts are under `D:/BozoScratch/hierarchy`, against published TMB `ce7eb9f` / engine `4a8f70a`.
|
||||
|
||||
- `tmb-native-hierarchy-tests`: 786,432 original/native helper cases, 384 complete flat-memory comparisons,
|
||||
8,000 geometric boundary/degenerate cases and 1,024 complete recursive BSP callers pass. Another 32
|
||||
complete-memory comparisons cover the callers, with the documented XY/preserved-ZW record contract.
|
||||
These check saved registers, scalar interpolation, classifications, return and exact cycle/checkpoint
|
||||
counts. Another 2,048 cases check the original ABI of unaudited inverse/plane callers. Native helpers
|
||||
make no microprogram calls, preserve VU state and restore the caller's complete MXCSR.
|
||||
- Four host FP modes, denormal controls, record overlap, RAM aliases, low address bits and scratchpad are
|
||||
covered. Inverse/plane comparisons include arbitrary input bits. Sphere geometry comparisons use finite
|
||||
coordinates/radii, including extreme exponents, signed zero, tangencies and zero-length segments. They
|
||||
do not promise the retired microprogram's incidental IEEE NaN payload/sign propagation.
|
||||
- Existing native matrix/direction, HUD and vehicle suites pass, together with 12 release-tool regressions.
|
||||
- Strict 1P (9,500 frames) and 4P (8,500) complete with 4,977,182 / 1,560,611 original helper comparisons
|
||||
and zero mismatches. The sphere wrappers run 1,064,321 / 105,211 times (896,184 / 68,984 scalar shortcuts);
|
||||
native BSP pairs run 3,853,147 / 1,453,288 times. Six inverse sites are reached by 1P and two by 4P;
|
||||
the other five sites have differential unit coverage, without a live-route coverage claim.
|
||||
- Separate default runs make zero original comparisons and reproduce both strict recordings byte-for-byte.
|
||||
Against main, every frame has identical draw hashes/counts, sound hashes/sample counts, library call hashes/
|
||||
counts, EE clocks, scratchpad and thread records. RAM differs from frame 5591 / 4700; see below. Default
|
||||
runs avoid 168,137 / 36,227 height-test microprogram invocations; this is a call count, not a speedup claim.
|
||||
- Windowed default runs complete 4,201 movie/menu frames and 6,501 frames each for 1P and 4P, through
|
||||
loading into active arenas. Direct captures show decoded movie pictures, menus, textured combat, HUD,
|
||||
effects and four snow-arena views with driving/firing. Audio logs report 15.9 / 34.7 / 29.4 ms of silence
|
||||
and some dropped device frames. Deterministic sound is exact; flawless device audio or subjective
|
||||
listening acceptance is not claimed. These are bounded smoke routes, not full campaign qualification.
|
||||
|
||||
## RAM boundary
|
||||
|
||||
Removing register clobbers deliberately changes raw RAM left by subsequent full-vector stores. A temporary
|
||||
write trace identified `bspPlaneTest2Vec` at its audited caller storing stale VF12 Z/W into recursive stack
|
||||
records. Its scalar caller reads only the two distances. The native helper now preserves those unused
|
||||
destination components, without transferring register state.
|
||||
|
||||
At the 2,000-update gameplay snapshot, the final native build differs from main in 330 words: 329 in the
|
||||
inactive stack range `8fdbe8..8ff358`, plus `23decc`. The latter is a fourth-component padding word copied
|
||||
by `mathfMulMatrix3x3` (`1da428`, return `1ee020`) in `RigidBody::computeAuxiliarys`: the temporary input
|
||||
matrix initializes only its three numerical rows/components. This trace is evidence for that snapshot,
|
||||
not a whole-campaign proof that every raw-RAM difference is harmless. No stale register restoration,
|
||||
padding restoration, shadow VU bank or widened memory-hash mask is added. Temporary tracing is absent
|
||||
from the regenerated production output and the engine checkout remains clean.
|
||||
|
||||
## Remaining work
|
||||
|
||||
The later [traversal/setup increment](NATIVE_HIERARCHY_TRAVERSAL_SETUP.md) extends inverse/forward
|
||||
qualification to database traversal and older collision, terrain and animated-node setup.
|
||||
The [older BSP/root increment](NATIVE_LEGACY_BSP_HELPERS.md) adds setup/result transforms and
|
||||
root/grid/traversal inverse leaves, retaining real query and traversal dispatch.
|
||||
The [point/ray increment](NATIVE_POINT_RAY_HELPERS.md) adds coordinate-system/root inverses and
|
||||
complete point-contact/ray result tails.
|
||||
The [terrain-input increment](NATIVE_TERRAIN_INPUT_HELPERS.md) adds animated-node, terrain-bounds
|
||||
and height/material-query inverse transforms, retaining scalar height and grid calculations.
|
||||
The [terrain-query increment](NATIVE_TERRAIN_QUERY_HELPERS.md) adds LOS/cell/ray inputs and
|
||||
result reconstruction, retaining the scalar query and normalized publication code.
|
||||
The [car/particle increment](NATIVE_CAR_PARTICLE_HELPERS.md) adds the remaining older car-debug
|
||||
and hierarchy particle forward returns, checking actual debug vertex and scalar position consumers.
|
||||
The [final terrain-call increment](NATIVE_TERRAIN_FINAL_HELPERS.md) adds debug line/box,
|
||||
edit and wave inverses. These two transform helpers now have no remaining original direct calls
|
||||
in the audited hierarchy/terrain owner ranges; other helpers and inline VU remain.
|
||||
|
||||
The subsequent [`NATIVE_SCENE.md`](NATIVE_SCENE.md) increment replaces the renderer hierarchy's root/child
|
||||
matrix stack, FOV, distance/LOD and point-light selection together with their producers, accessors and mesh
|
||||
consumers. Other game math helpers and VU macro blocks remain. Neither increment claims complete VU
|
||||
removal or full campaign/console visual parity.
|
||||
|
||||
The later [attractor-group increment](NATIVE_ATTRACTOR_GROUPS.md) adds point-in-group,
|
||||
center and random-position inverse leaves, with complete selection/publication consumers,
|
||||
generated random producers and an audited indirect peel-out W boundary.
|
||||
@@ -0,0 +1,89 @@
|
||||
# Native hierarchy helper consumers
|
||||
|
||||
The later [query/lighting increment](NATIVE_HIERARCHY_QUERY_RESULTS.md) adds twelve further returns,
|
||||
bringing the inverse/forward allowlists to twenty-six / twenty-seven.
|
||||
|
||||
Twelve more hierarchy return sites use the existing native record calculations. The inverse
|
||||
allowlist grows from twenty to twenty-four entries; forward directions grow from nine to seventeen.
|
||||
BozoEngine remains pinned at `4a8f70a`. This change extends the
|
||||
[sphere/LOD increment](NATIVE_SPHERE_LOD.md), without an engine or renderer change.
|
||||
|
||||
| Helper | Return PCs | Owner |
|
||||
|---|---|---|
|
||||
| Inverse `1da1e8` | `1d0de0`, `1d0dfc`, `1d12d8` | Segment collision grid `1d0988` |
|
||||
| Inverse `1da1e8` | `1d4b94` | Control-node BSP segment setup `1d4ab8` |
|
||||
| Forward `1da298` | `1cfd18`, `1cfde8` | Height collision-volume results `1cfb10` |
|
||||
| Forward `1da298` | `1d0224`, `1d0250` | Height BSP results `1d0190` |
|
||||
| Forward `1da298` | `1d25ec`, `1d261c` | Line-of-sight BSP results `1d2560` |
|
||||
| Forward `1da298` | `1d2784`, `1d2804` | Line-of-sight volume results `1d26f0` |
|
||||
|
||||
The player leaves snapshot matrix/input records before writing, retain separately rounded XYZ
|
||||
arithmetic, and leave VU registers, accumulator, flags and data memory untouched. Inverse output
|
||||
matches all four components, including basis[0].W; forward output preserves destination W.
|
||||
The actual scalar dot products, interpolation, result publication, squared-distance calculations,
|
||||
packed metadata, traversal, callbacks, clocks/checkpoints and epilogues remain compiled game code.
|
||||
Historical hosts and unaudited return sites retain the original complete helper ABI. Other helper
|
||||
callers and inline VU operations remain; this is not complete VU removal.
|
||||
|
||||
## Numerical and consumer checks
|
||||
|
||||
Local evidence is under `D:/BozoScratch/hierarchy-helpers`, against main `4b36de2` (PR #25).
|
||||
Generated game code, disc data, captures, recordings and RAM dumps are excluded from the commit.
|
||||
|
||||
- `tmb-native-hierarchy-tests` adds 6,144 real generated consumer sequences and 192 complete-memory
|
||||
comparisons across all twelve returns. They cover four host FP modes, denormal controls, RAM
|
||||
aliases and arbitrary forward-output W payloads. CPU state outside retired VU, complete outgoing
|
||||
host FP effects, clocks/checkpoints and other memory must match; native VU state must be untouched.
|
||||
- The original forward helpers run with their actual W values and VU effects through every real
|
||||
consumer in a sequence. Only the final unused forward-output W fields are normalized afterward.
|
||||
W-dependent scalar results, register effects or other copied memory would therefore fail the
|
||||
comparison. Inverse outputs are compared without a component mask.
|
||||
- Grid sequences stop before the following matrix helper or hierarchy push; the control sequence
|
||||
stops at the BSP query dispatch. Height normal publication runs through its following dot product
|
||||
to the double-conversion boundary; its offset tail runs through scalar addition and return.
|
||||
Both BSP result tails and the line-of-sight volume tail exercise their actual scalar publication,
|
||||
distance/metadata branches and return. These tests start at helper calls, not at complete query roots.
|
||||
- The hierarchy suite also retains 786,432 helper comparisons, 384 complete-memory checks, 8,000
|
||||
geometric edges, 1,024 recursive BSP callers (32 complete-memory checks), 2,048 unknown-caller ABI
|
||||
cases, and now 1,536 historical inverse cases across all twenty-four returns (24 complete-memory
|
||||
checks). Another 512 historical forward cases/32 complete-memory checks cover the eight new returns.
|
||||
- The math suite retains 1,048,576 helper comparisons, 512 complete-memory checks and 2,048
|
||||
unknown-caller ABI cases, with overlap, address alignment, aliases and scratchpad coverage.
|
||||
- Player, headless and historical checker builds, all eleven native suites and twelve Python tooling
|
||||
tests pass. After temporary diagnostics, restored sources were forced to rebuild; the native math
|
||||
object matches its original qualified hash and the three executables contain no observer marker.
|
||||
|
||||
## Gameplay, loading and movies
|
||||
|
||||
Default and strict routes complete 9,500 one-player and 8,500 actual four-player frames. Every
|
||||
non-RAM frame-record field matches the baseline throughout: scratchpad, calls/counts, draws/counts,
|
||||
sound/sample counts, thread state and EE clock. Strict contact, hierarchy, math and projection
|
||||
comparisons pass; strict/default recording and snapshot files are identical. Defaults make zero
|
||||
original comparisons and zero VU0 microprogram calls.
|
||||
After diagnostic removal, another clean default replay of both full routes reproduces the qualified
|
||||
recording and snapshot files byte-for-byte; all eleven native suites also pass on the restored build.
|
||||
|
||||
The four new inverse returns retire another 185,191 / 65,299 original helper executions in
|
||||
one-player / four-player. The control node accounts for 182,727 / 55,901; the first two grid returns
|
||||
each account for 1,232 / 4,699. The third grid return `1d12d8` has generated-consumer/unit coverage
|
||||
but is absent from these live routes. All eight new forward returns run in one-player, totaling
|
||||
24,308 executions; four-player totals 692. Thus this batch retires another 209,499 / 65,991 original
|
||||
helper executions. These counts are not timing or FPS measurements.
|
||||
|
||||
RAM hashes differ on 3,447 one-player frames (first 5591, last 9499) and 3,741 four-player frames
|
||||
(4759 through 8499). Complete 32 MB snapshots at one-player frame 7000 and four-player frame 6000
|
||||
each differ by two bytes in one stack word: `8ff21c` changes from 60.0 to zero; `8ff16c` from 89.0
|
||||
to zero, respectively. Paired baseline/native observers directly trace both to forward return
|
||||
`1d0250`, the height BSP temporary at SP+`10` with unused W at SP+`1c`. The original helper stores
|
||||
inherited VF16.W; native XYZ publication preserves the existing zero. Diagnostic snapshots match
|
||||
their corresponding qualified snapshots exactly. The scalar addition following this helper reads
|
||||
only XYZ; generated consumer tails retain the complete CPU/FP/memory checks described above.
|
||||
This is bounded snapshot/consumer evidence, not proof that every RAM difference or campaign path
|
||||
has been exercised. No hash mask, padding restoration, shadow VU state or observer is shipped.
|
||||
|
||||
Fresh window runs complete 4,201 game frames for movies/menus and 6,502 each for one-player and
|
||||
actual four-player (4,200 / 6,501 / 6,501 counted after the first presented picture). Reviewed captures
|
||||
show decoded movie pictures, Junkyard loading and rainy combat, and four advancing snow-arena views.
|
||||
Device logs report 21.6 / 49.9 / 40.3 ms of silence (movie / one-player / four-player), with underruns
|
||||
and dropped audio frames. Deterministic sound records match. Full campaign acceptance, flawless
|
||||
device audio and console visual parity remain unclaimed.
|
||||
@@ -0,0 +1,97 @@
|
||||
# Native hierarchy query and lighting transforms
|
||||
|
||||
The subsequent [BSP crossing increment](NATIVE_BSP_CROSSINGS.md) adds thirteen further returns,
|
||||
bringing both inverse and forward allowlists to thirty-three.
|
||||
|
||||
Twelve further hierarchy returns use the existing native record implementations: ten forward
|
||||
directions and two inverse directions. The audited allowlists now contain twenty-seven forward
|
||||
and twenty-six inverse returns. This extends [the grid/result increment](NATIVE_HIERARCHY_HELPERS.md).
|
||||
BozoEngine remains pinned at `4a8f70a`; no shared engine or renderer change is included.
|
||||
|
||||
| Helper | Return PCs | Owner |
|
||||
|---|---|---|
|
||||
| Inverse `1da1e8` | `1cd400` | Animated collision transform `1cd180` |
|
||||
| Inverse `1da1e8` | `1cd768` | BSP auxiliary segment setup `1cd538` |
|
||||
| Forward `1da298` | `1cbbc8`, `1cbc2c` | Point-contact result `hdPunt`, `1cba48` |
|
||||
| Forward `1da298` | `1cc634`, `1cc6b4` | Line-contact result `1cc588` |
|
||||
| Forward `1da298` | `1ccec8`, `1ccef8` | Terrain point check `1cce58` |
|
||||
| Forward `1da298` | `1cd884`, `1cd8b4` | BSP auxiliary result publication `1cd538` |
|
||||
| Forward `1da298` | `1d41c8` | Burning attachment point `1d4188` |
|
||||
| Forward `1da298` | `1d9cac` | Light-volume colour coordinates `1d9c30` |
|
||||
|
||||
The leaves snapshot operands before overlapping writes and preserve the existing separately rounded
|
||||
arithmetic. Inverse XYZW matches the original, including basis[0].W; forward XYZ matches while
|
||||
destination W is preserved. The player path leaves VU registers, accumulator, flags and data memory
|
||||
untouched. Scalar interpolation, normalization, result packing, matrix allocation/index bookkeeping,
|
||||
colour sampling/interpolation, view lookup, clocks/checkpoints and callbacks remain compiled game
|
||||
code. Historical hosts and unaudited callers retain their original full ABI. Other helper returns
|
||||
and inline VU operations remain; this is not complete VU removal.
|
||||
|
||||
## Numerical and consumer checks
|
||||
|
||||
Local evidence is under `D:/BozoScratch/hierarchy-query-results`, against main `9a8e698` (PR #26).
|
||||
Generated game code, disc data, captures, recordings and RAM dumps are excluded from the commit.
|
||||
|
||||
- The hierarchy consumer harness grows from 6,144 to 12,288 generated sequences, with 384
|
||||
complete-memory comparisons (6,144 / 192 added). Four host FP modes, denormal controls, RAM
|
||||
aliases and arbitrary output W payloads are covered. The reference runs the real original
|
||||
forward helpers and leaves their W/VU effects alive throughout each consumer sequence. Only
|
||||
final unused forward-output W fields are normalized afterward. CPU outside retired VU, complete
|
||||
outgoing host FP effects, clocks/checkpoints and other memory must match; native VU is untouched.
|
||||
Inverse XYZW is compared without a component mask.
|
||||
- Point and line tails run through scalar reconstruction, squared distance where applicable, packed
|
||||
material/result fields and return. Terrain tails stop at result-buffer clearing after their actual
|
||||
zero/copy, normalization and unit-box branches; exact and adjacent axis limits are included.
|
||||
- The animated-node tail exercises matrix-capacity values 0, 1199 and 1200, the retained scalar matrix
|
||||
product and model-mode index publication through return. BSP inverse setup stops at its segment
|
||||
query dispatch; auxiliary result publication stops at the next point-loop boundary after metadata
|
||||
writes. These are helper-consumer sequences, not complete query-root/callback coverage.
|
||||
- The burning-attachment sequence runs view lookup and XYZ addition to the burning-point callback
|
||||
dispatch. The light-volume sequence runs the full remaining colour tail, including wrapping,
|
||||
disabled sampling, four-texel interpolation, double-precision scalar helpers and RGBA packing.
|
||||
Half-texel neighbouring representations and independent colour payloads are included. This does
|
||||
not claim a new particle producer or a replacement for the complete light-volume owner.
|
||||
- Historical forward checks grow to 1,152 cases / 72 complete-memory comparisons (640 / 40 added).
|
||||
The hierarchy suite retains 786,432 helper comparisons, 384 complete-memory checks, 8,000 geometric
|
||||
edges, 1,024 recursive BSP callers / 32 complete-memory checks and 2,048 unknown-caller ABI cases.
|
||||
Historical inverse checks now cover all twenty-six returns: 1,664 cases / 26 complete-memory checks.
|
||||
- The math suite retains 1,048,576 helper comparisons, 512 complete-memory checks and 2,048
|
||||
unknown-caller ABI cases, including overlap, alignment, aliases and scratchpad coverage.
|
||||
- Player, headless and historical checker builds, all eleven native suites and twelve Python tooling
|
||||
tests pass. After temporary diagnostics, restored sources are forced to rebuild; the math object
|
||||
matches its original qualified hash, all three executables lack observer markers and all eleven
|
||||
suites pass again on the restored build.
|
||||
|
||||
## Gameplay, loading and movies
|
||||
|
||||
Default and strict routes complete 9,500 one-player and 8,500 actual four-player frames. Every
|
||||
non-RAM frame-record field matches the baseline throughout: scratchpad, calls/counts, draws/counts,
|
||||
sound/sample counts, thread state and EE clock. Strict contact, hierarchy, math and projection
|
||||
comparisons pass; strict/default recordings and snapshots are identical. Defaults perform zero
|
||||
original comparisons and zero VU0 microprogram calls.
|
||||
After diagnostic removal, clean default replays of both full routes reproduce the qualified
|
||||
recording and snapshot files byte-for-byte.
|
||||
|
||||
The new forward returns retire 59,521 / 21,822 original helper executions in one-player / four-player;
|
||||
all ten run in one-player. The two new inverse returns execute 15,991 and 7 times in one-player,
|
||||
and are absent from the four-player route, with differential consumer/unit coverage retained.
|
||||
The batch therefore retires another 75,519 / 21,822 original helper executions. These are counts,
|
||||
not timing or FPS measurements.
|
||||
|
||||
RAM hashes differ on 3,421 one-player frames (first 5594, last 9499) and 2,713 four-player frames
|
||||
(first 4703, last 8499). Complete 32 MB snapshots at one-player frame 7000 and four-player frame
|
||||
6000 each differ by one byte in a stack W word: `8fedcc` is zero versus native bits `000000d6`;
|
||||
`8fef6c` is zero versus native bits `00000007`, respectively. Paired observers directly identify
|
||||
line-result return `1cc6b4`, whose output is SP+`20` and unused W is SP+`2c`. At identical EE clocks,
|
||||
the original overwrites the existing integer payload with inherited VF16.W zero; native preserves
|
||||
it. Diagnostic snapshots exactly reproduce their corresponding baseline/native snapshots.
|
||||
The following scalar consumers use XYZ, with complete tail checks above. This is bounded snapshot
|
||||
evidence, not a classification of every raw-RAM difference or campaign consumer. No new hash mask,
|
||||
padding restoration, shadow VU state or observer is shipped.
|
||||
|
||||
Fresh window runs complete 4,201 game frames for movies/menus and 6,501 each for one-player and
|
||||
actual four-player. Reviewed captures show decoded movie pictures, Junkyard loading and rainy
|
||||
combat, and four advancing snow-arena views. Device logs report 25.2 / 64.5 / 27.8 ms of silence
|
||||
(movie / one-player / four-player), with underruns and dropped audio frames. Deterministic sound
|
||||
records match. Full campaign acceptance, flawless device audio and console visual parity remain
|
||||
unclaimed.
|
||||
@@ -0,0 +1,93 @@
|
||||
# Native traversal and older collision setup transforms
|
||||
|
||||
Thirteen more hierarchy returns use the existing native record calculations: nine inverse and
|
||||
four forward sites bring the allowlists to forty-two and thirty-seven entries respectively.
|
||||
This extends the [BSP crossing increment](NATIVE_BSP_CROSSINGS.md). BozoEngine remains pinned at
|
||||
`4a8f70a`; no engine or renderer change is included.
|
||||
|
||||
| Helper | Return PCs | Owner |
|
||||
|---|---|---|
|
||||
| Inverse `1da1e8` | `1c0684`, `1c0884`, `1c0a70` | Database traversal `1c0300` |
|
||||
| Inverse `1da1e8` | `1c5d0c` | Older collision grid `1c5470` |
|
||||
| Inverse `1da1e8` | `1c639c` | Older hierarchy traversal `1c60e8` |
|
||||
| Inverse `1da1e8` | `1c6bf4`, `1c6c94`, `1c6f04` | Older collision node `1c6ad0` |
|
||||
| Inverse `1da1e8` | `1c7620` | Older animated node `1c73a0` |
|
||||
| Forward `1da298` | `1c6bac`, `1c6c54` | Older collision node `1c6ad0` |
|
||||
| Forward `1da298` | `1c7134`, `1c7160` | Older terrain setup `1c70c0` |
|
||||
|
||||
Native leaves snapshot inputs before overlapping writes, calculate separately rounded XYZ and
|
||||
leave VU registers, accumulator, flags and data memory untouched. Inverse XYZW is exact, including
|
||||
meaningful basis[0].W; forward XYZ is exact while existing destination W is preserved. Unknown
|
||||
callers and historical hosts retain the full original helper ABI. Scalar matrix products,
|
||||
normalization, callbacks, query dispatch, clocks and checkpoints remain compiled game code.
|
||||
Other helper returns and inline VU operations remain; this is not complete VU removal.
|
||||
|
||||
## Generated consumers and numerical checks
|
||||
|
||||
Local evidence is under `D:/BozoScratch/hierarchy-traversal-setup`, against main `a29c09f` (PR #28).
|
||||
Generated game code, disc data, captures, recordings and RAM dumps are excluded from the commit.
|
||||
|
||||
- The consumer harness grows from 18,944 to 25,600 sequences and from 592 to 800 whole-memory
|
||||
comparisons (6,656 / 208 added). Four host FP modes, denormal controls, RAM aliases and arbitrary
|
||||
W payloads are covered. CPU outside retired VU, outgoing host FP effects, clocks/checkpoints and
|
||||
other memory match; native VU remains untouched.
|
||||
- Database continuations run actual matrix copying/products into the indirect callback boundary,
|
||||
or scalar vector addition into the modeled-effect creation boundary. Tests stop before callback
|
||||
or particle dispatch; they do not claim complete traversal or modeled-particle producer coverage.
|
||||
- Grid/traversal tails retain capacity-counter updates at 0 and 1199 and compare the next scalar
|
||||
matrix-product arguments. Animated-node tails run that product, index publication and return,
|
||||
including capacity 0, 1199 and 1200. General child traversal is outside these fixtures.
|
||||
- Collision-node sequences run world/local additions, paired transforms, point-mode selection,
|
||||
zero/copy/normalization and unit-box decisions through the first plane-dot dispatch. Exact and
|
||||
adjacent unit-axis values are included. Terrain sequences run both world-point sums through
|
||||
the next zeroing-call boundary. Complete collision/terrain queries are outside these fixtures.
|
||||
- Reference forward W and VU effects stay live throughout real consumers. Only final unused
|
||||
forward-output W fields are normalized afterward; any later inverse overwrite retires that
|
||||
exclusion so meaningful inverse W remains compared exactly.
|
||||
- Historical forward checks grow to 1,792 cases / 112 whole-memory comparisons (256 / 16 added).
|
||||
Historical inverse checks cover all forty-two returns: 2,688 cases / 42 whole-memory comparisons.
|
||||
The hierarchy suite retains 786,432 helper cases, 384 whole-memory checks, 8,000 geometric edges,
|
||||
1,024 recursive BSP callers / 32 whole-memory checks and 2,048 unknown-caller ABI cases.
|
||||
- The math suite retains 1,048,576 helper cases, 512 whole-memory checks and 2,048 unknown-caller
|
||||
ABI cases, including overlap, alignment, aliases and scratchpad coverage.
|
||||
- Player, headless and historical checker builds, all eleven native suites and twelve Python
|
||||
tooling tests pass.
|
||||
|
||||
## Gameplay, loading and movies
|
||||
|
||||
Default and strict routes complete 9,500 one-player and 8,500 actual four-player frames. Strict
|
||||
contact, hierarchy, math and projection checks pass; strict/default recordings and snapshots are
|
||||
byte-identical. Every non-RAM frame-record field matches baseline throughout: scratchpad,
|
||||
calls/counts, draws/counts, sound/sample counts, thread state and EE clock. The entire four-player
|
||||
recording is also baseline-byte-identical, including RAM. Default runs perform zero original
|
||||
comparisons and zero VU0 microprogram calls.
|
||||
|
||||
All thirteen added sites execute in one-player: 20,086 inverse and 11,521 forward calls. Four-player
|
||||
reaches the first two database traversal inverses, 820 calls combined; the other sites have
|
||||
generated-consumer and historical-ABI coverage. This retires another 31,607 / 820 original helper
|
||||
executions in one-player / four-player. These are counts, not timing or FPS measurements.
|
||||
|
||||
One-player RAM hashes differ on 2,058 frames, first at 7003 and last at 9499. The complete 32 MB
|
||||
snapshot at frame 7000 is baseline-identical, as is four-player at frame 6000. A paired late
|
||||
snapshot at frame 9499 differs by ten bytes in four W words: `23deac`, `23defc`, `23e38c`, `23e3dc`.
|
||||
Temporary write observers identify scalar `mathfMulMatrix3x3` (`1da428`, return `1ee020`) copying
|
||||
SP+`0c` (`8ff0cc`) into the first W of the two matrices, then original inverse calls (`1ee030`
|
||||
and `1ed6c4`) copying basis[0].W into their result W. The matrix owner
|
||||
`RigidBody::computeAuxiliarys` initializes only three components in each temporary row; the
|
||||
scalar product copies the untouched W independently of its numerical 3x3 calculation. Baseline
|
||||
words are `42700000` / `c4f00000`; native words are `02000200` / zero. These are inherited
|
||||
temporary-padding differences, not changed XYZ products. The original inverses preserve their
|
||||
full ABI and copy those W values exactly. This is a bounded source/snapshot/write-chain audit,
|
||||
not a classification of every RAM difference or possible campaign consumer.
|
||||
|
||||
Paired observer recordings and snapshots reproduce both late qualified runs exactly. Observers
|
||||
were removed, restored sources forced to rebuild, the generated object matches its original
|
||||
hash, and all three executables contain no observer markers. No padding restoration, hash mask
|
||||
or shadow VU state is shipped. All eleven native suites pass again, and clean default replays
|
||||
reproduce both complete qualified recordings and snapshots byte-for-byte.
|
||||
|
||||
Fresh window routes complete 4,201 movie/menu frames and 6,501 each for one-player and actual
|
||||
four-player. Reviewed captures show decoded movie pictures, Junkyard loading and active rainy
|
||||
combat, and four advancing snow-arena views. Device logs report 19.2 / 52.0 / 28.4 ms of silence
|
||||
(movie / one-player / four-player), with underruns and dropped frames. Deterministic sound records
|
||||
match; flawless device audio, full campaign acceptance and console visual parity remain unclaimed.
|
||||
@@ -0,0 +1,69 @@
|
||||
# Native HUD point and direction transforms
|
||||
|
||||
`updateHUDPosition` now computes its six inline transforms directly over game records. The three point
|
||||
blocks apply a basis to XYZ and add the current translation; the three direction blocks apply only the
|
||||
basis. Each block snapshots its inputs at its existing final store, after earlier writes, then writes XYZ.
|
||||
The destination's fourth component remains unchanged. It is an opaque payload here, rather than an
|
||||
output from an unrelated VU register. The point-projection and vector-add consumers use XYZ.
|
||||
|
||||
| Original block | Final store | Calculation |
|
||||
| --- | --- | --- |
|
||||
| `13ce74..13ce98` | `13ce98` | Position plus translation |
|
||||
| `13ceb4..13ced8` | `13ced8` | Projected HUD point plus translation |
|
||||
| `13d03c..13d060` | `13d060` | Second HUD position plus translation |
|
||||
| `13d210..13d22c` | `13d22c` | Targeting direction |
|
||||
| `13d308..13d324` | `13d324` | Targeting direction |
|
||||
| `13d408..13d424` | `13d424` | Warning direction |
|
||||
|
||||
The 54 original load/arithmetic/store instructions are lowered through the existing native instruction
|
||||
dispatcher. The player path neither loads VU registers nor transports accumulator/flag state. Ordinary
|
||||
CPU branches, calls and checkpoints retain their existing positions. The number-format and separately
|
||||
rounded SIMD arithmetic follow [`NATIVE_MATH.md`](NATIVE_MATH.md).
|
||||
|
||||
## Independent original comparisons
|
||||
|
||||
`tools/tmb_hud_fixture.py` extracts the exact fallback instruction bodies from fresh BozoEngine output
|
||||
in the build tree. It rejects missing, duplicate or non-straight-line memory/vector instructions.
|
||||
No generated code or game data is committed. The historical host retains its original instruction path.
|
||||
|
||||
`TMB_NATIVE_HUD_CHECK=1` runs the extracted original block on a copied context and temporarily saved
|
||||
output, compares XYZ, then restores the output before the native write. W is deliberately outside the
|
||||
numeric comparison: the original store copies a stale register lane, whereas the native store preserves
|
||||
the destination payload. Default execution never invokes the original block or reads VU state.
|
||||
|
||||
Build and run `tmb-native-hud-tests` for the original-block/production-dispatcher comparisons:
|
||||
|
||||
- 196,608 cases across all six blocks and four host FP modes compare every arena byte against the
|
||||
original calculation with the documented W-preservation contract. Inputs include arbitrary bits,
|
||||
finite game values, extreme exponents, denormals, scratchpad, address aliases, low address bits and
|
||||
partial/identical overlaps. Every CPU/VU context byte and the host MXCSR remain unchanged.
|
||||
- 192 cases compare the complete flat guest memory. Before the final store, the original load/arithmetic
|
||||
sites leave memory unchanged on the native path.
|
||||
- 1,024 two-block overlap cases require the second calculation to read the first block's updated input
|
||||
or basis. A function-entry snapshot would fail these cases.
|
||||
- The existing 524,288 camera-matrix cases and 12 release-tool regressions still pass.
|
||||
|
||||
## Gameplay validation and limits
|
||||
|
||||
Local artifacts are under `D:/BozoScratch/native-hud`.
|
||||
|
||||
- The 9,500-frame 1P route checks each affine block 3,904 times, without an XYZ mismatch.
|
||||
- The 8,500-frame 4P route checks each affine block 22,782 times, without an XYZ mismatch.
|
||||
- Against the prior native-matrix main build, every comparable 1P and 4P draw hash, batch/vertex count,
|
||||
sound hash/sample count, call, EE cycle, scratchpad and thread record matches.
|
||||
- The three direction blocks pass the generated-original tests above but were not reached by these
|
||||
ordinary gameplay scripts. Targeting-warning gameplay coverage and full campaign acceptance remain
|
||||
open. This is not a whole-function native claim: other HUD callees still contain compatibility math.
|
||||
|
||||
Separate default runs reproduce all strict 1P/4P frame records exactly, without invoking original HUD
|
||||
blocks. RAM hashes differ because the native stores preserve destination W. At point 8500 the complete
|
||||
1P RAM dump differs at two words (`4a1ebc`, `4a1f5c`); the 4P dump differs at five (`4a187c`, `4a191c`,
|
||||
`4a19bc`, `4a1a5c`, `4a1c3c`). All are position.W in coordinate records reached through the two HUD
|
||||
pointer arrays at `23c548` and `23c558`; the native value is the preserved zero in each. No other RAM
|
||||
word differs at those snapshots, and no VU shadow restoration is used.
|
||||
|
||||
Windowed default runs complete 4,201 movie/menu frames and 9,001 frames each for 1P and 4P. Captures
|
||||
directly show the opening movie and active gameplay after loading, including all split-screen views.
|
||||
The window audio logs report 13.6/50.0/6.5 ms of silence respectively; deterministic sound records are
|
||||
exact, but this is not a flawless device-audio or subjective listening claim. These are bounded smoke
|
||||
checks, not full campaign or console visual-parity acceptance. Windows/Linux CI passes.
|
||||
@@ -0,0 +1,72 @@
|
||||
# Native HUD laser forward transforms
|
||||
|
||||
[The BlowDebris batch](NATIVE_BLOW_DEBRIS_FORWARD.md) follows with the debris pieces' six sites.
|
||||
|
||||
The two `Hud::BuildLaserStuff` forward returns use native XYZ arithmetic after the
|
||||
[UpdateLauncher batch](NATIVE_UPDATE_LAUNCHER_FORWARD.md). Known forward coverage
|
||||
grows from 258 to 260 of 269 returns (9 remain). Known inverse coverage stays 134 of
|
||||
134; BozoEngine stays at `4a8f70a`. The nine that remain write persistent object
|
||||
fields and are handled together.
|
||||
|
||||
`Hud::BuildLaserStuff` (`1425b8`) draws the laser sight of the HUD's vehicle (`+5e0`)
|
||||
when the vehicle carries a laser (`+2438`):
|
||||
|
||||
| Return PC | Producer and consumer |
|
||||
| --- | --- |
|
||||
| `142640` | The table offset `4e6ef0` (copied to frame `+70`) goes through the vehicle's coordinate system into frame `+10`. `mathfAddVector` adds the vehicle position into frame `+90` |
|
||||
| `1426cc` | `4e6f00` (frame `+80`) goes through the aim matrix rebuilt at frame `+30` into frame `+10`. It is added into frame `+90`, which `mathfTransform3dTo2d` projects |
|
||||
|
||||
`mathfAddVector` reads its operands as XYZ and writes XYZ, so the forward W is not
|
||||
carried into frame `+9c`. The projection's input is frame `+90`, not the transform
|
||||
output. The owner never loads frame `+1c`, and it reads no VU registers, accumulator
|
||||
or flags. The existing native helper computes separately rounded XYZ, preserves
|
||||
destination W and leaves VU state untouched. Unknown and historical callers keep the
|
||||
original ABI. No engine or gameplay formula changes.
|
||||
|
||||
## Generated comparisons
|
||||
|
||||
Evidence is under `D:/BozoScratch/hud-laser-forward`, against parent `0fb62aa`
|
||||
(PR #89). Parent headless/window binaries are preserved there and match PR #89's
|
||||
qualified build. Generated bodies, retail data and runtime recordings stay outside
|
||||
Git.
|
||||
|
||||
- Added coverage is 1,024 generated sequences / 64 whole-memory comparisons (caller
|
||||
kinds 363 and 364): helper-boundary continuations and entries, across four rounding
|
||||
modes, FTZ/DAZ, RAM aliases, identity/quarter-turn bases and arbitrary W payloads.
|
||||
- `142640` runs from the owner's start: the current view, the table copies and the
|
||||
laser check. It stops at the following `boundFAngle`. `1426cc` starts at the
|
||||
call-return label after the aim matrix rebuild (`1426bc`) and stops at
|
||||
`mathfTransform3dTo2d`.
|
||||
- Every basis is fixture-known, so both sites are checked against an independent
|
||||
identity or quarter-turn result. Frame `+90` is asserted exactly against the
|
||||
original FPU arithmetic. Publications: 512 for each site.
|
||||
- The VU rule from the earlier weapon increments applies. Only forward scratch W at
|
||||
frame `+1c` is normalized for test comparison, after every real consumer.
|
||||
- New caller kinds shift the shared random fill for later rounding modes, so two
|
||||
data-dependent counts in earlier fixtures moved (vehicle tire jumps 711 → 707,
|
||||
real libm errno cases 810 → 859). All scenario-defined counts and assertions are
|
||||
unchanged.
|
||||
- Aggregate caller coverage is 186,880 generated sequences / 9,664 whole-memory
|
||||
comparisons. Historical forward ABI coverage is 16,064 / 1,004; inverse remains
|
||||
8,576 / 134.
|
||||
|
||||
## Replay and window qualification
|
||||
|
||||
Player, headless runner, historical checker and all eleven native test targets
|
||||
build. All eleven native suites and twelve Python tooling tests pass, with every
|
||||
previous publication assertion enabled.
|
||||
|
||||
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
|
||||
frames. Every recording field matches parent `0fb62aa`, including the RAM hash on
|
||||
every frame: scratchpad, calls, draws, sound, thread state and EE timing/counts.
|
||||
Sampled 32 MiB RAM images are identical. Strict/default recordings and snapshots
|
||||
are byte exact; strict comparisons report no mismatch. Both returns are live on the four-player route: each runs natively 88 times with no recorded difference.
|
||||
|
||||
Fresh isolated window runs, started after the headless replays had finished,
|
||||
complete 6,500 one-player, 6,500 actual four-player and 4,200 movie frames.
|
||||
Reviewed captures show the intro and credits, menus, vehicle and level selection,
|
||||
driving with the HUD and four simultaneous views. Each route has five distinct
|
||||
captures. Stereo 48 kHz, 16-bit WAV recordings contain nonzero audio. Audio device
|
||||
underruns: 47.0 ms of silence in one-player, 28.8 ms in four-player and 20.4 ms in
|
||||
the movie run. These are functional checks, not a performance or flawless-playback
|
||||
claim. Full campaign and physical controller/hardware acceptance remain open.
|
||||
@@ -0,0 +1,35 @@
|
||||
# Native image-builder completion
|
||||
|
||||
BozoEngine's native graphics mode returns zero from `sceGsSetDefLoadImage` and
|
||||
`sceGsSetDefStoreImage` without constructing unused image packets or reading the output pointer.
|
||||
Generic SDK callers keep their existing output ABI. The shared implementation is
|
||||
[`64f6b22`, engine PR #4](https://github.com/TheBozos/BozoEngine/pull/4), contributed by the DC port
|
||||
after discussion with TMB and VP2S. The first adoption pinned engine main `149bf90`, whose source tree
|
||||
exactly matches that tested implementation. The later graphics-services pin and packet-reader retirement
|
||||
are recorded in [`NATIVE_GRAPHICS_SERVICES.md`](NATIVE_GRAPHICS_SERVICES.md). Neither adds image readback support.
|
||||
|
||||
TMB's `tmb_textures.cpp::sceGsSetDefLoadImageOverride` still binds resident RTX records and advances
|
||||
the ordinal before calling the SDK builder. The shared guard runs after those game-owned updates.
|
||||
Movies use decoded native pictures through `loadImageOverride`; they do not consume the skipped packet.
|
||||
No TMB texture-manager layout was copied from DC.
|
||||
|
||||
## Validation
|
||||
|
||||
Local artifacts are under `D:/BozoScratch/native-images`, compared with the retained HUD-main build
|
||||
at `5b5cd57` (engine `5bb4efb`).
|
||||
|
||||
- Nine engine CTest checks pass, including native/generic image builders and inaccessible-output guards.
|
||||
- The existing HUD and camera math suites pass on the new engine head.
|
||||
- A 9,500-frame 1P run and an 8,500-frame 4P run have exact baseline draw hashes, batch/vertex counts,
|
||||
sound hashes/sample counts, calls, EE clocks, scratchpad and thread records.
|
||||
- Both routes reproduce all six baseline texture-initialization diagnostic lines exactly, including
|
||||
resident texture ordinals and file identities. No texture-number mismatch was observed.
|
||||
- RAM hashes differ because the SDK packet writes are absent. Whole-RAM equality is not claimed.
|
||||
- Windowed default runs complete 4,201 movie/menu frames, 6,501 1P frames and 6,501 4P frames.
|
||||
Direct captures show the opening movie, active 1P combat and all four snow-arena views after loading,
|
||||
with resident textures and HUD present. The window logs record brief audio underruns; deterministic
|
||||
sound comparisons are exact, but this is not a flawless device-audio or subjective listening claim.
|
||||
- All 12 release-tool tests and Windows/Linux engine CI pass.
|
||||
|
||||
The change retires two packet serializers in the default native path. Other game-owned unused builders,
|
||||
compatibility data and VU0 math remain separate work. It does not claim full campaign or console parity.
|
||||
@@ -0,0 +1,107 @@
|
||||
# Native falling junk jet forward transforms
|
||||
|
||||
[Helicopter gun and walking pedestrian forwards](NATIVE_ENVHELI_PED_FORWARD.md) follow with two single-site owners.
|
||||
|
||||
Six junk jet death forward returns use native XYZ arithmetic after the
|
||||
[sinking blimp forwards](NATIVE_BLIMP_DEATH_FORWARD.md). Known forward coverage
|
||||
grows from 157 to 163 of 269 returns (106 remain). Known inverse coverage stays 134
|
||||
of 134; BozoEngine stays at `4a8f70a`.
|
||||
|
||||
All six are in `JunkJet::UpdateDeath` (`143728`) and transform through the jet's
|
||||
coordinate-system basis into the owner's frame vector at `+0`:
|
||||
|
||||
| Return PC | Path | Producer and consumer |
|
||||
| --- | --- | --- |
|
||||
| `143864` | Every frame | The velocity at `+20`, added to the jet's position |
|
||||
| `143940` | High (above 50), 1-in-7 roll | A random explosion offset (±80, random Y/Z), transformed in place, added to the position, handed to `particleCreateFx` |
|
||||
| `1439bc` | Low (0 to 50) | Fixed offset `(0,300,-20)`, the same way |
|
||||
| `143a18` | Low | Fixed offset `(0,150,0)` |
|
||||
| `143b0c` | Crash (at or below 0) | Fixed offset `(0,200,-20)` |
|
||||
| `143b60` | Crash | Fixed offset `(0,100,0)` |
|
||||
|
||||
Each frame the falling jet steers toward its crash target (`atan2f`,
|
||||
`boundFAngle`, `smoothEasyInAngle`), accumulates its roll, rebuilds its matrix with
|
||||
`mathfRotMatrixRPH` and moves by the transformed velocity. The height then picks a
|
||||
path. High, an occasional explosion. Low, two fixed bursts and one at the jet.
|
||||
Crashing:
|
||||
|
||||
1. Nearby cars are damaged (`BlowCarsInJetCrash`).
|
||||
2. The switch is set and debris thrown (`BlowDebris`).
|
||||
3. Two fixed bursts and one at the jet.
|
||||
4. The jet sound stops, its effects are killed and `junkyardAddPointsAfterJetCrash`
|
||||
runs.
|
||||
|
||||
The frame vector is read only by `mathfAddVector` and `particleCreateFx`. The
|
||||
effect reads its point only through `mathfAddVector`, including in
|
||||
`particlePostInitFx` and its recursive child effects. Frame `+0c` is never read; the
|
||||
offsets' X/Y/Z are always rewritten before each in-place transform. The owner reads
|
||||
no VU registers, accumulator or flags. The existing native helper computes
|
||||
separately rounded XYZ, preserves destination W and leaves VU state untouched. It
|
||||
reads its input before writing, so the in-place transforms are safe. Unknown and
|
||||
historical callers keep the original ABI. No engine or gameplay formula changes.
|
||||
|
||||
## Generated comparisons
|
||||
|
||||
Evidence is under `D:/BozoScratch/jet-death-forward`, against parent `17bc13a`
|
||||
(PR #66). Parent headless/window binaries are preserved there and match PR #66's
|
||||
qualified build. Generated bodies, retail data and runtime recordings stay outside
|
||||
Git.
|
||||
|
||||
- Added coverage is 3,072 generated sequences / 192 whole-memory comparisons (caller
|
||||
kinds 262 to 267): helper-boundary continuations and full-owner entries, across
|
||||
four rounding modes, FTZ/DAZ, RAM aliases, identity/quarter-turn bases and
|
||||
arbitrary W payloads.
|
||||
- The fixtures turn the particle system off (`gp-2f40 = 0`), as the game's own
|
||||
`particleCreateFx` allows. Each effect call then returns at once without reading
|
||||
its point, and the owner runs on to its real return. The test captures each
|
||||
effect's point as the call is made.
|
||||
- Full entries run the steering, matrix rebuild, transform and position update. The
|
||||
height picks the path: high with and without the explosion roll, low, or
|
||||
crashing. The fixture seeds the game's actual libc `rand` state for the 1-in-7
|
||||
roll. High and low entries return normally. Crashing entries stop at
|
||||
`BlowCarsInJetCrash`, so the two crash points are covered from their helper
|
||||
boundaries. Those runs go through both crash bursts and the burst at the jet, and
|
||||
stop at `terminateJetSound`; reaching it is asserted.
|
||||
- Helper-boundary outputs are checked against an independent identity or
|
||||
quarter-turn result. Full entries rebuild the basis from the steering angles
|
||||
first, so those are covered by the native/original comparison.
|
||||
- Every published value is asserted exactly against the original FPU addition: the
|
||||
jet's position, and every effect point in call order. Cases where several
|
||||
transforms run check each one in order.
|
||||
- Publication counts per site:
|
||||
|
||||
| `143864` | `143940` | `1439bc` | `143a18` | `143b0c` | `143b60` |
|
||||
| ---: | ---: | ---: | ---: | ---: | ---: |
|
||||
| 1,792 | 544 | 1,024 | 1,280 | 256 | 512 |
|
||||
- The VU rule from the earlier weapon increments applies. Only forward scratch W at
|
||||
frame `+0c` is normalized for test comparison, after every real consumer.
|
||||
- New caller kinds shift the shared random fill for later rounding modes, so two
|
||||
data-dependent counts in earlier fixtures moved (vehicle tire jumps 714 → 704,
|
||||
real libm errno cases 862 → 813). All scenario-defined counts and assertions are
|
||||
unchanged.
|
||||
- Aggregate caller coverage is 137,216 generated sequences / 6,560 whole-memory
|
||||
comparisons. Historical forward ABI coverage is 9,856 / 616; inverse remains
|
||||
8,576 / 134.
|
||||
|
||||
## Replay and window qualification
|
||||
|
||||
Player, headless runner, historical checker and all eleven native test targets
|
||||
build. All eleven native suites and twelve Python tooling tests pass, with every
|
||||
previous publication assertion enabled.
|
||||
|
||||
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
|
||||
frames. Every recording field matches parent `17bc13a`: raw RAM, scratchpad,
|
||||
calls, draws, sound, thread state and EE timing/counts. Sampled 32 MiB RAM images
|
||||
are identical. Strict/default recordings and snapshots are byte exact; strict
|
||||
comparisons report no mismatch. None of the six jet death returns runs on these
|
||||
routes, so they are qualified by the generated owner suite above.
|
||||
|
||||
Fresh isolated window runs, started after the headless replays had finished,
|
||||
complete 6,500 one-player, 6,500 actual four-player and 4,200 movie frames.
|
||||
Reviewed captures show the intro and credits, menus, vehicle and level selection,
|
||||
driving with the HUD and four simultaneous views. Each route has five distinct
|
||||
captures. Stereo 48 kHz, 16-bit WAV recordings contain nonzero audio. Audio device
|
||||
underruns: 62.6 ms of silence in one-player, 39.3 ms in four-player and 24.3 ms in
|
||||
the movie run. These are functional checks, not a performance or flawless-playback
|
||||
claim. A junk jet shot down in actual play, full campaign and physical
|
||||
controller/hardware acceptance remain open.
|
||||
@@ -0,0 +1,90 @@
|
||||
# Native launcher turret aim forward transforms
|
||||
|
||||
[Cop SUV laser-aim forwards](NATIVE_COPSUV_AIM_FORWARD.md) follow with two more launcher sites.
|
||||
|
||||
Three launcher turret-aim forward returns use native XYZ arithmetic after the
|
||||
[ricochet forwards](NATIVE_RICOCHET_FORWARD.md). Known forward coverage grows from
|
||||
139 to 142 of 269 returns (127 remain). Known inverse coverage stays 134 of 134;
|
||||
BozoEngine stays at `4a8f70a`.
|
||||
|
||||
| Return PC | Owner | Producer and consumer |
|
||||
| --- | --- | --- |
|
||||
| `150efc` | `Launcher::UpdateHearse` (`150e68`) | Turret offset table through the vehicle basis, in place, added to the shooter position |
|
||||
| `1511ec` | `Launcher::UpdateMinion` (`151060`) | Launcher offset through the aim basis built from the vehicle's roll/pitch/heading |
|
||||
| `1513f4` | `Launcher::UpdateTanker` (`151358`) | Turret offset table through the same kind of aim basis |
|
||||
|
||||
Each result is the owner's frame vector at `+10`. `mathfAddVector` adds the
|
||||
shooter position, and the real `mathfRotationFromPointToPoint` (`1dbd58`, scalar
|
||||
subtract and angles) turns it into turret angles toward the target that
|
||||
`Launcher::GetClosestCar` chose. Those angles are bounded, smoothed and published
|
||||
through `mathfRotMatrixRPHNoTrans` into the turret node. Frame `+1c` (the output
|
||||
W) is never read, and the owners read no VU registers, accumulator or flags. The
|
||||
existing native helper computes separately rounded XYZ, preserves destination W
|
||||
and leaves VU state untouched. Unknown and historical callers keep the original
|
||||
ABI. No engine or gameplay formula changes.
|
||||
|
||||
`Launcher::UpdateZoomies` (`14d294`) was examined and left for later: its
|
||||
consumer continues into `GetLockOn` and `TheGame::CreateWeapon`.
|
||||
|
||||
## Generated comparisons
|
||||
|
||||
Evidence is under `D:/BozoScratch/launcher-aim-forward`, against parent `3e3740f`
|
||||
(PR #58). Parent headless/window binaries are preserved there and match PR #58's
|
||||
qualified build. Generated bodies, retail data and runtime recordings stay
|
||||
outside Git.
|
||||
|
||||
- Added coverage is 1,536 generated sequences / 96 whole-memory comparisons
|
||||
(caller kinds 244 to 246): helper-boundary continuations and full-owner
|
||||
entries, across four rounding modes, FTZ/DAZ, RAM aliases, identity/quarter-turn
|
||||
bases and arbitrary W payloads.
|
||||
- Full entries run the real `GetClosestCar` over one live candidate in the game
|
||||
object's embedded vehicle array. A new 0x2600-byte snapshot region covers that
|
||||
array, including the Hearse's target flag at `+24bc`, which is asserted. The
|
||||
no-target scenario (a type-5 launcher with no car within 50 units, or the
|
||||
Minion's alternate type-5 path) skips the transform, and producer reach is
|
||||
asserted in every case.
|
||||
- Transform inputs and outputs are captured at the real helper and
|
||||
`mathfAddVector` boundaries and checked against an independent identity or
|
||||
quarter-turn result wherever the fixture knows the basis: all Hearse cases, and
|
||||
helper-boundary Minion/Tanker cases. Full Minion/Tanker entries build their aim
|
||||
basis with `mathfRPHFromMatrix`/`mathfRotMatrixRPH`; those are covered by the
|
||||
native/original comparison. The aim point consumed by
|
||||
`mathfRotationFromPointToPoint` is asserted exactly against the original FPU
|
||||
addition. Each site publishes in 480 cases.
|
||||
- The VU rule from the earlier weapon increments applies. Only forward scratch W
|
||||
at frame `+1c` is normalized for test comparison, after every real consumer.
|
||||
- New fixture regions and new caller kinds both change the shared random fill
|
||||
sequence that later cases see (the loop runs every kind within each rounding
|
||||
mode), so two data-dependent counts in earlier fixtures moved (vehicle tire jumps
|
||||
711 → 704, real libm errno cases 825 → 833). All scenario-defined counts and
|
||||
assertions are unchanged.
|
||||
- Aggregate caller coverage is 126,464 generated sequences / 5,888 whole-memory
|
||||
comparisons. Historical forward ABI coverage is 8,512 / 532; inverse remains
|
||||
8,576 / 134.
|
||||
|
||||
## Replay and window qualification
|
||||
|
||||
Player, headless runner, historical checker and all eleven native test targets
|
||||
build. All eleven native suites and twelve Python tooling tests pass, with every
|
||||
previous publication assertion enabled.
|
||||
|
||||
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
|
||||
frames. Every recording field matches parent `3e3740f`: raw RAM, scratchpad,
|
||||
calls, draws, sound, thread state and EE timing/counts. Sampled 32 MiB RAM images
|
||||
are identical. Strict/default recordings and snapshots are byte exact; strict
|
||||
comparisons report no mismatch. The three launcher sites are cold on these routes
|
||||
(no Hearse, Minion or Tanker special is fired), so the generated owner suite above
|
||||
is their qualification. The earlier ricochet site `1b2fb0` still runs natively
|
||||
319 times on the one-player route, exact.
|
||||
|
||||
Fresh isolated window runs complete 6,500 one-player, 6,500 actual four-player
|
||||
and 4,200 movie frames. Reviewed captures show the intro and credits, menus,
|
||||
vehicle and level selection, driving with the HUD and four simultaneous views.
|
||||
Each route has five distinct captures. Stereo 48 kHz, 16-bit WAV recordings
|
||||
contain nonzero audio.
|
||||
|
||||
Audio device underruns remain: 54.0 ms silence in one-player, 31.2 ms in
|
||||
four-player and 17.1 ms in the movie run. These are functional checks, not a
|
||||
performance or flawless-playback claim. A visible Hearse, Minion or Tanker
|
||||
special firing, full campaign and physical controller/hardware acceptance remain
|
||||
open.
|
||||
@@ -0,0 +1,97 @@
|
||||
# Native older BSP and hierarchy setup helpers
|
||||
|
||||
Fifteen more hierarchy returns use the existing native record calculations: eight inverse and
|
||||
seven forward additions bring the allowlists to fifty and forty-four entries respectively.
|
||||
This extends the [traversal/setup increment](NATIVE_HIERARCHY_TRAVERSAL_SETUP.md). BozoEngine stays
|
||||
at `4a8f70a`; no engine or renderer change is included.
|
||||
|
||||
| Helper | Return PCs | Owner |
|
||||
|---|---|---|
|
||||
| Inverse `1da1e8` | `1c7860`, `1c7904`, `1c7ae4`, `1c7d00` | Older BSP node `1c7758` |
|
||||
| Inverse `1da1e8` | `1c9984`, `1c9b3c` | Hierarchy roots `1c9858` |
|
||||
| Inverse `1da1e8` | `1ca3b8` | Collision grid `1c9bf8` |
|
||||
| Inverse `1da1e8` | `1caa48` | Hierarchy traversal `1ca798` |
|
||||
| Forward `1da298` | `1c7818`, `1c78c4`, `1c7a90` | Older BSP point/segment setup `1c7758` |
|
||||
| Forward `1da298` | `1c7bc8`, `1c7bf8`, `1c7de8`, `1c7e14` | Older BSP result publication `1c7758` |
|
||||
|
||||
Native leaves snapshot inputs before overlapping writes, retain separately rounded XYZ arithmetic
|
||||
and leave VU registers, accumulator, flags and data memory untouched. Inverse XYZW is exact,
|
||||
including meaningful basis[0].W. Forward XYZ is exact while destination W is preserved. Historical
|
||||
hosts and unknown callers retain the complete original helper ABI. Scalar normalization, matrix
|
||||
products, result packing, traversal/query dispatch, clocks and checkpoints remain compiled game
|
||||
code. Other helper returns and inline VU operations remain; this is not complete VU removal.
|
||||
|
||||
## Generated consumers and numerical checks
|
||||
|
||||
Local evidence is under `D:/BozoScratch/hierarchy-legacy-bsp`, against main `c0d2fc7` (PR #29).
|
||||
Generated game code, disc data, recordings, RAM dumps and captures are excluded from the commit.
|
||||
|
||||
- The consumer harness grows from 25,600 to 33,280 sequences and from 800 to 1,040 whole-memory
|
||||
comparisons (7,680 / 240 added). Four host FP modes, denormal controls, RAM aliases and arbitrary
|
||||
W payloads are covered. CPU outside retired VU, outgoing host FP effects, clocks/checkpoints and
|
||||
other memory match exactly; native VU remains untouched.
|
||||
- BSP setup runs paired local/world transforms, point-mode selection, zero/copy/normalization,
|
||||
exact/adjacent unit-axis decisions, real scalar additions and segment construction, then stops
|
||||
at the next BSP query dispatch. It does not replace or claim complete query-root coverage.
|
||||
- Both result paths run scalar endpoint reconstruction and packed material/flag publication. The
|
||||
looped point path stops at the next point iteration; the segment path runs through return.
|
||||
- Root continuations publish real packed matrix-stack state and arguments before stopping at
|
||||
traversal push. Grid/traversal continuations retain capacity-counter updates at 0 and 1199 and
|
||||
compare the following scalar matrix-product arguments. General traversal is outside these
|
||||
fixtures; its existing compiled functions remain responsible for children and callbacks.
|
||||
- Reference forward W and VU effects remain live through real consumers. Only final unused
|
||||
forward-output W is normalized afterward; a later inverse write retires that exclusion so
|
||||
meaningful inverse W remains compared exactly. No production W contract or arithmetic changes.
|
||||
- Historical forward checks grow to 2,240 cases / 140 whole-memory comparisons (448 / 28 added).
|
||||
Historical inverse checks cover all fifty returns: 3,200 cases / 50 whole-memory comparisons.
|
||||
The hierarchy suite retains 786,432 helper cases, 384 whole-memory checks, 8,000 geometric edges,
|
||||
1,024 recursive BSP callers / 32 whole-memory checks and 2,048 unknown-caller ABI cases.
|
||||
- The math suite retains 1,048,576 helper cases, 512 whole-memory checks and 2,048 unknown-caller
|
||||
ABI cases, including overlap, alignment, aliases and scratchpad coverage.
|
||||
- Player, headless and historical checker builds, all eleven native suites and twelve Python
|
||||
tooling tests pass.
|
||||
|
||||
## Gameplay, loading and movies
|
||||
|
||||
The default one-player route completes 9,500 frames and actual four-player completes 8,500.
|
||||
Every non-RAM frame-record field matches baseline throughout: scratchpad, calls/counts,
|
||||
draws/counts, sound/sample counts, thread state and EE clock. Four-player's entire recording,
|
||||
including every RAM frame, is baseline-byte-identical. Default runs perform zero original
|
||||
comparisons and zero VU0 microprogram calls.
|
||||
|
||||
Strict contact, hierarchy, math and projection checks pass. Strict/default complete recordings
|
||||
and snapshots are byte-identical for both routes.
|
||||
|
||||
One-player executes seven of the eight new inverse sites, 45,829 calls combined, and all seven
|
||||
new forward sites, 12,663 calls. Root return `1c9984` has generated-consumer and historical-ABI
|
||||
coverage without a live-route claim. Four-player reaches only root return `1c9b3c`, 9,685 calls.
|
||||
The batch retires another 58,492 / 9,685 original helper executions in one-player / four-player.
|
||||
These are counts, not timing or FPS measurements.
|
||||
|
||||
One-player RAM hashes differ on 529 frames in three intervals: 5900–5937, 8018–8290 and
|
||||
9135–9352. The complete 32 MB snapshot at frame 7000 is baseline-identical, as is four-player at
|
||||
frame 6000. A targeted frame-8150 snapshot differs by six bytes in two W words, `8ff13c` and
|
||||
`5253ec`: baseline zero versus native `008ff050`. Paired observers identify forward return
|
||||
`1c7818` writing inherited VF16.W in the original, while native preserves the destination's
|
||||
existing payload. The output temporary is SP+`20`, with unused W at SP+`2c`.
|
||||
|
||||
That stack slot is later reused by the collision-node path: the existing native XYZ addition
|
||||
at `1cb540` preserves W in the result record at `8ff130`, and the following full-record GPR
|
||||
copy carries it into `5253e0`. The two snapshots' changed W values follow this same write chain.
|
||||
All 20,895 observed contact-copy events pair at equal cycles; the 1,865 differing copies read
|
||||
that same stack record and carry zero / `008ff050`, with no changed XYZ computation. Both
|
||||
observer passes reproduce the qualified baseline/native recordings and targeted snapshots
|
||||
exactly. This is bounded snapshot/consumer evidence, not a classification of every RAM
|
||||
difference or possible campaign consumer.
|
||||
|
||||
Observers were removed, restored sources forced to rebuild, and both the native math and
|
||||
generated objects match their original qualified hashes. All three executables contain no
|
||||
observer markers. No padding restoration, hash mask or shadow VU state is shipped.
|
||||
All eleven native suites pass again. Final clean default replays reproduce both complete
|
||||
qualified recordings and snapshots byte-for-byte.
|
||||
|
||||
Fresh window routes complete 4,201 movie/menu frames and 6,501 each for one-player and actual
|
||||
four-player. Reviewed captures show decoded movie pictures, Junkyard loading and active rainy
|
||||
combat, and four advancing snow-arena views. Device logs report 16.4 / 53.1 / 37.9 ms of silence
|
||||
(movie / one-player / four-player), with underruns and dropped frames. Deterministic sound
|
||||
matches; flawless device audio, full campaign acceptance and console visual parity remain unclaimed.
|
||||
@@ -0,0 +1,85 @@
|
||||
# Native LoopTank forward transforms
|
||||
|
||||
[The first FireSpecial batch](NATIVE_FIRE_SPECIAL_FORWARD.md) follows with vehicle types 20, 40 and 60.
|
||||
|
||||
The two `LoopTank::update` forward returns use native XYZ arithmetic after the
|
||||
[special-weapon torch batch](NATIVE_SPECIAL_TORCH_FORWARD.md). Known forward coverage
|
||||
grows from 236 to 238 of 269 returns (31 remain). Known inverse coverage stays 134 of
|
||||
134; BozoEngine stays at `4a8f70a`.
|
||||
|
||||
`LoopTank::update` (`1517a8`) copies a table of six segments (`4e7250`) into frame
|
||||
`+80..+13f`. A loop then sends both points of each segment through the loop's
|
||||
matrix at frame `+40`, in place:
|
||||
|
||||
| Return PC | Producer and consumer |
|
||||
| --- | --- |
|
||||
| `151c08` | The segment's first point (frame `+80 + 0x20k`) |
|
||||
| `151c18` | Its second point (frame `+90 + 0x20k`) |
|
||||
|
||||
After both transforms, `mathfAddVector` adds the tank's position (coordinate system
|
||||
at `+80`) to each point. After the loop, the segment selected by `+14` is
|
||||
line-tested (`hdLosCsTest`). On a hit, `mathfSubVector` reads both points and
|
||||
`DispatchHit` gets the difference.
|
||||
|
||||
The take-hit info's point pointer is set to the segment's first point. Only
|
||||
`FinalBoss::TakeHit` and the Minion take-hit path dereference that pointer:
|
||||
- `mathfManhatDist` reads it as XYZ.
|
||||
- `forceFieldTakeHit` loads 128 bits but subtracts with the VU XYZ mask, so the W
|
||||
lane is not used.
|
||||
|
||||
All other readers of the take-hit info use other fields. The owner never loads any of
|
||||
the array's W slots, and it reads no VU registers, accumulator or flags. The existing
|
||||
native helper computes separately rounded XYZ, preserves destination W and leaves VU
|
||||
state untouched. Unknown and historical callers keep the original ABI. No engine or
|
||||
gameplay formula changes.
|
||||
|
||||
## Generated comparisons
|
||||
|
||||
Evidence is under `D:/BozoScratch/looptank-forward`, against parent `fa84a39`
|
||||
(PR #83). Parent headless/window binaries are preserved there and match PR #83's
|
||||
qualified build. Generated bodies, retail data and runtime recordings stay outside
|
||||
Git.
|
||||
|
||||
- Added coverage is 1,024 generated sequences / 64 whole-memory comparisons (caller
|
||||
kinds 341 and 342). They are helper-boundary continuations and entries at the
|
||||
call-return label after `drawInit` (`151bc8`), across four rounding modes,
|
||||
FTZ/DAZ, RAM aliases, identity/quarter-turn bases and arbitrary W payloads.
|
||||
- Each run transforms the first segment's two points, adds the position to each and
|
||||
stops when the selected segment is marked (`mathfSetFVector`). By then both
|
||||
points have been consumed.
|
||||
- The harness pairs each addition with the transform that wrote its first operand,
|
||||
because both transforms run before either addition and the point is the
|
||||
addition's first operand. The first segment's W slots (frame `+8c`, `+9c`) are
|
||||
the only forward W normalized for test comparison.
|
||||
- Every basis is fixture-known, so both points are checked against an independent
|
||||
identity or quarter-turn result. Both world points are asserted exactly against
|
||||
the original FPU arithmetic. Publications: 768 for `151c08` and 1,024 for
|
||||
`151c18`.
|
||||
- New caller kinds shift the shared random fill for later rounding modes, so two
|
||||
data-dependent counts in earlier fixtures moved (vehicle tire jumps 703 → 705,
|
||||
real libm errno cases 816 → 802). All scenario-defined counts and assertions are
|
||||
unchanged.
|
||||
- Aggregate caller coverage is 175,616 generated sequences / 8,960 whole-memory
|
||||
comparisons. Historical forward ABI coverage is 14,656 / 916; inverse remains
|
||||
8,576 / 134.
|
||||
|
||||
## Replay and window qualification
|
||||
|
||||
Player, headless runner, historical checker and all eleven native test targets
|
||||
build. All eleven native suites and twelve Python tooling tests pass, with every
|
||||
previous publication assertion enabled.
|
||||
|
||||
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
|
||||
frames. Every recording field matches parent `fa84a39`, including the RAM hash on
|
||||
every frame: scratchpad, calls, draws, sound, thread state and EE timing/counts.
|
||||
Sampled 32 MiB RAM images are identical. Strict/default recordings and snapshots
|
||||
are byte exact; strict comparisons report no mismatch. The two returns are cold on these routes and are qualified by the generated owner suite above.
|
||||
|
||||
Fresh isolated window runs, started after the headless replays had finished,
|
||||
complete 6,500 one-player, 6,500 actual four-player and 4,200 movie frames.
|
||||
Reviewed captures show the intro and credits, menus, vehicle and level selection,
|
||||
driving with the HUD and four simultaneous views. Each route has five distinct
|
||||
captures. Stereo 48 kHz, 16-bit WAV recordings contain nonzero audio. Audio device
|
||||
underruns: 172.4 ms of silence in one-player, 8.9 ms in four-player and 40.2 ms in
|
||||
the movie run. These are functional checks, not a performance or flawless-playback
|
||||
claim. The one-player window run reported 172.4 ms of silence. A back-to-back one-player rerun of new and parent builds gave 50.7 ms and 33.7 ms at 59.7 frames/s. The loop tank in actual play, full campaign and physical controller/hardware acceptance remain open.
|
||||
@@ -0,0 +1,101 @@
|
||||
# Native machine-gun muzzle forward transforms
|
||||
|
||||
[Tire-pair correction forwards](NATIVE_TIRE_ROTATION_FORWARD.md) follow with two vehicle-orientation sites.
|
||||
|
||||
Two weapon-initialization forward returns use native XYZ arithmetic after the
|
||||
[helicopter gun and walking pedestrian forwards](NATIVE_ENVHELI_PED_FORWARD.md).
|
||||
Known forward coverage grows from 165 to 167 of 269 returns (102 remain). Known
|
||||
inverse coverage stays 134 of 134; BozoEngine stays at `4a8f70a`.
|
||||
|
||||
| Return PC | Owner | Producer and consumer |
|
||||
| --- | --- | --- |
|
||||
| `1b79f8` | `Weapon::InitWeapon` (`1b77d0`), weapon type 0 | The vehicle's first muzzle offset (`+2510`) through the new weapon's coordinate-system basis, added to its position |
|
||||
| `1b7a14` | The same | The second muzzle offset (`+2520`), on the alternate barrel |
|
||||
|
||||
When a vehicle fires its machine gun, `InitWeapon` sets up the new round. The
|
||||
game's weapon-type jump table selects the machine-gun case. It aims the round
|
||||
(only when no lock is held, using `mathfPitchFromPointToPoint` and
|
||||
`mathfRotMatrixPH`), sets its timers and speeds from game tables, and updates the
|
||||
vehicle's counter at `+22c4`. It then places the round at one of the vehicle's two
|
||||
muzzles. The vehicle's toggle at `+2230` alternates
|
||||
the barrel each shot. The result is the frame vector at `+0`, read only by
|
||||
`mathfAddVector`. The round is then linked into the hierarchy
|
||||
(`hierSetCsEpNode`). Frame `+0c` is never read in this or any other weapon-type
|
||||
case of the owner. The owner reads no VU registers, accumulator or flags.
|
||||
|
||||
The existing native helper computes separately rounded XYZ, preserves destination
|
||||
W and leaves VU state untouched. Unknown and historical callers keep the original
|
||||
ABI. No engine or gameplay formula changes.
|
||||
|
||||
## Generated comparisons
|
||||
|
||||
Evidence is under `D:/BozoScratch/machine-gun-forward`, against parent `e298f20`
|
||||
(PR #68). Parent headless/window binaries are preserved there and match PR #68's
|
||||
qualified build. Generated bodies, retail data and runtime recordings stay outside
|
||||
Git.
|
||||
|
||||
- Added coverage is 1,024 generated sequences / 64 whole-memory comparisons (caller
|
||||
kinds 270 and 271): helper-boundary continuations and full-owner entries, across
|
||||
four rounding modes, FTZ/DAZ, RAM aliases, identity/quarter-turn bases and
|
||||
arbitrary W payloads.
|
||||
- Full entries run the weapon-type dispatch, the locked and unlocked aim gates, and
|
||||
the `+22c4` counter branch. Each places the round and stops at
|
||||
`hierSetCsEpNode`; reaching it is asserted. A non-gun weapon type returns
|
||||
without a transform.
|
||||
- The weapon's basis is fixture-known at entry as well as at the helper boundary,
|
||||
so every case is checked against an independent identity or quarter-turn result.
|
||||
- The round's position is asserted exactly against the original FPU addition, and
|
||||
the barrel toggle is asserted for each barrel. Each site publishes in 480 cases.
|
||||
- The VU rule from the earlier weapon increments applies. Only forward scratch W at
|
||||
frame `+0c` is normalized for test comparison, after every real consumer.
|
||||
- New caller kinds shift the shared random fill for later rounding modes, so one
|
||||
data-dependent count in earlier fixtures moved (real libm errno cases 828 → 853).
|
||||
All scenario-defined counts and assertions are unchanged.
|
||||
- Aggregate caller coverage is 139,264 generated sequences / 6,688 whole-memory
|
||||
comparisons. Historical forward ABI coverage is 10,112 / 632; inverse remains
|
||||
8,576 / 134.
|
||||
|
||||
## Replay and window qualification
|
||||
|
||||
Player, headless runner, historical checker and all eleven native test targets
|
||||
build. All eleven native suites and twelve Python tooling tests pass, with every
|
||||
previous publication assertion enabled.
|
||||
|
||||
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
|
||||
frames. Both sites are live on the one-player route, running natively 81 (`1b79f8`)
|
||||
and 82 (`1b7a14`) times. Strict mode compares every native XYZ against the original
|
||||
leaf and reports no mismatch. Strict/default recordings and snapshots are byte
|
||||
exact.
|
||||
|
||||
**One recorded difference, and why it is expected.** Against parent `e298f20`,
|
||||
the four-player recording matches on every field and its 32 MiB snapshot is
|
||||
identical. The one-player recording matches on every field except the RAM hash.
|
||||
That hash differs on 354 of 9,500 frames (from frame 5,674, in bursts while the gun
|
||||
fires), and the frame-7,000 snapshot is identical.
|
||||
|
||||
- A RAM dump right after frame 5,674 shows exactly one differing word, `0x8ff32c`.
|
||||
The parent has `00000000`, the stale VU W that the original leaf stores; the
|
||||
native build has `00333373`, the previous stack contents, which the native helper
|
||||
leaves in place.
|
||||
- Logging the destination in a temporary build showed `InitWeapon`'s output at
|
||||
`sp = 0x8ff320`. So `0x8ff32c` is its dead frame `+0c` W slot, which nothing
|
||||
reads; it is overwritten by later stack use.
|
||||
- To show nothing reads it, the same temporary build wrote a NaN pattern
|
||||
(`7fc0dead`) into that W after each of these two transforms. Over the full
|
||||
one-player route, every recorded field still matched the parent except the RAM
|
||||
hash: calls, draws, sound, thread state, EE timing and every count.
|
||||
- Earlier live sites were byte exact only because their dead W slots happened to be
|
||||
overwritten within the same frame. This is the first site where the stale word
|
||||
survives until the end-of-frame RAM hash.
|
||||
|
||||
The experiment was not committed. The qualified binaries were rebuilt from the
|
||||
committed source, and both headless routes were rerun on them with the same result.
|
||||
|
||||
Fresh isolated window runs, started after the headless replays had finished,
|
||||
complete 6,500 one-player, 6,500 actual four-player and 4,200 movie frames.
|
||||
Reviewed captures show the intro and credits, menus, vehicle and level selection,
|
||||
driving with the HUD and four simultaneous views. Each route has five distinct
|
||||
captures. Stereo 48 kHz, 16-bit WAV recordings contain nonzero audio. Audio device
|
||||
underruns: 55.6 ms of silence in one-player, 26.0 ms in four-player and 22.6 ms in
|
||||
the movie run. These are functional checks, not a performance or flawless-playback
|
||||
claim. Full campaign and physical controller/hardware acceptance remain open.
|
||||
@@ -0,0 +1,76 @@
|
||||
# Native camera matrix products
|
||||
|
||||
The player runtime calculates `vu0MulMatrixTP3x3` (`0x1dcc68`) and `vu0MulMatrix4x4`
|
||||
(`0x1dcd50`) directly over typed column-major game records. Their current callers are in `viewUpdate`.
|
||||
The default path reads both input matrices before writing the output, supports overlapping records,
|
||||
and does not read or update VU registers, accumulator, flags, microcode or VU data memory.
|
||||
|
||||
Host SIMD performs separately rounded multiplication and addition, with contraction disabled. A scoped
|
||||
floating-point control setting handles denormals and restores the caller's complete MXCSR. Rare values
|
||||
outside IEEE's finite exponent range use the existing scalar number-format operations on record bits;
|
||||
they do not create processor state. The transposed product preserves the original moved-component
|
||||
normalization and final fourth column. All four output components are checked, including W.
|
||||
|
||||
The historical call-log host retains the generated helpers. `TMB_NATIVE_MATH_CHECK=1` compares the native
|
||||
result with an original helper on a copied context, restoring the output before the native write. This is
|
||||
an opt-in diagnostic; the normal player path never invokes the original helper.
|
||||
|
||||
## Validation
|
||||
|
||||
Artifacts are local under `D:/BozoScratch/native-math`; no game data is committed.
|
||||
|
||||
- Build and run the explicit `tmb-native-math-tests` target. Its 524,288 original/native cases compare
|
||||
record bytes, CPU return state, untouched VU state and restored host floating-point control across four
|
||||
host rounding modes. Inputs include finite game-like numbers, arbitrary bits, extreme exponents,
|
||||
denormals, overlapping inputs/outputs, address aliases, low address bits and scratchpad records.
|
||||
Another 256 comparisons check the complete flat guest memory, rather than just the output arena.
|
||||
- A 9,500-frame strict gameplay route checks 28,906 transposed and 43,359 full products, with zero
|
||||
mismatches. A separate default run makes zero original-helper comparisons and produces identical
|
||||
per-frame records to the strict run.
|
||||
- Against the native graphics main baseline, all 8,500 comparable frame records have identical draw
|
||||
hashes, batches, vertices, sound hashes/sample counts, calls, scratchpad, threads and EE cycles.
|
||||
- The separate 4P route checks 70,136 transposed and 105,204 full products with zero mismatches.
|
||||
Every one of its 8,500 frames matches the baseline's draw/sound/call/clock/scratchpad/thread fields.
|
||||
A separate default run reproduces all 8,500 strict-run records exactly.
|
||||
- With original comparisons disabled, the windowed no-input movie route completes 4,201 frames and
|
||||
the scripted 1P and 4P routes each complete 9,001. Direct captures show the opening movie, menus,
|
||||
vehicle selection and active gameplay, including all four split-screen views after loading. These
|
||||
are bounded smoke checks, not full campaign or console visual-parity acceptance. WAVs contain active
|
||||
output; window logs report 21.8/33.2/34.6 ms of silence respectively, so this is not a flawless
|
||||
device-audio or subjective listening claim. Deterministic sound hashes above are exact.
|
||||
- All 12 release-tool tests and eight engine CTest checks pass. Windows and Linux PR CI pass.
|
||||
|
||||
## Matrix-only state difference (before native HUD transforms)
|
||||
|
||||
This is not a whole-RAM equivalence claim. RAM hashes differ from frame 5594 onward. Full 32 MB dumps
|
||||
at gameplay points 5600 and 8500 each differ in exactly one word: `0x4a1f5c`, a HUD coordinate-system
|
||||
position's fourth component. `updateHUDPosition` writes it at `0x13ce98`: the calculation writes XYZ,
|
||||
then stores the full vector with W inherited from unrelated earlier VU work. Removing the camera helper's
|
||||
register clobbers changes that inherited value. The traced reader is `hierCsUpdateAsm` (`0x201e98`),
|
||||
whose camera-position calculation uses XYZ. No shadow VU writes or artificial W restoration are added.
|
||||
The tested render/sound/state observations above remain exact; they do not prove every campaign path.
|
||||
|
||||
For 4P, RAM hashes start differing at frame 4703. The point-8500 dump has exactly four differing words:
|
||||
`0x4a1afc`, `0x4a1b9c`, `0x4a1c3c` and `0x4a1cdc`. These are position.W in four coordinate records;
|
||||
the four HUD pointers at `0x23c548..0x23c554` point to those records, and `updateHUDPosition` loads
|
||||
that array at `0x13cd1c`. Thus the final 4P snapshot isolates the same inherited-W store for each view.
|
||||
|
||||
The six inline HUD transforms are lowered separately; [`NATIVE_HUD.md`](NATIVE_HUD.md) records their
|
||||
W-preservation contract, validation and limits. [`NATIVE_VEHICLE.md`](NATIVE_VEHICLE.md) covers the vehicle
|
||||
3x3 product, inline vehicle calculations and audited skid direction. Other helper callers, hierarchy
|
||||
routines and VU0 compatibility state still need wider caller/dataflow replacements.
|
||||
These increments do not claim that all VU0 work uses native records yet.
|
||||
|
||||
[`NATIVE_HIERARCHY.md`](NATIVE_HIERARCHY.md) now covers the collision/height hierarchy's native sphere test,
|
||||
audited inverse directions and BSP plane-distance pairs. [`NATIVE_SCENE.md`](NATIVE_SCENE.md) covers the
|
||||
subsequent coordinated replacement of the renderer hierarchy's coupled matrix/FOV/light stack. Other
|
||||
direction/helper callers and VU macro blocks remain.
|
||||
|
||||
[`NATIVE_PROJECTION.md`](NATIVE_PROJECTION.md) covers the subsequent native row-wise projection and
|
||||
weather identity boundaries, including their original reduction order and caller-specific scope.
|
||||
|
||||
[`NATIVE_DIRECTIONS.md`](NATIVE_DIRECTIONS.md) extends native direction math to the three hot BSP
|
||||
collision setup callers, with generated-consumer checks and an explicit stack-W boundary.
|
||||
|
||||
[`NATIVE_CAMERA_TRANSFORMS.md`](NATIVE_CAMERA_TRANSFORMS.md) subsequently adds camera-update
|
||||
and rear-view forward transforms, including the coupled inline position consumer's exact W contract.
|
||||
@@ -0,0 +1,87 @@
|
||||
# Native Minion shield forward transforms
|
||||
|
||||
Seven `Vehicle::minionTakeHit` forward returns use native XYZ arithmetic after
|
||||
[attachment/environment forwards](NATIVE_ATTACHMENT_FORWARD.md). Known forward
|
||||
coverage grows from 124 to 131 of 269 returns (138 remain). Known inverse coverage
|
||||
stays 134 of 134; BozoEngine stays at `4a8f70a`.
|
||||
|
||||
| Return PC | Producer and consumer |
|
||||
| --- | --- |
|
||||
| `1ada84` | First shield offset through the vehicle basis, world translation and hit-distance check |
|
||||
| `1adb8c`, `1adba0` | Second shield offset through vehicle and shield bases, then world translation and hit-distance check |
|
||||
| `1adca8`, `1adcbc` | Third shield offset through both bases and hit-distance check |
|
||||
| `1addc4`, `1addd8` | Fourth shield offset through both bases and hit-distance check |
|
||||
|
||||
The existing native helper computes separately rounded XYZ, preserves destination
|
||||
W and leaves VU registers, accumulator, flags and data memory untouched. Original
|
||||
point-table producers, distance formula, damage/health logic, hierarchy switches,
|
||||
HUD queue/primary messages and return behavior remain. Unknown/historical callers
|
||||
retain the original ABI. No engine or gameplay formula changes.
|
||||
|
||||
## Generated comparisons
|
||||
|
||||
Evidence is under `D:/BozoScratch/minion-forward`, against parent `cafd3f7`
|
||||
(PR #55). Parent headless/window binaries are preserved there. Generated bodies,
|
||||
retail data and runtime recordings stay outside Git.
|
||||
|
||||
- Added coverage is 3,584 generated sequences / 224 whole-memory comparisons.
|
||||
Each return has 256 helper-boundary sequences through its real continuation and
|
||||
256 full-owner-entry sequences. All seven sites are required to execute, with
|
||||
four rounding modes, FTZ/DAZ, RAM aliases, identity/quarter-turn bases, arbitrary
|
||||
matrix/source/destination W payloads and the actual in-place second transforms.
|
||||
- Full entries execute the original point-table loads, inactive force-field
|
||||
bookkeeping, one or two basis transforms per shield, translation and the real
|
||||
distance approximation. Independent exact world coordinates are asserted at
|
||||
each distance call, then compared between native and original executions.
|
||||
- All four shields have successful damage and destruction cases. Health changes
|
||||
from 100 to 80 on ordinary hits; the actual game/HUD calls publish primary and
|
||||
queued message IDs `d2` through `d5` in all four HUD slots. Retained-shield return
|
||||
values are checked. Exact 50-unit and distant misses leave health/UI unchanged.
|
||||
- Destruction changes health from 10 to -10 and executes the real hierarchy switch
|
||||
update. Those cases stop at `figureOutForceField` after health/switch publication.
|
||||
Force-field rebuilding, effects and sound beyond that boundary are not stubbed
|
||||
or claimed as complete-owner coverage. Non-destruction fixtures complete the
|
||||
original owner with the impact-sound gate disabled and the force field inactive.
|
||||
- Damage publications pass 176/240/240/240 cases across the four shields;
|
||||
destruction/switch publications pass the same counts. There are 896 exact
|
||||
distance-boundary rejection cases. Actual transform/field/distance/message/
|
||||
switch counts and distance inputs must agree before final memory comparison.
|
||||
- Only forward scratch W at the owner's `SP+0c` is normalized for test comparison,
|
||||
after every real consumer. Full-entry frames are `0xd0` bytes; helper-boundary
|
||||
frames retain their actual stack position. Original W/VU writes stay live
|
||||
through the original consumers. CPU outside retired VU, clocks/checkpoints,
|
||||
host FP effects and memory agree; native VU remains untouched throughout.
|
||||
No runtime RAM mask, recording normalization or VU-state reconstruction is added.
|
||||
- Aggregate caller coverage is 120,832 generated sequences / 5,536 whole-memory
|
||||
comparisons. Historical forward ABI coverage is 7,808 / 488; inverse remains
|
||||
8,576 / 134. Existing hierarchy/BSP/edge/unknown-ABI coverage and all earlier
|
||||
publication assertions remain enabled.
|
||||
|
||||
## Replay and window qualification
|
||||
|
||||
Player, headless runner, historical checker and all eleven native test targets
|
||||
build. All eleven native suites and twelve Python tooling tests pass, with every
|
||||
previous publication assertion enabled.
|
||||
|
||||
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
|
||||
frames. Every recording field matches parent `cafd3f7`: raw RAM, scratchpad,
|
||||
calls, draws, sound, thread state and EE timing/counts. Sampled 32 MiB RAM images
|
||||
are identical. Strict/default recordings and snapshots are byte exact; strict
|
||||
comparisons report no mismatch. No new recorded-RAM difference is introduced.
|
||||
|
||||
Fresh isolated window runs complete 6,500 one-player, 6,500 actual four-player
|
||||
and 4,200 movie frames. Reviewed captures show vehicle/level selection, level
|
||||
loading, advancing driving, opponents/effects, four simultaneous views, decoded
|
||||
intro footage and return to the menu. Each route has five distinct captures.
|
||||
Stereo 48 kHz, 16-bit WAV recordings contain nonzero audio.
|
||||
|
||||
All seven Minion sites are cold on these runtime routes, including movies.
|
||||
Their direct qualification is the generated-owner/consumer suite above, not a
|
||||
visible Minion boss encounter. Active force-field hits, destruction effects,
|
||||
sound dispatch and the subsequent force-field rebuild remain outside the new
|
||||
fixtures; their original implementations are retained.
|
||||
|
||||
Audio device underruns remain: 47.4 ms silence in one-player and 27.2 ms in
|
||||
four-player; this movie run logs zero underruns. These are functional checks,
|
||||
not a performance or flawless-playback claim. Full campaign and physical
|
||||
controller/hardware acceptance remain open.
|
||||
@@ -0,0 +1,76 @@
|
||||
# Native object shader output
|
||||
|
||||
The subsequent [native texture-input increment](NATIVE_TEXTURE_INPUTS.md) removes the three texture
|
||||
copies retained at this step, together with their consumer's packet reads and patches. The evidence
|
||||
below records this earlier shader/header increment.
|
||||
|
||||
The native mesh path already submits named shader inputs from game/scene records. This increment
|
||||
retires 38 scalar/header output stores in `pktAddVu1ObjAsm` (`1eaae8`), alongside the 18 VU payload
|
||||
stores retired by the Scene increment. It replaces the three RGB packet readbacks at `1ead74`,
|
||||
`1ead7c` and `1ead8c` with direct reads of their source game records. There is no packet image or
|
||||
shadow register bank for these shader parameters. BozoEngine remains at `4a8f70a`.
|
||||
|
||||
The colour source is the object's aligned 128-bit colour record, with nonnegative signed RGB indices
|
||||
selecting the instance's float table. Negative indices retain the object colour. The original scalar
|
||||
car multiplications, flags and CPU/FPU clobbers stay in the generated builder. Its copy-source loads,
|
||||
loops, checkpoints, program choice, cursor at control `+8`, and texture cache pointer at scratchpad
|
||||
`+94` are retained. The historical checker host executes the original instructions.
|
||||
|
||||
## Texture boundary
|
||||
|
||||
At this step the three texture payload stores at `1eabd0`, `1eabd4` and `1eabd8` intentionally remain. After traversal,
|
||||
`hier` calls `texmGetTextureAddrs` (`1f90b0`) on those copied records. That helper reads their format
|
||||
and may activate a texture, update game texture-manager state and patch the copied texture record.
|
||||
Removing that producer alone changes the helper's branches and subsequent draw/sound hashes.
|
||||
The producer and this consumer must be replaced together; retaining an unused hardware header would
|
||||
not satisfy that dependency. The new tests require these texture copies to match exactly while all
|
||||
retired output bytes stay untouched.
|
||||
|
||||
## Validation
|
||||
|
||||
Evidence is under `D:/BozoScratch/object-packets`, against main `165c6f2`, using the same USA disc,
|
||||
engine, build and input scripts. Every run uses a private user folder. These are functional checks
|
||||
with no performance claim.
|
||||
|
||||
- `tmb-native-object-packet-tests` executes the actual generated builder with the existing published
|
||||
adaptations, then with this increment. All 8,192 full-builder comparisons pass across four host
|
||||
FP modes, object word alignments, signed colour indices, instance/bones, textures, matrix changes,
|
||||
car tint, fog, points, extra records and clip/program states. Complete CPU/FPU/context, MXCSR,
|
||||
cursor/cache metadata, scratchpad and memory outside retired bytes match. There are 32 complete
|
||||
flat-memory checks. All 41 new instruction sites are reached.
|
||||
- Another 233 cases use an inaccessible packet output pointer with zero textures, checking that
|
||||
shader stores/RGB readbacks cannot reach a device, with unchanged tint/FPU results and extents.
|
||||
Textured cases retain their required producer and are excluded from this inaccessible-pointer test.
|
||||
- All eight native suites and 12 release-tool tests pass; player, headless and historical checker build.
|
||||
- Default 1P (9,500 frames) and actual 4P (8,500) match main on every draw hash/count, sound hash/sample
|
||||
count, library call field, EE clock, scratchpad and thread record. Separate strict/default recordings
|
||||
are byte-identical. Default VU0 program counts remain zero. No hash mask is widened.
|
||||
- The two default routes retire 30,092,181 / 41,383,590 stores and perform 1,646,466 / 3,341,874 direct
|
||||
RGB reads. RAM hashes differ on 9,496 / 8,496 frames. Full 32 MB snapshots at 1P frame 7,000 and 4P
|
||||
frame 6,000 isolate every differing byte to the four named packet buffers below; there are zero
|
||||
differences outside these buffers at those snapshots.
|
||||
|
||||
| Buffer interval | 1P differing bytes | 4P differing bytes |
|
||||
| --- | ---: | ---: |
|
||||
| `564a80..5eca80` (`hierObjPkt`) | 995 | 590 |
|
||||
| `5eca80..630a80` (`hierObjPkt2`) | 39,069 | 18,042 |
|
||||
| `630a80..64ea80` (`hierAlphaPkt`) | 12,252 | 4,029 |
|
||||
| `64ea80..66ca80` (`hierAlphaPkt2`) | 13,944 | 4,179 |
|
||||
|
||||
Intervals are half-open. The snapshot boundary is bounded evidence, not proof of all campaign consumers.
|
||||
|
||||
Windowed movie/menu (4,201 frames), 1P (6,502) and 4P (6,501) complete through loading into active arenas.
|
||||
Direct capture inspection covers decoded movie action, readable vehicle/level selection and loading,
|
||||
the rainy 1P arena with targeting/HUD/vehicles, and four independent snowy views. This is visual smoke
|
||||
evidence, not console or pixel parity. Device logs retain 25.3 / 58.6 / 8.8 ms of inserted silence in
|
||||
movie/1P/4P, and dropped frames in movie/1P. Exact deterministic sound does not imply flawless device
|
||||
audio or subjective listening acceptance.
|
||||
|
||||
## Remaining scope
|
||||
|
||||
The texture activation/patching dependency above is addressed by the subsequent native texture-input
|
||||
increment linked at the top. Alpha link records, scalar
|
||||
builder bookkeeping, source copy loops, legacy packet extents, other mixed graphics builders and
|
||||
unconverted VU macro helper callers remain. This is shader-output retirement, not removal of the
|
||||
complete builder or all packet code. The earlier player release is unchanged. Full campaign coverage,
|
||||
console visual parity and flawless device audio are not claimed.
|
||||
@@ -0,0 +1,106 @@
|
||||
# Native particle arc forward transforms
|
||||
|
||||
[FinalBoss gun-shot forwards](NATIVE_BOSS_SHOTS_FORWARD.md) follow with twelve boss sites.
|
||||
|
||||
Two particle forward returns use native XYZ arithmetic after the
|
||||
[AI hunt and bait forwards](NATIVE_AI_BEAD_FORWARD.md). Known forward coverage grows
|
||||
from 180 to 182 of 269 returns (87 remain). Known inverse coverage stays 134 of 134;
|
||||
BozoEngine stays at `4a8f70a`.
|
||||
|
||||
| Return PC | Owner | Producer and consumer |
|
||||
| --- | --- | --- |
|
||||
| `1e7e08` | `particleFlatArcs` (`1e7c00`) | A random flat offset (scaled by 20, Z 0) through a basis built from the arc's Z direction, into the particle's point array, plus the start point; the point's W is then rewritten with a fresh random value |
|
||||
| `1e77e8` | `particleElectricArc` (`1e74c0`) | A random offset on a ring through the A→B basis into the frame vector at `+0`, scaled and added to A for each segment end |
|
||||
|
||||
Both owners take a free particle from the game's particle list. They build a basis
|
||||
with `utilGenerateMatrixFromZvector`, fill the particle's point array and hand the
|
||||
particle to `1e22f0`.
|
||||
|
||||
- **`particleFlatArcs`** throws ten points. Each transform writes the point slot;
|
||||
`mathfAddVector` adds the start point (X/Y/Z only), and the owner then stores a new
|
||||
W into the same slot before anything reads it. The transform's W can therefore
|
||||
never be observed.
|
||||
- **`particleElectricArc`** writes the frame vector at `+0`, read only by
|
||||
`mathfScaleVector`. Frame `+0c` is never read, and the segment points' W values are
|
||||
written explicitly.
|
||||
|
||||
Neither owner reads VU registers, the accumulator or flags. The existing native
|
||||
helper computes separately rounded XYZ, preserves destination W and leaves VU state
|
||||
untouched. Unknown and historical callers keep the original ABI. No engine or
|
||||
gameplay formula changes.
|
||||
|
||||
## Generated comparisons
|
||||
|
||||
Evidence is under `D:/BozoScratch/particle-arcs-forward`, against parent `c265cfd`
|
||||
(PR #73). Parent headless/window binaries are preserved there and match PR #73's
|
||||
qualified build. Generated bodies, retail data and runtime recordings stay
|
||||
outside Git.
|
||||
|
||||
- Added coverage is 1,024 generated sequences / 64 whole-memory comparisons (caller
|
||||
kinds 285 and 286): helper-boundary continuations and full-owner entries, across
|
||||
four rounding modes, FTZ/DAZ, RAM aliases, identity/quarter-turn bases and
|
||||
arbitrary W payloads.
|
||||
- Full entries run from the owner's start:
|
||||
- the real free-list allocation, the basis construction, the random-vector and
|
||||
seed helpers, and `sinf`/`cosf` with `sqrt` for the electric ring;
|
||||
- every point of the particle.
|
||||
|
||||
They stop at `1e22f0`; reaching it is asserted. No free particle returns without
|
||||
a transform, and an electric arc with no segments skips its loop.
|
||||
- `particleFlatArcs` rewrites each point's W itself, so its cases compare memory
|
||||
exactly, with no W exclusion at all. Its full entries check all ten points in
|
||||
order.
|
||||
- Helper-boundary FlatArcs outputs are checked against an independent identity or
|
||||
quarter-turn result. ElectricArc scales its result before the addition, so its
|
||||
published segment end is asserted against the original FPU arithmetic instead.
|
||||
The sites publish in 2,496 and 448 cases.
|
||||
- The VU rule from the earlier weapon increments applies. Only ElectricArc's forward
|
||||
scratch W at frame `+0c` is normalized for test comparison, after every real
|
||||
consumer.
|
||||
- New caller kinds shift the shared random fill for later rounding modes, so two
|
||||
data-dependent counts in earlier fixtures moved (vehicle tire jumps 706 → 704,
|
||||
real libm errno cases 853 → 838). All scenario-defined counts and assertions are
|
||||
unchanged.
|
||||
- Aggregate caller coverage is 146,944 generated sequences / 7,168 whole-memory
|
||||
comparisons. Historical forward ABI coverage is 11,072 / 692; inverse remains
|
||||
8,576 / 134.
|
||||
|
||||
## Replay and window qualification
|
||||
|
||||
Player, headless runner, historical checker and all eleven native test targets
|
||||
build. All eleven native suites and twelve Python tooling tests pass, with every
|
||||
previous publication assertion enabled.
|
||||
|
||||
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
|
||||
frames. The ElectricArc return `1e77e8` is live: it runs natively 640 times on the
|
||||
one-player route and 864 times on the four-player route. Strict mode compares every
|
||||
native XYZ against the original leaf and reports no mismatch. Strict/default
|
||||
recordings and snapshots are byte exact. The FlatArcs return `1e7e08` is cold on
|
||||
these routes and is qualified by the generated owner suite above.
|
||||
|
||||
**One recorded difference, proven to be a dead W slot.** This applies the rule
|
||||
accepted for the [machine-gun increment](NATIVE_MACHINE_GUN_FORWARD.md). Against
|
||||
parent `c265cfd`, the four-player recording matches on every field. The one-player
|
||||
recording matches on every field except the end-of-frame RAM hash, which differs on
|
||||
391 of 9,500 frames (from frame 5,655), and the 32 MiB snapshot is identical.
|
||||
|
||||
- A RAM dump right after frame 5,655 shows exactly one differing word, `0x8ff36c`:
|
||||
the parent has `00000000`, the native build `ffffffff`.
|
||||
- A temporary logging build showed ElectricArc's output at `sp = 0x8ff360`, so the
|
||||
word is its dead frame `+0c` W slot.
|
||||
- The same temporary build wrote a NaN pattern into that slot after every
|
||||
ElectricArc transform. Over the full one-player route only the RAM hash differed
|
||||
from the parent: calls, draws, sound, thread state, EE timing and every count
|
||||
matched.
|
||||
|
||||
The experiment was not committed; the qualified binary was restored afterwards.
|
||||
|
||||
Fresh isolated window runs, started after the headless replays had finished,
|
||||
complete 6,500 one-player, 6,500 actual four-player and 4,200 movie frames.
|
||||
Reviewed captures show the intro and credits, menus, vehicle and level selection,
|
||||
driving with the HUD and four simultaneous views. Each route has five distinct
|
||||
captures. Stereo 48 kHz, 16-bit WAV recordings contain nonzero audio. Audio device
|
||||
underruns: 53.1 ms of silence in one-player, 41.5 ms in four-player and 15.9 ms in
|
||||
the movie run. These are functional checks, not a performance or flawless-playback
|
||||
claim. Flat arcs in actual play, full campaign and physical controller/hardware
|
||||
acceptance remain open.
|
||||
@@ -0,0 +1,52 @@
|
||||
# Native particles across scheduler continuations
|
||||
|
||||
During qualification of the vehicle/light direction changes, the 4P window stopped advancing at
|
||||
frame 4915. Its UI remained responsive because the game thread had raised an uncaught C++ exception
|
||||
and was waiting for the crash dialog. The crash stack reached the guarded `sceGsExecStoreImage`
|
||||
from a lens-flare helper dispatched directly by the scheduler. A fresh unchanged-main 4P window
|
||||
completed 6,501 frames, so the live trigger is timing-sensitive.
|
||||
|
||||
The original particle wrapper set `g_flaresNative` around a C++ call into generated `particleDraw`.
|
||||
A checkpoint can unwind that call before the lens helper runs. When the scheduler later enters the
|
||||
helper directly, the scope flag has already been cleared; the old branch executes the generated
|
||||
flare code and reaches the retired SDK readback. A flag tied to that C++ stack is not a durable
|
||||
native-backend selection. Host-time freshness was also unsuitable for selecting native effects
|
||||
and deciding whether native depth sampling was available after a long frame.
|
||||
|
||||
## Change
|
||||
|
||||
The normal native backend now selects the existing native flare test/render routines from its
|
||||
backend and explicit particle options, independently of that transient call scope. Native particle
|
||||
draw selection also survives a host-time gap. Native depth availability follows the enabled native
|
||||
renderer and explicit depth option; it no longer expires when the last match frame is over 100 ms
|
||||
old. Actual samples still come from the previous native renderer frame via `depthAt`; missing
|
||||
coverage retains the existing far-depth behavior.
|
||||
|
||||
No SDK image descriptor is decoded, no fake image or completion interrupt is added, and the SDK
|
||||
guard remains in place. Explicit legacy particle diagnostics retain their existing compatibility
|
||||
selection. BozoEngine stays at `4a8f70a`; this change is owned by TMB.
|
||||
|
||||
## Regression evidence and validation
|
||||
|
||||
Local artifacts are under `D:/BozoScratch/collision-directions`. The initial failed window log,
|
||||
scratch-user crash report, successful unchanged-main comparison, and `stall-runtime-evidence.json`
|
||||
are retained there. REA observation `ev_fe6c8e868562f51268869b7c3a7baf210ff7b424a388ecfcdc58767f026c3e91`
|
||||
records the waiting exception/dialog threads; `ev_9dffc412844e6e3efdc03fab1756e20be96683f4c5ad5e8242e036a0a737375b`
|
||||
records the selected process image/base and thread context. Their provider reports no artifact
|
||||
digest or OS/architecture identity, so executable attribution additionally uses the exact owned
|
||||
process path, crash report module offsets and the built executable's local symbol table. Both
|
||||
observations were ephemeral and detached; no live analysis session is retained.
|
||||
|
||||
`tmb-native-particle-tests` enters both native flare leaves without a live `particleDraw` scope or
|
||||
any recent frame marker. The old code fails by entering generated/runtime-service code. The fixed
|
||||
code passes eight test/render pairs across all four views, including visible and culled points,
|
||||
projection records, missing-depth behavior, visibility, complete native CPU ABI (including VU and
|
||||
clocks) and untouched legacy packet output. The leaf test does not claim GPU occlusion parity.
|
||||
|
||||
Final gameplay/movie/loading reruns and audio limits are recorded in
|
||||
[`NATIVE_DIRECTION_CONSUMERS.md`](NATIVE_DIRECTION_CONSUMERS.md). This is bounded regression coverage;
|
||||
full campaign, console visual parity and explicit legacy diagnostic modes are not qualified by it.
|
||||
|
||||
[Native particle-emission transforms](NATIVE_PARTICLE_EMISSION.md) subsequently retire five
|
||||
emitted-direction and emitter-coordinate helper returns. That increment preserves this
|
||||
backend selection and adds generated emission/metadata and emitter-coordinate consumer checks.
|
||||
@@ -0,0 +1,116 @@
|
||||
# Native particle-emission transforms
|
||||
|
||||
Five particle-emission helper returns now use native record calculations, extending
|
||||
the [suspension/tire increment](NATIVE_SUSPENSION_TIRE.md). Forward coverage grows
|
||||
from 68 to 70 sites and inverse coverage from 82 to 85. BozoEngine stays at `4a8f70a`.
|
||||
|
||||
| Helper / return PC | Owner | Consumer |
|
||||
| --- | --- | --- |
|
||||
| Forward `1da298` / `1e4818` | `particleEmit` (`1e4400`) | In-place direction used for emitted position and velocity XYZ |
|
||||
| Forward `1da298` / `1e42d8` | `utilUpdateEmitterMatrices` (`1e4298`) | Attached emitter offset, followed by scalar world/relative position construction |
|
||||
| Inverse `1da1e8` / `1e435c`, `1e43b4` | `utilUpdateEmitterMatrices` | Attached and unattached relative emitter positions |
|
||||
| Inverse `1da1e8` / `1e43c8` | `utilUpdateEmitterMatrices` | Relative emitter direction |
|
||||
|
||||
The existing forward calculation captures inputs before writes, computes XYZ and
|
||||
retains destination W. Its stack W outputs are unused by the real consumers. The
|
||||
inverse preserves exact XYZW, including meaningful basis[0].W. Neither native path
|
||||
transports VU registers, accumulator, flags or data memory. Historical hosts and
|
||||
unknown callers retain the complete original ABI.
|
||||
|
||||
Scalar matrix composition, attachment dispatch, RNG and range selection, particle
|
||||
position/velocity publication, bounds, lifetime and metadata remain compiled game
|
||||
code. The Burning Man emission variant and emitter movement contain no direct calls
|
||||
to these two transform helpers or inline VU arithmetic in the audited generated
|
||||
functions; they are not rewritten by this increment.
|
||||
|
||||
## Generated consumers and numerical checks
|
||||
|
||||
Local evidence is under `D:/BozoScratch/particle-emission`, against main `017908b`
|
||||
(PR #36). Generated game code, retail data, snapshots and captures stay outside Git.
|
||||
|
||||
- Added coverage is 2,560 consumer sequences / 128 whole-memory comparisons.
|
||||
Aggregate coverage reaches 64,512 / 2,080. Four host FP modes, denormal controls,
|
||||
RAM aliases, in-place direction outputs and arbitrary meaningful inverse-W
|
||||
payloads are covered. CPU outside retired VU, outgoing host FP effects,
|
||||
clocks/checkpoints and consumer memory match; native VU stays untouched.
|
||||
- Emission runs its complete real scalar tail through return. First and later
|
||||
particle slots, types 1/2/3/7/8/9, fixed and random lifetime ranges, bounds
|
||||
initialization/extension, spawn-time conversion and per-particle metadata are
|
||||
exercised. Position/velocity fourth components are real metadata and compared
|
||||
exactly. Only the unused forward-transform stack W is normalized, after all
|
||||
actual consumers finish.
|
||||
- Of the emission cases, 256 enter at `1e4714`, before the actual position/velocity
|
||||
range RNG branches, and execute the in-place transform through return. Random
|
||||
normalized-direction generation, timer-driven entry and additional loop
|
||||
iterations are outside this bounded fixture; gameplay exercises those paths.
|
||||
- Another 512 cases execute the complete emitter-coordinate function from entry,
|
||||
including all four attached/unattached and relative/world combinations, actual
|
||||
scalar matrix composition, both position paths and direction publication. The
|
||||
other new cases enter at individual helper boundaries and complete their tails.
|
||||
- Historical forward coverage grows to 3,904 / 244 cases / whole-memory checks;
|
||||
inverse coverage grows to 5,440 / 85. The hierarchy suite retains 786,432 helper
|
||||
cases / 384 whole-memory, 8,000 geometric edges, 1,024 complete recursive BSP
|
||||
callers / 32 whole-memory and 2,048 unknown ABI cases. The math suite retains
|
||||
1,048,576 / 512 and 2,048 unknown ABI cases.
|
||||
- Player, headless, historical checker and native test targets rebuild. All eleven
|
||||
native suites and twelve Python tooling tests pass. The final meaningful-W and
|
||||
in-place consumer additions also pass the rebuilt hierarchy suite.
|
||||
|
||||
## Gameplay, loading and movies
|
||||
|
||||
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
|
||||
frames. All non-RAM frame fields match the preceding main: scratchpad, calls/counts,
|
||||
draws/counts, sound/sample counts, threads and EE clock. The entire four-player
|
||||
recording matches baseline. One-player has one RAM-hash difference, at frame 8457;
|
||||
all other RAM hashes match. Full 32 MB snapshots at one-player frame 7000 and
|
||||
four-player frame 6000 are exact. Strict contact, hierarchy, math and projection
|
||||
checks pass; strict/default recordings and snapshots are identical. Default runs
|
||||
perform zero original comparisons and zero VU0 programs; strict intentionally
|
||||
executes original oracles.
|
||||
|
||||
An initial graphics-frame snapshot misses the transient hash point. A paired
|
||||
headless frame-boundary observer captures frame 8457 exactly: each dump's hash
|
||||
matches its qualified frame record, and each complete observer record prefix
|
||||
reproduces the qualified baseline/native route. The only changed word is
|
||||
`8ff38c`, attached-emitter output `SP+5c`: original writes inherited `VF16.w`
|
||||
bits `02000200`, native retains zero. The actual scalar matrix composition is
|
||||
independent of that temporary W; subsequent vector consumers read XYZ only.
|
||||
|
||||
Across 1,754 paired helper events near that frame, 12 writes at `1e42d8` show this
|
||||
difference. Another 39 at `1e4818` show emission output `SP+4c` (`8ff43c`) retaining
|
||||
`3f800000` from the real normalized-direction producer, where original writes
|
||||
`02000200`. Its position/velocity and metadata consumers also read only XYZ.
|
||||
That second temporary does not survive to the captured frame hash. No production
|
||||
mask or VU-state reconstruction is introduced. This is bounded unused-W evidence,
|
||||
not raw-RAM identity or console parity. Temporary runtime/headless sources are
|
||||
restored and all three original object hashes verified.
|
||||
|
||||
Forward returns `1e42d8` / `1e4818` execute 9,209 / 32,822 times in one-player and
|
||||
13,467 / 9,990 times in four-player: 42,031 / 23,457 new native executions overall.
|
||||
Total native forward counts become 1,102,044 / 283,936. The three new inverse sites
|
||||
remain cold in these routes; they have generated-consumer and complete emitter
|
||||
entry coverage. These are reached call counts, not measured speedups.
|
||||
|
||||
After observer removal, all eleven rebuilt suites pass again. Clean default/strict
|
||||
replays reproduce the same complete results above, and the player, headless and
|
||||
checker binaries contain no observer markers.
|
||||
|
||||
Fresh configured 4,200-frame movie/menu and 6,500-frame one-player / actual
|
||||
four-player windowed routes complete through clean exit, with isolated scratch
|
||||
user data. Reviewed captures show decoded movie pictures (1000), return to menu
|
||||
(1800), Junkyard loading (one-player 4500), active one-player gameplay (5500/6300)
|
||||
and four advancing snow-arena views with snow/tire effects (four-player 5500/6300).
|
||||
The windowed one-player / four-player runs reach 12,807 / 11,678 new native forward
|
||||
calls. All three stereo 48 kHz WAV recordings contain audio. Device logs report
|
||||
20.2 / 59.6 / 27.8 ms of silence (movie / one-player / four-player), with underruns
|
||||
and dropped frames. Deterministic gameplay sound matches; flawless device audio,
|
||||
subjective listening and full campaign/console parity are not claimed.
|
||||
|
||||
## Remaining scope
|
||||
|
||||
These two helper inventories now have 70 native forward and 85 native inverse
|
||||
sites. Outside their allowlists remain 199 forward and 49 inverse sites, 248 in
|
||||
total across the game, including sites inside otherwise replaced functions. This
|
||||
is a structural source inventory, not a live cost measurement, and excludes other
|
||||
helper families and inline VU operations. Full campaign acceptance and console
|
||||
visual/audio parity remain separate work.
|
||||
@@ -0,0 +1,101 @@
|
||||
# Native vehicle peel-out transform
|
||||
|
||||
The forward-transform return `1abd60` in `vehicleUpdatePeelingOut` (`1abb18`)
|
||||
now uses native record arithmetic, extending the
|
||||
[attractor-group increment](NATIVE_ATTRACTOR_GROUPS.md). Forward coverage grows
|
||||
from 79 to 80 sites; inverse coverage stays at 89. BozoEngine stays at `4a8f70a`.
|
||||
|
||||
The existing native helper snapshots its operands, computes separately rounded
|
||||
XYZ and retains destination W. Its result at `Vehicle+520` feeds the XYZ-only
|
||||
addition in `vehicleSetCsMat`; the coordinate-system position retains its own W.
|
||||
Native calls leave VU registers, accumulator, flags and data memory untouched.
|
||||
Historical hosts and unknown callers retain the complete original ABI. Peel-out
|
||||
selection, timer parity, steering, phase/amplitude updates, sine, smoothing and
|
||||
vehicle-pose publication remain compiled game code.
|
||||
|
||||
## Generated producer and consumer checks
|
||||
|
||||
Evidence is under `D:/BozoScratch/peel-out-transform`, against main `81d72db`
|
||||
(PR #40). Generated code, retail data, recordings and captures stay outside Git.
|
||||
|
||||
- Added coverage is 512 composed producer/consumer sequences / 32 whole-memory
|
||||
comparisons. Aggregate coverage is 71,680 / 2,464. Each case completes the
|
||||
peel-out tail and then the real generated `vehicleSetCsMat` consumer, including
|
||||
its production native matrix products and inline XYZ addition. Both reference
|
||||
and native producer runs use that production consumer; the separate vehicle
|
||||
suite qualifies the consumer against its original implementation.
|
||||
- 256 cases enter the actual peel-out function across 16 scenarios: inactive
|
||||
offsets, fast/smoothed decay, snap-to-zero, speed gates, reset/reuse, timer
|
||||
parity, steering direction, phase clamps and amplitude growth. The actual
|
||||
timer, bound-angle, smoothing and sine routines execute. Trigonometric inputs
|
||||
are bounded to half a radian; wider argument reduction is outside these fixtures.
|
||||
- Another 256 cases start at the helper boundary with signed zero, signed
|
||||
subnormals and positive/negative unit and fractional local offsets. Four host
|
||||
rounding modes, denormal controls, RAM aliases, coordinate-system/matrix
|
||||
aliases and arbitrary opaque W payloads are covered.
|
||||
- CPU outside retired VU state, outgoing host FP effects, clocks/checkpoints and
|
||||
final memory agree. Native VU stays untouched through the complete chain.
|
||||
Only the source `Vehicle+52c` W is excluded, after all real consumers run;
|
||||
an assertion restricts that exclusion to this exact word. No published pose
|
||||
component is excluded.
|
||||
- Historical forward coverage grows to 4,544 / 284 cases / whole-memory checks;
|
||||
inverse stays at 5,696 / 89. Existing hierarchy coverage retains 786,432 helper
|
||||
cases / 384 whole-memory, 8,000 geometric edges, 1,024 complete BSP callers /
|
||||
32 whole-memory and 2,048 unknown ABI cases.
|
||||
- Player, headless runner, historical checker and all test targets build.
|
||||
All eleven native suites and twelve Python tooling tests pass.
|
||||
|
||||
## Gameplay and RAM boundary
|
||||
|
||||
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
|
||||
frames. Strict/default recording files and full 32 MiB snapshots are identical.
|
||||
Every scratchpad, call, draw, sound, thread, count and EE-clock field matches the
|
||||
immediate parent. The four-player frame records and both sampled full RAM
|
||||
snapshots also match it exactly.
|
||||
|
||||
One-player RAM hashes differ on 664 frames, first 7,621 and last 8,765. A fresh
|
||||
passive observer reproduces the production recording and checks all 9,500 frames
|
||||
against the previous increment's qualified immediate-parent observer ledger.
|
||||
Replacing only the following four words on a diagnostic RAM copy reproduces
|
||||
every parent RAM hash, with zero unexplained differences:
|
||||
|
||||
| RAM word (`Vehicle+52c`) | Parent / native | Differing frames |
|
||||
| --- | --- | --- |
|
||||
| `26077c` | `02000200` / `00000000` | 9 |
|
||||
| `26617c` | `02000200` / `00000000` | 9 |
|
||||
| `268e7c` | `02000200` / `00000000` | 664 |
|
||||
| `25da7c` | `42700000` / `00000000` | 23 |
|
||||
|
||||
These reverse the [previously traced peel-out W writes](NATIVE_ATTRACTOR_GROUPS.md):
|
||||
the original producer borrowed `VF16.W`; the native producer retains destination
|
||||
W. The real coordinate-system consumer uses only XYZ. Both complete frame-record
|
||||
payloads now also match the older pre-attractor tow-truck baseline. No RAM mask
|
||||
or VU reconstruction ships. Temporary headless observer source and its original
|
||||
object were restored exactly; production binaries contain no observer markers.
|
||||
|
||||
The new site executes 3,890 / 7,374 times in headless one-player / four-player.
|
||||
Total native forward calls become 1,141,908 / 302,704. Default routes make zero
|
||||
original-helper comparisons and execute zero VU0 microprograms. These are
|
||||
coverage counts, not a measured speedup.
|
||||
|
||||
Fresh 6,500-frame one-player and actual four-player windowed routes and a
|
||||
4,200-frame movie/menu route complete through clean exit, using isolated scratch
|
||||
user data. Reviewed captures show decoded movie playback (1,000), return to menu
|
||||
(1,800), Junkyard loading (one-player 4,500), advancing one-player gameplay
|
||||
(5,500 / 6,300), and four advancing snow-arena views with snow/tire effects
|
||||
(four-player 5,500 / 6,300). The new site executes 1,809 / 3,510 times in windowed
|
||||
one-player / four-player; it is cold in the movie route. These checks establish
|
||||
bounded functionality, not pixel-exact windowed or console parity.
|
||||
|
||||
All three stereo 48 kHz WAV recordings contain audio. Device logs report
|
||||
26.6 / 62.8 / 31.4 ms of silence (movie / one-player / four-player), with underruns
|
||||
and dropped frames. Deterministic gameplay sound matches the parent; flawless
|
||||
device audio and subjective listening are not claimed.
|
||||
|
||||
## Remaining scope
|
||||
|
||||
These two helper inventories now contain 80 native forward and 89 native inverse
|
||||
sites. Outside their allowlists remain 189 forward and 45 inverse sites, 234 in
|
||||
total across the game. This is a structural inventory, not a live cost
|
||||
measurement, and excludes other helper families and inline VU operations.
|
||||
Full campaign acceptance and console visual/audio parity remain separate work.
|
||||
@@ -0,0 +1,81 @@
|
||||
# Native persistent-field forward transforms (last three)
|
||||
|
||||
The last three forward returns use native XYZ arithmetic after the
|
||||
[BlowDebris batch](NATIVE_BLOW_DEBRIS_FORWARD.md). Known forward coverage reaches
|
||||
**269 of 269 returns**; known inverse coverage stays 134 of 134. BozoEngine stays at
|
||||
`4a8f70a`. Every inventoried forward-transform (`mathfMulTransVec`, `1da298`) return
|
||||
is now native. Unknown and historical callers keep the original ABI.
|
||||
|
||||
Each of these writes a long-lived object field, not the stack:
|
||||
|
||||
| Return PC | Owner | Producer and consumer |
|
||||
| --- | --- | --- |
|
||||
| `14aff4` | `Launcher::FireSpecial`, type `1a0` | The horn push in frame `+30` goes through the vehicle basis copied to `+190` into the vehicle's velocity `+1e0`. Nothing reads it before the horn sound and the owner's return |
|
||||
| `112524` | `BurnMan::Spawn` | The spawn offset in frame `+10` goes through the new pedestrian's coordinate system into its position (`cs +10`). `mathfAddVector` adds the vehicle position (the output is its first operand); the grid reparent and later updates read it as XYZ |
|
||||
| `117710` | `Vehicle::collisCheapTires` (free fall) | The tire offset in frame `+0` goes through the plane matrix at frame `+10` into tire 0's `+50`. `smoothEasyIn` reads its three components as scalars |
|
||||
|
||||
An audit looked for readers of each field's W anywhere in the generated code:
|
||||
|
||||
- **Vehicle velocity W (`+1ec`):** no 32-bit load has a vehicle base, there are no
|
||||
64-bit loads at `+1e8`, and every place that passes `+1e0` on reads XYZ only.
|
||||
`vehicleUpdatePosition` rewrites the whole field with a 128-bit store each frame
|
||||
before reading it.
|
||||
- **Pedestrian position (`cs +1c`):** `hierInitCs` never writes it, and the hierarchy
|
||||
update (native here) ignores it. `requestScream` copies the whole position into a
|
||||
streaming-sound slot, but that slot's W (`+3c`) has no reader: the sound code reads
|
||||
the position only as XYZ.
|
||||
- **Tire offset (`+5c`):** no reader of `+5c` on a tire, or of the absolute offsets
|
||||
of the four tires.
|
||||
|
||||
The owners read no VU registers, accumulator or flags after these calls. The native
|
||||
helper computes separately rounded XYZ, preserves destination W and leaves VU state
|
||||
untouched. No engine or gameplay formula changes.
|
||||
|
||||
## Generated comparisons
|
||||
|
||||
Evidence is under `D:/BozoScratch/persistent-forward`, against parent `363eb61`
|
||||
(PR #91). Parent headless/window binaries are preserved there and match PR #91's
|
||||
qualified build. Generated bodies, retail data and runtime recordings stay outside
|
||||
Git.
|
||||
|
||||
- Added coverage is 1,536 generated sequences / 96 whole-memory comparisons (caller
|
||||
kinds 371 to 373). They are helper-boundary continuations and entries at the
|
||||
call-return label before each transform (`14afd8`, `1124ec`, `117700`), across
|
||||
four rounding modes, FTZ/DAZ, RAM aliases, identity/quarter-turn bases and
|
||||
arbitrary W payloads.
|
||||
- Each run stops at the first consumer after the result: the horn sound,
|
||||
`hdReparentCsGrid` and `smoothEasyIn`. The velocity and tire results are read
|
||||
back from their fields at the stop. The pedestrian's position (output plus
|
||||
vehicle position) is asserted exactly against the original FPU arithmetic.
|
||||
Publications: 512 for each site.
|
||||
- Every basis is fixture-known, so every site is checked against an independent
|
||||
identity or quarter-turn result. Only the forward W of each field (`+1ec`, `cs
|
||||
+1c`, tire `+5c`) is normalized for test comparison, after every real consumer.
|
||||
- New caller kinds shift the shared random fill for later rounding modes, so two
|
||||
data-dependent counts in earlier fixtures moved (vehicle tire jumps 709 → 712,
|
||||
real libm errno cases 819 → 842). All scenario-defined counts and assertions are
|
||||
unchanged.
|
||||
- Aggregate caller coverage is 191,488 generated sequences / 9,952 whole-memory
|
||||
comparisons. Historical forward ABI coverage is 16,640 / 1,040; inverse remains
|
||||
8,576 / 134.
|
||||
|
||||
## Replay and window qualification
|
||||
|
||||
Player, headless runner, historical checker and all eleven native test targets
|
||||
build. All eleven native suites and twelve Python tooling tests pass, with every
|
||||
previous publication assertion enabled.
|
||||
|
||||
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
|
||||
frames. Every recording field matches parent `363eb61`, including the RAM hash on
|
||||
every frame: scratchpad, calls, draws, sound, thread state and EE timing/counts.
|
||||
Sampled 32 MiB RAM images are identical. Strict/default recordings and snapshots
|
||||
are byte exact; strict comparisons report no mismatch. `112524` (BurnMan spawn) is live on the one-player route: it runs natively once with no recorded difference. `14aff4` and `117710` are cold on these routes and are qualified by the generated owner suite above.
|
||||
|
||||
Fresh isolated window runs, started after the headless replays had finished,
|
||||
complete 6,500 one-player, 6,500 actual four-player and 4,200 movie frames.
|
||||
Reviewed captures show the intro and credits, menus, vehicle and level selection,
|
||||
driving with the HUD and four simultaneous views. Each route has five distinct
|
||||
captures. Stereo 48 kHz, 16-bit WAV recordings contain nonzero audio. Audio device
|
||||
underruns: 49.8 ms of silence in one-player, 7.5 ms in four-player and 0.0 ms in
|
||||
the movie run. These are functional checks, not a performance or flawless-playback
|
||||
claim. Full campaign and physical controller/hardware acceptance remain open.
|
||||
@@ -0,0 +1,98 @@
|
||||
# Native point-contact, ray and root helper transforms
|
||||
|
||||
Eleven further hierarchy returns use the existing native record calculations. Three inverse
|
||||
and eight forward additions bring the allowlists to fifty-three and fifty-two entries.
|
||||
This extends the [older BSP increment](NATIVE_LEGACY_BSP_HELPERS.md). BozoEngine stays at
|
||||
`4a8f70a`; no engine or renderer change is included.
|
||||
|
||||
| Helper | Return PCs | Owner |
|
||||
|---|---|---|
|
||||
| Inverse `1da1e8` | `1c4fe0` | Coordinate-system collision setup `1c4ec0` |
|
||||
| Inverse `1da1e8` | `1c51dc`, `1c53b4` | Older hierarchy roots `1c50a0` |
|
||||
| Forward `1da298` | `1c8094`, `1c80ac` | Point-contact result normal `1c7eb0` |
|
||||
| Forward `1da298` | `1c8120`, `1c8150` | Point-contact result position `1c7eb0` |
|
||||
| Forward `1da298` | `1c85cc`, `1c85e0` | Ray result normal `1c8280` |
|
||||
| Forward `1da298` | `1c8608`, `1c863c` | Ray result position `1c8280` |
|
||||
|
||||
Native leaves snapshot operands before overlapping writes, retain separately rounded XYZ
|
||||
arithmetic and leave VU registers, accumulator, flags and data memory untouched. Inverse XYZW
|
||||
matches the original, including meaningful basis[0].W. Forward XYZ matches while destination W
|
||||
is preserved. Historical hosts and unknown callers retain the full original helper ABI.
|
||||
Scalar contact reconstruction, world sums, result packing, traversal dispatch, clocks and
|
||||
checkpoints remain compiled game code. Other helper returns and inline VU operations remain;
|
||||
this is not complete VU removal.
|
||||
|
||||
## Generated consumers and numerical checks
|
||||
|
||||
Local evidence is under `D:/BozoScratch/hierarchy-point-ray`, against main `e7cdaff` (PR #30).
|
||||
Generated game code, disc data, recordings, RAM dumps and captures are excluded from the commit.
|
||||
|
||||
- The consumer harness grows from 33,280 to 38,912 sequences and from 1,040 to 1,216 whole-memory
|
||||
comparisons (5,632 / 176 added). Four host FP modes, denormal controls, RAM aliases and arbitrary
|
||||
W payloads are covered. CPU outside retired VU, outgoing host FP effects, clocks/checkpoints and
|
||||
other memory match exactly; native VU remains untouched.
|
||||
- Point-contact continuations retain the selected plane distance, scalar contact reconstruction,
|
||||
offset subtraction, paired normal/position transforms, world-space addition, packed material/
|
||||
flags and return. Both indexed and single-result modes are covered, with four result slots and
|
||||
direct-node versus inherited material metadata.
|
||||
- Ray continuations retain selected endpoint subtraction, paired normal/position transforms,
|
||||
world-space addition, metadata publication and return, including stack-owned inputs and four
|
||||
selected point offsets/result slots. These are real result tails, not complete query-root tests.
|
||||
- Coordinate-system/root continuations run real packed matrix-stack setup into the actual
|
||||
traversal-push boundary. Child traversal and callbacks remain outside those fixtures.
|
||||
- Reference forward W and VU effects stay live throughout real consumers. Only final unused
|
||||
forward-output W is normalized afterward; a later inverse write retires that exclusion so
|
||||
meaningful inverse W stays compared exactly. No production arithmetic or W contract changes.
|
||||
- Historical forward checks grow to 2,752 cases / 172 whole-memory comparisons (512 / 32 added).
|
||||
Historical inverse checks cover all fifty-three returns: 3,392 cases / 53 whole-memory comparisons.
|
||||
The hierarchy suite retains 786,432 helper cases, 384 whole-memory checks, 8,000 geometric edges,
|
||||
1,024 recursive BSP callers / 32 whole-memory checks and 2,048 unknown-caller ABI cases.
|
||||
- The math suite retains 1,048,576 helper cases, 512 whole-memory checks and 2,048 unknown-caller
|
||||
ABI cases, including overlap, alignment, aliases and scratchpad coverage.
|
||||
- Player, headless and historical checker builds, all eleven native suites and twelve Python
|
||||
tooling tests pass.
|
||||
|
||||
## Gameplay, loading and movies
|
||||
|
||||
Default and strict routes complete 9,500 one-player and 8,500 actual four-player frames. Strict
|
||||
contact, hierarchy, math and projection checks pass; strict/default recordings and snapshots
|
||||
are byte-identical. Every non-RAM frame-record field matches baseline throughout: scratchpad,
|
||||
calls/counts, draws/counts, sound/sample counts, thread state and EE clock. Four-player's entire
|
||||
recording and frame-6000 snapshot also match baseline byte-for-byte. Default runs perform zero
|
||||
original comparisons and zero VU0 microprogram calls.
|
||||
|
||||
One-player executes inverse return `1c53b4` 2,047 times and all eight new forward returns 528
|
||||
times combined. Returns `1c4fe0` and `1c51dc` have generated-consumer/historical-ABI coverage
|
||||
without a live-route claim. Four-player reaches none of the eleven new sites. This retires
|
||||
another 2,575 original helper executions in the one-player route; it is a count, not a timing
|
||||
or FPS measurement.
|
||||
|
||||
One-player RAM hashes differ on 3,047 frames, first at 5810 and last at 9499. The complete
|
||||
32 MB frame-7000 snapshot differs by 46 bytes in 23 fourth-component words: twelve records at
|
||||
`4062ec..40639c`, ten at `406e0c..406e9c`, and stack word `8fefdc`. Baseline words are zero;
|
||||
native words contain `42700000`. Paired observers identify all their writes in the existing
|
||||
original forward helper, at debris callers `120838`, `1208dc` and `1209a0`. All 44 watched
|
||||
forward calls pair at identical cycles; 32 differing stores cover exactly those 23 addresses.
|
||||
They store inherited VF16.W. The retired root inverse at `1c53b4` used to overwrite VF16.W;
|
||||
the native inverse leaves VU untouched while retaining exact meaningful output XYZW.
|
||||
|
||||
The global fields belong to debris velocity records. The compiled debris update consumes
|
||||
their XYZ at offsets `120`, `124`, `128`, with no fourth-component numerical input in that
|
||||
update. The intermediate stack forward at `1208dc` similarly feeds scalar XYZ position sums.
|
||||
These debris callers remain outside the native allowlist and retain their original complete
|
||||
ABI. Both observer recordings and snapshots reproduce the qualified baseline/native files
|
||||
exactly. This is bounded source/write/snapshot evidence, not a classification of every RAM
|
||||
difference or possible campaign consumer.
|
||||
|
||||
Observers were removed and restored sources forced to rebuild. Both native math/hierarchy
|
||||
objects match their original qualified hashes, and all three executables contain no observer
|
||||
markers. All eleven native suites pass again. Final clean default replays reproduce both
|
||||
complete qualified recordings and snapshots byte-for-byte. No padding restoration, hash mask
|
||||
or shadow VU state is shipped.
|
||||
|
||||
Fresh windows run the configured 4,200-frame movie/menu route and 6,500-frame one-player and
|
||||
actual four-player routes through clean exit. Reviewed captures show decoded movie pictures,
|
||||
Junkyard loading and active rainy gameplay, and four advancing snow-arena views. Device logs
|
||||
report 18.1 / 52.6 / 35.4 ms of silence (movie / one-player / four-player), with underruns and
|
||||
dropped frames. Deterministic sound matches. Flawless device audio, full campaign acceptance
|
||||
and console visual parity remain unclaimed.
|
||||
@@ -0,0 +1,68 @@
|
||||
# Native projection and weather helpers
|
||||
|
||||
This increment replaces `mathfMulVec4x4` (`1da238`) at the audited returns `1dc438`
|
||||
(`mathfTransform3dTo2d`) and `1e8cfc` (`particleUpdateRainViewport`). It also replaces
|
||||
`mathfUnitMatrixAsm` (`1db0f0`) at the weather path's identity return `1e8c48`.
|
||||
Other callers and the historical checker retain the original complete ABI. Engine `4a8f70a` is unchanged.
|
||||
|
||||
The point helper takes ordinary matrix/point records and writes all four numerical output components.
|
||||
Input W is ignored; each matrix row's fourth component is its translation. Separately rounded products
|
||||
and cyclic reduction order are retained: `a+(b+(c+d))`, `b+(c+(d+a))`, `c+(d+(a+b))`, `d+(a+(b+c))`.
|
||||
Inputs are snapped before output writes, including overlap. The identity path writes a native identity
|
||||
record and the constant CPU ABI results previously returned alongside it.
|
||||
|
||||
Neither path reads or changes VU registers, accumulator, flags or data memory. Host FP control is
|
||||
restored completely. Explicit `TMB_NATIVE_PROJECTION_CHECK=1` runs the original generated leaf on a
|
||||
copied context and compares the complete output record; normal player runs do not execute that oracle.
|
||||
|
||||
## Validation
|
||||
|
||||
Evidence: `D:/BozoScratch/math-helpers`, against main `a415f42`, with the same disc, engine, build and input
|
||||
scripts. Agent runs use private user directories. These are functional checks with no timing claim.
|
||||
|
||||
- `tmb-native-projection-tests` passes 786,432 original/native helper cases across four host FP modes,
|
||||
bounded values, arbitrary bit patterns, denormal/extended values, overlap, RAM aliases, low address
|
||||
bits and scratchpad. There are 192 complete flat-memory helper comparisons. CPU ABI, preserved VU
|
||||
state and complete restored MXCSR are checked.
|
||||
- 2,048 generated caller cases cover complete `mathfTransform3dTo2d`, including null-pointer bypasses,
|
||||
actual view getters, perspective division and output writes; and the active weather continuation
|
||||
from `1e8c50` through scalar matrix setup, projection, depth adjustment and epilogue. Another 64
|
||||
complete flat-memory comparisons cover these cases. This is not a whole-weather-function fixture.
|
||||
- 4,096 fallback cases check unknown callers and the historical host's complete original ABI. Another
|
||||
1,024 actual helper/consumer sequences reproduce the padding chain below. The same suite also passes
|
||||
with the strict copied-context oracle enabled, including the identity helper's diagnostic path.
|
||||
- All seven native suites and 12 release-tool tests pass; player, headless and historical checker build.
|
||||
- Default 1P (9,500 frames) and actual 4P (8,500) match main on every draw hash/count, sound hash/sample
|
||||
count, library call field, EE clock, scratchpad and thread record. Separate strict/default recordings
|
||||
are byte-identical. RAM differences are bounded below; no hash mask is widened.
|
||||
- The native point path executes 58,574 screen / 5,560 weather transforms in 1P and 114,110 / 15,192 in
|
||||
4P. Strict runs perform 64,134 / 129,302 original point comparisons. The owned identity return has
|
||||
zero live hits in these routes: its native and diagnostic coverage is fixture-only. Other identity
|
||||
callers still execute their original implementation. Default VU0 program counts remain zero.
|
||||
- Windowed movie/menu (4,201 frames) and 1P/4P (6,501 each) complete through loading. Direct capture
|
||||
inspection covers decoded movies, readable loading, arena vehicles/effects, targeting labels/health
|
||||
bars and four snowy views. These are bounded smoke checks, not console or pixel parity.
|
||||
Device logs retain dropped frames and 24.8 / 55.0 / 21.8 ms of silence; deterministic sound is exact,
|
||||
without a flawless-device-audio or subjective listening claim.
|
||||
|
||||
## RAM boundary and remaining work
|
||||
|
||||
RAM hashes differ on 1P frames `6998..7026` (29 frames) and 4P frames `4730..8499` (3,770 frames).
|
||||
The checked 32 MB snapshots isolate one differing word at 1P frame 7,000 (`26077c`), and two at 4P
|
||||
frame 6,000 (`25da7c`, `26077c`), with no other differences. These are `Vehicle+52c`, W of its peeling-out
|
||||
offset at `+520`.
|
||||
|
||||
The original projection leaves its fourth result in VF16.W. The unconverted direction helper `1da298`,
|
||||
called from `vehicleUpdatePeelingOut` at return `1abd64`, calculates XYZ but stores that old VF16.W too.
|
||||
The native vehicle offset consumer at `1ab29c..1ab2a8` reads XYZ only and preserves its destination W.
|
||||
The sequence fixture executes the actual original/native projection, the original direction ABI and
|
||||
the production native vehicle consumer: the offset's W is the sole differing memory word, while XYZ
|
||||
and the consumed output remain identical. No artificial VF16 or padding restoration is added.
|
||||
|
||||
This evidence bounds the checked snapshots/dataflow, not all possible campaign consumers. Other VU
|
||||
macro helper callers, scalar packet builders and legacy graphics buffers/extents remain separate work.
|
||||
The published player release and engine pin are not changed by this source increment.
|
||||
|
||||
[`NATIVE_WEATHER_VIEWPORT.md`](NATIVE_WEATHER_VIEWPORT.md) subsequently retires the
|
||||
viewport's forward transform and qualifies complete entries through its existing
|
||||
native identity/projection branches, including fade/fog and grid-placement consumers.
|
||||
@@ -0,0 +1,87 @@
|
||||
# Native ricochet forward transforms
|
||||
|
||||
[Launcher turret-aim forwards](NATIVE_LAUNCHER_AIM_FORWARD.md) follow with three launcher sites.
|
||||
|
||||
Two `Weapon::UpdateRicoTrans` (`1b2ee0`) forward returns use native XYZ
|
||||
arithmetic after the [weapon lock-on, satellite and rock forwards](NATIVE_WEAPON_LOCK_FORWARD.md).
|
||||
Known forward coverage grows from 137 to 139 of 269 returns (130 remain). Known
|
||||
inverse coverage stays 134 of 134; BozoEngine stays at `4a8f70a`.
|
||||
|
||||
| Return PC | Producer and consumer |
|
||||
| --- | --- |
|
||||
| `1b2fb0` | Per-frame velocity through the weapon basis, in place, added to the ricochet position before its height test; the stack vector then receives the height-test normal and is read by `Weapons::ComputeReflection` |
|
||||
| `1b3118` | Speed vector through the basis the owner rebuilt from the reflected direction, added to the ricochet position |
|
||||
|
||||
Both results are the owner's stack vector at frame `+0`, read only as XYZ:
|
||||
`mathfAddVector` (`1daef0`), `hdHatTest` (which writes only XYZ into it), and
|
||||
`ComputeReflection` (`1b7200`), whose subtract, normalize and dot-product helpers
|
||||
are scalar. The owner never reads frame `+0c`, and reads no VU registers,
|
||||
accumulator or flags. The existing native helper computes separately rounded XYZ,
|
||||
preserves destination W and leaves VU state untouched. Unknown and historical
|
||||
callers keep the original ABI. No engine or gameplay formula changes.
|
||||
|
||||
`Weapon::RockHD` (`1b6cd8`, `1b6d3c`) was examined and left on the original path:
|
||||
its transformed point is handed to `hdPntSphereTest`, which publishes the pointer
|
||||
to the `hdHier` hierarchy traversal. That consumer needs its own audit.
|
||||
|
||||
## Generated comparisons
|
||||
|
||||
Evidence is under `D:/BozoScratch/ricochet-forward`, against parent `4d863cd`
|
||||
(PR #57). Parent headless/window binaries are preserved there and match PR #57's
|
||||
manifest. Generated bodies, retail data and runtime recordings stay outside Git.
|
||||
|
||||
- Added coverage is 1,024 generated sequences / 64 whole-memory comparisons
|
||||
(caller kinds 242 and 243): helper-boundary continuations and full-owner
|
||||
entries, across four rounding modes, FTZ/DAZ, RAM aliases, identity/quarter-turn
|
||||
bases and arbitrary W payloads.
|
||||
- Full entries execute the real height test and, when the resulting height is
|
||||
low, the real reflection branch: `ComputeReflection`, `mathfRotationFromVector`
|
||||
and `mathfRotMatrixPH` rebuild the basis before the second transform. The
|
||||
frame-count-zero scenario skips that branch. Producer reach is asserted for
|
||||
both sites in every case.
|
||||
- Transform inputs and outputs are captured at the real helper and
|
||||
`mathfAddVector` boundaries. Where the fixture knows the basis (the first site,
|
||||
and second-site helper-boundary cases), the output is checked against an
|
||||
independent identity or quarter-turn result; the owner-rebuilt basis is covered
|
||||
by the native/original comparison. The published point is asserted exactly
|
||||
against the original FPU addition: X/Y at `hdHatTest` (Z is lifted for the
|
||||
test) and the final position after the second transform. The first site
|
||||
publishes in 768 cases, the second in 960.
|
||||
- The VU rule from the previous increment applies: exact outside the original
|
||||
leaf's write set; inside it, the original's later write or the native leaf's
|
||||
entry value. Only forward scratch W at frame `+0c` is normalized for test
|
||||
comparison, after every real consumer.
|
||||
- The particle effect paths of the ricochet's launch state stay on the original
|
||||
path and are not reached by these fixtures.
|
||||
- The fixture fix also restores a satellite setup line from PR #57 that a
|
||||
misplaced comment had disabled (`vehicle+0x2370` now gets its fixed point
|
||||
instead of fill data). All earlier counts and assertions are unchanged.
|
||||
- Aggregate caller coverage is 124,928 generated sequences / 5,792 whole-memory
|
||||
comparisons. Historical forward ABI coverage is 8,320 / 520; inverse remains
|
||||
8,576 / 134.
|
||||
|
||||
## Replay and window qualification
|
||||
|
||||
Player, headless runner, historical checker and all eleven native test targets
|
||||
build. All eleven native suites and twelve Python tooling tests pass, with every
|
||||
previous publication assertion enabled.
|
||||
|
||||
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
|
||||
frames. Every recording field matches parent `4d863cd`: raw RAM, scratchpad,
|
||||
calls, draws, sound, thread state and EE timing/counts. Sampled 32 MiB RAM images
|
||||
are identical. Strict/default recordings and snapshots are byte exact; strict
|
||||
comparisons report no mismatch. The first ricochet return `1b2fb0` is live: it runs
|
||||
natively 319 times on the one-player route with no recorded difference (the rock's
|
||||
`1b3ef8` still runs 1,569 times, also exact). The reflection-branch return `1b3118`
|
||||
is cold on these routes and is qualified by the generated owner suite above.
|
||||
|
||||
Fresh isolated window runs complete 6,500 one-player, 6,500 actual four-player
|
||||
and 4,200 movie frames; `1b2fb0` runs natively 67 times in the one-player window.
|
||||
Reviewed captures show the intro and credits, menus, vehicle and level selection,
|
||||
driving with the HUD and four simultaneous views. Each route has five distinct
|
||||
captures. Stereo 48 kHz, 16-bit WAV recordings contain nonzero audio.
|
||||
|
||||
Audio device underruns remain: 55.9 ms silence in one-player, 40.7 ms in
|
||||
four-player and 18.0 ms in the movie run. These are functional checks, not a
|
||||
performance or flawless-playback claim. A visible ricochet bounce off a wall, full
|
||||
campaign and physical controller/hardware acceptance remain open.
|
||||
@@ -0,0 +1,106 @@
|
||||
# Native rigid-body forward transforms
|
||||
|
||||
Ten rigid-body forward returns now use native record arithmetic, after
|
||||
[completion of the known inverse sites](NATIVE_FINAL_INVERSES.md).
|
||||
Forward coverage grows from 96 to 106 of 269 returns; inverse coverage stays
|
||||
134 of 134. BozoEngine stays at `4a8f70a`.
|
||||
|
||||
| Return PC | Owner | Qualified consumer |
|
||||
| --- | --- | --- |
|
||||
| `1ed478` | `applyLocalForce(force)` | World-force accumulator |
|
||||
| `1ed4c4`, `1ed4dc` | `applyLocalForce(force, point)` | Force and point transforms, world-force and torque accumulators |
|
||||
| `1ed544`, `1ed55c` | `applyLocalTorque(force, point)` | World torque and angular-state consumers |
|
||||
| `1ed708` | `applyLocalImpulse(impulse)` | Momentum and linear velocity |
|
||||
| `1ed754`, `1ed76c` | `applyLocalImpulse(impulse, point)` | Linear/angular momentum, meaningful inverse result and angular velocity |
|
||||
| `1edf38` | `resolveForces` | Integrated coordinate-system position |
|
||||
| `1ee07c` | `computeX` | Published world position and point velocity |
|
||||
|
||||
Forward arithmetic is unchanged: native calls calculate separately rounded XYZ,
|
||||
retain destination W and leave VU registers, accumulator, flags and data memory
|
||||
untouched. Original scalar consumers use XYZ. Unknown callers and historical
|
||||
hosts retain the original full ABI. No engine or integration formula is changed.
|
||||
|
||||
## Generated-code comparisons
|
||||
|
||||
Evidence is under `D:/BozoScratch/rigid-body-forward`, against main `79acf14`
|
||||
(PR #50). Generated code, retail data, recordings and captures stay outside Git.
|
||||
|
||||
- Added coverage is 5,120 generated sequences / 320 whole-memory comparisons.
|
||||
Aggregate coverage is 108,032 / 4,736. Each return has 256 helper-boundary cases
|
||||
through its actual tail and 256 complete owner entries. Four rounding modes,
|
||||
denormal controls, RAM aliases, rotated bases, zero/nonzero vectors, signed
|
||||
forces, zero/nonzero inverse mass and source aliases with momentum/position
|
||||
records are covered. Whole-memory entry samples reach active transforms.
|
||||
- Complete force/torque entries execute both transforms where present, actual
|
||||
world-point translation, world-force accumulation, point subtraction, cross
|
||||
product and torque accumulation. Impulse entries also execute actual momentum
|
||||
addition, mass scaling and the existing native inverse angular-velocity leaf.
|
||||
Explicit per-site counts and world-consumer counts are required.
|
||||
- Complete `resolveForces` entries retain skew-matrix construction, scalar matrix
|
||||
operations and their store/alias order, orthonormalization, momentum updates,
|
||||
actual `computeAuxiliarys`, the final forward and coordinate-system position
|
||||
subtraction. Zero and nonzero time steps run. The original matrix/integration
|
||||
behavior is compared directly; a guessed integration equation is not substituted.
|
||||
- `computeX` entries execute the actual local-to-world position publication.
|
||||
Every new case then reads the resulting body state through the real
|
||||
`getPointVelocity`, including its position subtraction, angular cross product
|
||||
and linear-velocity addition. This happens before any comparison-only W
|
||||
normalization.
|
||||
- Known simple entries require exact force/torque accumulation, momentum and
|
||||
linear/angular velocity publication with identity/rotated bases. Zero-step
|
||||
integration must preserve the seeded momenta. Computed world points must equal
|
||||
known translated positions. These assertions supplement original/native
|
||||
comparisons; they do not replace the original scalar consumers.
|
||||
- The only opaque forward W locations are the actual owner's stack `SP+0c`,
|
||||
`SP+1c`, integration scratch `SP+7c`, or `RigidBody+4c` for `computeX`.
|
||||
Helper-boundary and complete-entry stack bases differ by their real frame sizes;
|
||||
exact output counts and allowed addresses are asserted. Reference W remains
|
||||
intact through all real consumers, including point velocity, then is normalized
|
||||
for comparison only. Meaningful inverse W is never excluded. No runtime RAM
|
||||
mask or VU-state reconstruction is introduced.
|
||||
- CPU outside retired VU, host FP effects, clocks/checkpoints, per-site forward
|
||||
counts, world/action counts and final memory agree. Native VU stays untouched
|
||||
through the complete consumers.
|
||||
- Historical forward ABI coverage grows to 6,208 cases / 388 whole-memory checks;
|
||||
inverse stays at 8,576 / 134. Existing coverage retains 786,432 hierarchy helper
|
||||
cases / 384 whole-memory, 8,000 geometric edges, 1,024 complete BSP callers /
|
||||
32 whole-memory and 2,048 unknown ABI cases. Previous AI, vehicle/light and final
|
||||
inverse publication assertions remain enabled.
|
||||
|
||||
## Replay and window qualification
|
||||
|
||||
Player, headless runner, historical checker and all eleven native test targets
|
||||
build. All eleven native suites and twelve Python tooling tests pass. Earlier
|
||||
AI, vehicle/light and final-inverse publication assertions remain enabled.
|
||||
|
||||
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
|
||||
frames. Every recorded field matches the immediate parent: raw RAM, scratchpad,
|
||||
calls, draws, sound, thread state and EE timing/counts. Sampled 32 MiB RAM images
|
||||
are identical. Strict/default recording files and snapshots are byte exact;
|
||||
strict comparisons report no mismatch.
|
||||
|
||||
One-player reaches `resolveForces` 738 times and `computeX` ten times. The eight
|
||||
local force/torque/impulse sites are cold on these replay routes, and four-player
|
||||
makes no calls to the ten new forward returns. Those local paths are qualified
|
||||
by complete generated entries and their scalar state consumers, not claimed as
|
||||
runtime route coverage.
|
||||
|
||||
Fresh isolated window runs complete 6,500 one-player, 6,500 actual four-player
|
||||
and 4,200 movie frames. Reviewed captures show level loading, advancing driving,
|
||||
AI opponents, combat/effects, four simultaneous views, decoded intro images and
|
||||
return to the menu. Each route has five distinct captures.
|
||||
|
||||
Windowed 1P reaches `resolveForces` 583 times and `computeX` four times; the other
|
||||
eight new sites remain cold. Four-player and movies make no calls to these ten
|
||||
sites. Stereo 48 kHz, 16-bit WAV captures contain nonzero audio. Device underruns
|
||||
remain: 50.5 ms silence in 1P, 132.8 ms in 4P and 20.7 ms in movies. These runs
|
||||
are functional checks, not a timing or flawless-playback claim. Full campaign,
|
||||
every rigid-body configuration and physical-controller/hardware acceptance
|
||||
remain outside this increment.
|
||||
|
||||
## Remaining scope
|
||||
|
||||
There are 163 forward returns outside the native allowlist, with no known static
|
||||
inverse return remaining. Other inline arithmetic, remaining hierarchy/VU helpers
|
||||
and historical/unknown ABI support remain separate work. This is a call-site
|
||||
inventory, not a count of all remaining emulation.
|
||||
@@ -0,0 +1,113 @@
|
||||
# Native rigid-body inverses
|
||||
|
||||
Seven rigid-body inverse-transform returns now use native record arithmetic,
|
||||
extending the [collision/drift increment](NATIVE_COLLISION_DRIFT_INVERSES.md).
|
||||
Inverse coverage grows from 105 to 112 sites; forward coverage stays at 95.
|
||||
BozoEngine stays at `4a8f70a`.
|
||||
|
||||
| Return PC | Owner | Result and consumers |
|
||||
| --- | --- | --- |
|
||||
| `1ed6c4` | `RigidBody::applyWorldImpulse` with application point | Published angular velocity, then real point velocity |
|
||||
| `1ed8ec`, `1ed92c` | Two-body `resolveCollision` | Cross/dot products, impulse magnitude and both bodies' impulses |
|
||||
| `1edaec`, `1edc04` | Fixed-surface `resolveCollision` | Normal impulse, tangent normalization, friction choice and friction impulse |
|
||||
| `1edd94` | Moving-surface `resolveCollision` | Relative velocity, impulse magnitude and impulse application |
|
||||
| `1ee030` | `RigidBody::computeAuxiliarys` | Published angular velocity, then real point velocity |
|
||||
|
||||
The existing native inverse snapshots its operands, computes separately rounded
|
||||
XYZ and copies the first basis column's W as data. All four output components
|
||||
remain exact. Native calls leave VU registers, accumulator, flags and data memory
|
||||
untouched. Historical hosts and unknown callers retain the full original ABI.
|
||||
Scalar inertia/matrix production, collision decisions, cross/dot products,
|
||||
friction and impulse application remain generated game code.
|
||||
|
||||
## Generated-code comparisons
|
||||
|
||||
Evidence is under `D:/BozoScratch/rigid-body-inverses`, against main `a36c634`
|
||||
(PR #45). Generated code, retail data, recordings and captures stay outside Git.
|
||||
|
||||
- Added coverage is 3,584 sequences / 224 whole-memory comparisons. Aggregate
|
||||
coverage is 91,136 / 3,680. Four host rounding modes, denormal controls,
|
||||
cached/uncached RAM aliases and arbitrary first-basis W payloads are covered.
|
||||
- Each site has 256 inverse-boundary cases through its real return and 256
|
||||
complete generated function entries. The 1,792 entries include 1,472 reached
|
||||
inverse paths and 320 separating-contact/small-speed rejection paths.
|
||||
Per-site original/native call counts distinguish those paths explicitly.
|
||||
- World-impulse entries run actual momentum addition, scaling, lever-arm cross
|
||||
products and angular velocity publication. Auxiliary entries run the actual
|
||||
inertia/matrix producer. Both feed the published velocity through the real
|
||||
`getPointVelocity` function, including its lever-arm cross/add consumer.
|
||||
- Two-body collision entries apply impulses to both bodies. Fixed-surface
|
||||
entries exercise normal/tangent response, zero velocity, both friction
|
||||
coefficient branches and final impulse application. Moving-surface entries
|
||||
include aliased reference velocity; world impulses include an aliased impulse
|
||||
input. Zero impulses, restitution values 0/0.5/1 and rotated coordinate bases
|
||||
are covered. These are bounded record fixtures, not every possible scene.
|
||||
- All seven new consumers and complete entries run to return without service
|
||||
stubs or early checkpoint boundaries. CPU outside retired VU, outgoing host
|
||||
FP effects, clocks/checkpoints, call counts and final memory agree. Native
|
||||
VU stays untouched through the complete sequences. No new W exclusions are
|
||||
used; all four inverse-result components remain compared exactly.
|
||||
- Historical inverse ABI coverage grows to 7,168 / 112 cases / whole-memory
|
||||
checks. Forward remains 5,504 / 344. Existing hierarchy coverage retains
|
||||
786,432 helper cases / 384 whole-memory, 8,000 geometric edges, 1,024 complete
|
||||
BSP callers / 32 whole-memory and 2,048 unknown ABI cases.
|
||||
|
||||
## Replay and window qualification
|
||||
|
||||
Player, headless runner, historical checker and all eleven native test targets
|
||||
build. All eleven native suites and twelve Python tooling tests pass.
|
||||
|
||||
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
|
||||
frames. Four-player recordings match the parent on every field. One-player
|
||||
records match on draw, sound, calls, scratchpad, threads and timing/counts; raw
|
||||
RAM hashes differ on 85 frames only. Strict/default native files and snapshots
|
||||
are byte exact and strict result comparisons report no mismatch. The sampled
|
||||
frame-7000 1P and frame-6000 4P RAM images match their parent byte for byte.
|
||||
|
||||
One-player reaches 2,221 new inverse calls. The two-body returns `1ed8ec` and
|
||||
`1ed92c` stay cold in these replays and are qualified by complete-entry fixtures.
|
||||
Four-player makes no calls to these seven rigid-body inverse sites.
|
||||
|
||||
### RAM provenance
|
||||
|
||||
The 1P RAM difference is bounded to opaque stack padding:
|
||||
|
||||
- Frames 7714-7743 differ at `8ff19c`; frames 8521-8575 at `8ff1dc`.
|
||||
Each slot holds `02000200` in the parent and zero in the native run. Dumps at
|
||||
the first affected frame in each interval identify only those two bytes.
|
||||
- The inverse at `1ee030` publishes identical full XYZW, including meaningful
|
||||
basis W `02000200`. Its native implementation leaves VF16 untouched.
|
||||
The unchanged forward helper at return `1edf38` then spills stale VF16.W into
|
||||
a temporary while its actual scalar displacement consumer reads XYZ only.
|
||||
- A generated-store trace identifies the first slot's later writer as
|
||||
`mathfMulMatrixTP3x3`, return `1ede74`. `createSkewSymmetric` writes only 3x3
|
||||
arithmetic fields; the matrix helper copies its residual first-column W from
|
||||
`8ff1dc` into `8ff19c`. The subsequent matrix scale/add consumes the 3x3 fields.
|
||||
This explains the padding's movement without adding a register shadow.
|
||||
- Diagnostic runs hash a copied 32 MiB RAM image on all 85 affected frames after
|
||||
clearing just the identified four-byte slot for that frame. All other bytes
|
||||
match by hash. These diagnostics do not modify game RAM or production checks.
|
||||
Their original recording files match the qualified baseline/native recordings
|
||||
byte for byte; the writer trace's 7,800-frame payload also matches its baseline.
|
||||
- Temporary source instrumentation was removed. Original generated/runtime
|
||||
object hashes match exactly, and the qualified headless executable was
|
||||
restored byte for byte. Raw RAM hash differences remain reported, not hidden.
|
||||
|
||||
Fresh isolated windowed runs complete 6,500 one-player, 6,500 four-player and
|
||||
4,200 movie frames. Reviewed captures show level loading, advancing gameplay,
|
||||
driving/combat/effects, four simultaneous views, decoded intro images and return
|
||||
to the menu. Each route has five distinct captures. Windowed 1P reaches 853 new
|
||||
inverse calls; 4P and movies make none. Stereo 48 kHz WAV captures contain nonzero
|
||||
audio. Device underruns remain: 54.9 ms silence in 1P, 23.4 ms in 4P and 16.2 ms
|
||||
in movies. These are functional checks, not a timing or flawless-playback claim.
|
||||
Full campaign, every scene and physical controller/hardware acceptance remain
|
||||
outside this increment.
|
||||
|
||||
## Remaining scope
|
||||
|
||||
Current generated source has 134 inverse-helper returns and 269 forward returns.
|
||||
Of these two families, 22 inverse and 174 forward sites remain outside the native
|
||||
allowlists: 196 total. This is a call-site inventory, not a count of all remaining
|
||||
emulation. Remaining inverse groups include AI, driver/boss helpers, HUD/radar,
|
||||
rollover, damage, lighting, a tire helper and a particle helper. Additional inline
|
||||
arithmetic and forward transforms remain separate work.
|
||||
@@ -0,0 +1,91 @@
|
||||
# Native renderer hierarchy
|
||||
|
||||
The USA player's renderer hierarchy now uses typed scene, frame, matrix, clip and light records. Its
|
||||
producers, traversal decisions, C getters/setters and mesh consumers change together. There is no
|
||||
compatibility register bank, addressable VU memory, uploaded image selector or microprogram dispatch in
|
||||
this calculation path. BozoEngine remains at the independently qualified `4a8f70a`.
|
||||
|
||||
## Boundaries
|
||||
|
||||
`runtime/tmb_scene.cpp` contains record calculations; `runtime/tmb_scene_hooks.cpp` connects 197 audited
|
||||
instruction sites to the existing scalar game traversal. These cover view-cache inputs, root/coordinate/
|
||||
child transforms, inner/outer FOV tests, object projection, light selection, scaled distance/LOD,
|
||||
position save/restore and matrix accessors. Scalar branches, bookkeeping, checkpoints and game memory
|
||||
records retain their existing owners. Packet-only vector payload stores are retired.
|
||||
|
||||
`tmb_meshes.cpp` consumes the native object matrix, directional/selected point lights and alpha depth.
|
||||
Its original context reads are confined to the historical checker host. Each player runtime owns a
|
||||
scene through a game-thread `Binding`; destruction releases it and a subsequent run starts fresh.
|
||||
Windowed hosts bind inside `game.run`, where traversal actually executes. C setters may initialise a
|
||||
frame one basis at a time; reads require the requested basis and traversal requires the complete frame.
|
||||
Invalid indices, incomplete light lists and uninitialised frames fail explicitly.
|
||||
|
||||
The owner ELF has 21 `callms` sites: 14 are replaced here; the native height helper already bypasses one;
|
||||
the six old 2D helper sites reject if reached. All 21 sites are therefore adapted or guarded. Ordinary
|
||||
native overlays do not use those six helpers in the qualified routes. Reaching another unsupported
|
||||
route is an error, rather than silently invoking compatibility microcode. Only explicit
|
||||
`TMB_NATIVE_HIERARCHY_CHECK=1` permits the existing height oracle to execute the original helper on a
|
||||
copied context; that diagnostic saves/restores its library image state, including on exception.
|
||||
|
||||
Arithmetic retains the shipped separately rounded/truncated operations, including the scaled-X factor
|
||||
on the light-selection Y-squared term. The eighth input colour originally aliases the first selected
|
||||
colour: selection clears that slot, then the first accepted light replaces it. Native records preserve
|
||||
this particular dependency without retaining its memory layout. Unused light-position slots and their
|
||||
padding are zeroed; active numerical lanes and resulting shading are compared below.
|
||||
|
||||
## Validation
|
||||
|
||||
Local artifacts: `D:/BozoScratch/renderer-hierarchy`, compared with TMB main `31f54d1` and the same engine,
|
||||
disc, scripts and build configuration. All game runs use isolated scratch user directories. These are
|
||||
functional checks, with no timing or speedup claim.
|
||||
|
||||
- `tmb-native-scene-tests` passes 32,768 complete root/camera/three-child/FOV/object/LOD sequences in four
|
||||
host FP modes against the original hierarchy programs, plus 32,768 light selections and 96,684 actual
|
||||
point-shading comparisons. Geometry uses finite inputs; arbitrary IEEE NaN payload/sign propagation
|
||||
is not promised. Only inactive position lanes/padding are excluded from light-record comparisons;
|
||||
the complete rendered colours are compared without that exclusion.
|
||||
- The actual freshly generated view-cache, coordinate, child and getter/setter helpers execute through
|
||||
the production instruction dispatcher with no microprogram/device service. Complete VU context and
|
||||
4 KB VU-memory sentinels stay untouched. Partial frame construction, rejection of an unsupported
|
||||
program, separate runtime owners and destruction/address reuse pass.
|
||||
- Existing native matrix/direction, HUD, vehicle and collision-hierarchy suites pass, as do all 12
|
||||
release-tool regressions. Player, headless and historical checker targets build successfully.
|
||||
- Default 1P (9,500 frames) and 4P (8,500) complete with **zero VU0 program calls**. Every frame's draw
|
||||
hash/count, sound hash/sample count, library calls, EE clocks, scratchpad and thread records match
|
||||
main. RAM is different, as bounded below. This does not imply zero hardware accesses throughout the
|
||||
rest of the port.
|
||||
- Separate strict runs reproduce both default recordings byte-for-byte. Their copied-context collision
|
||||
helpers perform 4,977,182 / 1,560,611 original comparisons, including 168,137 / 36,227 diagnostic-only
|
||||
height microprogram calls. Scene comparisons are in the dedicated test suite, not this live flag.
|
||||
- The 1P route executes 949,504 coordinate transforms, 433,552 child transforms, 4,998,340 FOV tests,
|
||||
1,436,327 object projections, 879,562 light selections and 894,750 LOD calculations. The 4P route
|
||||
executes 1,319,416 / 648,187 / 6,524,809 / 1,982,686 / 0 / 769,035 respectively. Live point-light
|
||||
coverage therefore comes from 1P; unit tests also exercise eight-input selection and the colour alias.
|
||||
- Windowed default runs finish 4,201 movie/menu frames and 6,501 frames each for 1P and actual 4P,
|
||||
through loading into active arenas. Direct capture inspection covers decoded movie pictures, menus,
|
||||
the stage-loading screen, textured gameplay, vehicle/HUD effects and four independent snowy views.
|
||||
Audio logs report 18.0 / 35.9 / 54.5 ms of inserted silence and dropped device frames. Deterministic
|
||||
sound remains exact; flawless device audio or subjective listening acceptance is not claimed.
|
||||
|
||||
## RAM boundary and remaining work
|
||||
|
||||
Raw RAM differs from frame 2 because retired vector stores no longer populate unused graphics payloads.
|
||||
At the 2,000-update gameplay snapshot, all 17,256 differing words lie in the owner's named packet-storage
|
||||
intervals (names and starts from the USA ELF symbols):
|
||||
|
||||
| Packet storage | Interval, end exclusive | Different words |
|
||||
|---|---|---:|
|
||||
| `hierObjPkt` | `564a80..5eca80` | 154 |
|
||||
| `hierObjPkt2` | `5eca80..630a80` | 8,595 |
|
||||
| `hierAlphaPkt` | `630a80..64ea80` | 4,554 |
|
||||
| `hierAlphaPkt2` | `64ea80..66ca80` | 3,953 |
|
||||
|
||||
There are zero differences outside these intervals at that snapshot. `hierGetBigBufAddr` also returns
|
||||
`564a80`. This evidence bounds that snapshot, not every intermediate frame or campaign path. No stale
|
||||
packet/vector restoration, shadow register bank or broader memory-hash mask is added.
|
||||
|
||||
Other game math helpers and VU macro instructions remain. The subsequent
|
||||
[`NATIVE_SHADERS.md`](NATIVE_SHADERS.md) increment removes `VuImage` and the scene's light packing, using
|
||||
named native shader inputs instead. Scalar packet-building code still survives around several hooks.
|
||||
The historical checker/original program implementation remains for comparison. These increments do
|
||||
not claim total VU/emulation removal, full campaign qualification or console visual parity.
|
||||
@@ -0,0 +1,59 @@
|
||||
# Native mesh shader parameters
|
||||
|
||||
The native mesh path no longer builds or reads a `VuImage`. `tmb_shader_parameters.h` defines named
|
||||
object/camera/clip matrices, directional and point lights, tint, texture offsets, depth scale, fog and
|
||||
morph weight. `tmb_shading.h` consumes those records directly for strips, sprites, ribbons, skin colours
|
||||
and reflections. There is no quadword address, wraparound, `setQw`, word bank or packed-input fallback
|
||||
in this runtime path. BozoEngine remains pinned at `4a8f70a`.
|
||||
|
||||
Scene light selection now produces per-light direction, position, colour, cone and attenuation fields
|
||||
directly. It retains selection's four-light limit, the shipped shader's three-light contribution, the
|
||||
eighth-input colour alias and the original off-diagonal move rounding. The old eleven-row light packing
|
||||
is gone; the fourth selection's colour is a normal light field rather than other colours' W components.
|
||||
|
||||
Each object gets fresh parameters. The scene's run owns the last opaque transform/directions and retained
|
||||
morph weight. Alpha headers do not replace the opaque cache. A pool-less rigid resume retains its setup,
|
||||
projection and lights under the existing rules; a morph without a new instance keeps the last weight.
|
||||
View setup refreshes default directions and invalidates the previous draw. Historical checker inputs
|
||||
are decoded from their original context ABI into the same native parameter types; player hosts read
|
||||
scene records. An unused `Drawn.check` snapshot of packed constants is also removed.
|
||||
|
||||
The previous project-owned shading implementation, including its packed input, is retained only under
|
||||
`tests/fixtures`. It is a numerical reference, not a runtime adapter or microprogram interpreter.
|
||||
|
||||
## Validation
|
||||
|
||||
Local evidence: `D:/BozoScratch/shader-parameters`, against main `9d7372f`, the same USA disc, engine and
|
||||
input scripts. All runs use isolated user folders. Builds and checks here are functional, not timing runs.
|
||||
|
||||
- All six native suites and 12 release-tool tests pass. The player, headless and historical checker build.
|
||||
- The new disc-free shader suite compares 32,768 synthetic parameter sets in four host FP modes with
|
||||
the previous packed implementation: all three strip colour modes, lit/unlit skin colours, scaled and
|
||||
unscaled projection, fog, 16,401 visible sprites, 147,912 emitted ribbon vertices and dry/water
|
||||
reflections agree bit-for-bit. Ribbon fixtures cover emitted geometry, parity and clipping. These
|
||||
finite inputs do not establish arbitrary NaN payload equivalence.
|
||||
- The scene suite still passes 32,768 complete transform/FOV/LOD sequences, 32,768 original light
|
||||
selections and 96,684 actual point-shading comparisons. Active light fields are checked directly;
|
||||
unused positions and the fourth selection's unconsumed geometry are excluded. Binding isolation and
|
||||
destruction/reuse now also check retained morph state. Generated-helper routing and VU sentinels pass.
|
||||
- The shader suite also builds/runs directly with GCC and only the runtime include folder: no disc,
|
||||
generated game C++, SDL or engine library is needed. Windows/Linux CI runs this standalone check.
|
||||
- Default 1P (9,500 frames) and actual 4P (8,500) recordings are byte-for-byte identical to main's complete
|
||||
recordings, including RAM hashes, scratchpad, draws/counts, sound/samples, calls, clocks and threads.
|
||||
Both corresponding strict recordings are also identical to main and to their default runs. Native
|
||||
defaults still execute zero VU0 programs; strict collision diagnostics retain their explicit oracle.
|
||||
- Windowed movie/menu (4,201 frames) and 1P/4P (6,501 each) finish through loading into active arenas.
|
||||
Captures were inspected directly for decoded movies, readable menus/loading, textured vehicles,
|
||||
lighting, fog, HUD/effects and four independent snowy views. All five movie captures exactly match
|
||||
the prior batch's PNGs. Real-time gameplay captures vary even between two runs of the unchanged
|
||||
saved baseline executable; they are visual smoke evidence, not a pixel-parity assertion.
|
||||
- Device logs retain dropped frames and 23.4 / 55.5 / 26.4 ms of inserted silence in movie/1P/4P runs.
|
||||
Exact deterministic sound is not a claim of flawless device audio or subjective listening acceptance.
|
||||
|
||||
## Remaining scope
|
||||
|
||||
Other generated VU macro math and game helper callers still remain, as do scalar packet builders,
|
||||
legacy graphics extents and game-owned constant buffers used by several hooks. This change removes
|
||||
the mesh shader's compatibility parameter storage; it does not claim total emulation removal, full
|
||||
campaign qualification, console visual parity or a performance improvement. It publishes source
|
||||
changes without updating the earlier player release or migrating the engine pin.
|
||||
@@ -0,0 +1,112 @@
|
||||
# Native shadow transforms
|
||||
|
||||
Six forward-transform helper returns now use native XYZ record calculations,
|
||||
extending the [particle-emission increment](NATIVE_PARTICLE_EMISSION.md). Forward
|
||||
coverage grows from 70 to 76 sites; inverse coverage stays at 85. BozoEngine remains
|
||||
pinned to `4a8f70a`.
|
||||
|
||||
| Return PC of helper `1da298` | Owner | Consumer |
|
||||
| --- | --- | --- |
|
||||
| `15e1b8` | `shadowUpdate` (`15df38`) | Vehicle shadow world vertices, height offset and packed XYZ publication |
|
||||
| `1b42c8` | `UpdateShadowTrans` (`1b41d0`) | In-place weapon motion direction, then coordinate-system position update |
|
||||
| `1b430c`, `1b43a8`, `1b4434`, `1b44c0` | `UpdateShadowTrans` | Four world-space points for shadow height sampling |
|
||||
|
||||
The existing native calculation snapshots operands before overlapping writes,
|
||||
computes separately rounded XYZ and retains destination W. Actual following world
|
||||
sums, packed vertex writes and the first height-query vector copy consume XYZ only.
|
||||
Later terrain-height code also copies complete vectors, retaining opaque W in
|
||||
temporary endpoints and the flat-height result; its height/normal consumers use XYZ. VU
|
||||
registers, accumulator, flags and data memory stay untouched. Historical hosts and
|
||||
unknown callers retain the complete original ABI. Shadow selection, matrix
|
||||
construction, height queries, pitch/orientation, smoothing and game checkpoints
|
||||
remain compiled game code.
|
||||
|
||||
## Generated consumers and numerical checks
|
||||
|
||||
Local evidence is under `D:/BozoScratch/shadow-transforms`, against main `0de15eb`
|
||||
(PR #37). Generated game code, retail data, recordings and captures stay outside Git.
|
||||
|
||||
- Added coverage is 3,072 consumer sequences / 128 whole-memory comparisons.
|
||||
Aggregate coverage is 67,584 / 2,208. CPU outside retired VU, outgoing host FP
|
||||
effects, clocks/checkpoints and consumer memory agree; native VU stays untouched.
|
||||
Four host FP modes, denormal controls, RAM aliases and arbitrary opaque stack-W
|
||||
payloads are covered. Original forward W is normalized only after all actual
|
||||
consumers have run.
|
||||
- Vehicle coverage includes 256 complete cached-height vertex loops / 16 extra
|
||||
whole-memory cases, with one to four vertices, actual successive helper calls,
|
||||
world sums, negative-height clamp, packed XYZ vertices and shadow-center
|
||||
publication through return. Signed zero, signed subnormals and heights around
|
||||
one are included. Shadow/matrix selection and uncached terrain queries are
|
||||
outside these loop fixtures.
|
||||
- The remaining vehicle cases and every weapon transform run through the actual
|
||||
`hdHatTest` prefix: its XYZ copy, downward-ray Z adjustment and global point
|
||||
publication, stopping at its first `memset` dispatch. Terrain collision beyond
|
||||
that point is outside these bounded fixtures; no height-query stub is used.
|
||||
- Another 256 weapon cases / 16 extra whole-memory enter at `1b429c`, execute the
|
||||
actual movement-Z producer, in-place transform, coordinate-system position
|
||||
update and first transformed corner through the same height-query prefix.
|
||||
The other weapon cases enter at individual helper boundaries. Coordinate-system
|
||||
position W is retained and compared exactly. Later height results, pitch and
|
||||
smoothing are not exercised by these consumer fixtures.
|
||||
- Historical forward coverage grows to 4,288 / 268 cases / whole-memory checks;
|
||||
inverse coverage stays at 5,440 / 85. The hierarchy suite retains 786,432 helper
|
||||
cases / 384 whole-memory, 8,000 geometric edges, 1,024 complete recursive BSP
|
||||
callers / 32 whole-memory and 2,048 unknown ABI cases. The math suite retains
|
||||
1,048,576 / 512 and 2,048 unknown ABI cases.
|
||||
- Player, headless, historical checker and all native test targets rebuild. All
|
||||
eleven native suites and twelve Python tooling tests pass.
|
||||
|
||||
## Gameplay, loading and movies
|
||||
|
||||
The default and strict-check builds complete 9,500 one-player frames and 8,500
|
||||
actual four-player frames. Strict/default recordings and full 32 MiB snapshots
|
||||
are byte-exact. Against the previous increment, all scratchpad, call, draw, sound,
|
||||
thread, count and EE-clock fields agree on every frame; the four-player recording
|
||||
and both full snapshots also agree exactly.
|
||||
|
||||
One-player RAM hashes differ on 3,599 frames, first at 5,593. A temporary paired
|
||||
store observer reproduces both complete qualified recordings and every raw frame
|
||||
hash. All differences are confined to four opaque stack-W words: vehicle output
|
||||
`8ff57c`, terrain-height temporary endpoints `8ff38c` / `8ff39c`, and the
|
||||
flat-height result `8ff43c`. The latter three are actual 64-bit vector copies in
|
||||
`terrainGetHAT` (`1efa38`), reached through `hdHatTest` return `1ced28` and flat
|
||||
height return `1efb24`. Height calculations and the following normal copy consume
|
||||
XYZ. Each differing word matches its last traced writer; replacing these four
|
||||
words on a diagnostic RAM copy reproduces every baseline frame hash, with zero
|
||||
unaccounted frames. No observer, RAM mask or VU-state restoration ships. All 32
|
||||
generated sources and 35 production object hashes were restored exactly afterward.
|
||||
|
||||
The vehicle site runs 25,186 times in the one-player route and is cold in the
|
||||
four-player route. The five weapon sites are cold in both; their acceptance comes
|
||||
from generated-consumer comparisons, not a claim that these routes cover them.
|
||||
Total native forward calls are 1,127,230 / 283,936 (one-player / four-player).
|
||||
Default runs make zero original-helper comparisons and execute zero VU0
|
||||
microprograms. These counts are coverage evidence, not a speedup measurement.
|
||||
|
||||
After observer removal, the player, headless runner, historical checker and all
|
||||
eleven native suites rebuild; all suites pass again. The three production
|
||||
binaries contain no temporary observer markers.
|
||||
|
||||
Fresh 6,500-frame actual four-player and one-player windowed routes and a
|
||||
4,200-frame movie/menu route complete through clean exit, using isolated scratch
|
||||
user data. Reviewed captures show decoded movie playback (1,000), return to menu
|
||||
(1,800), Junkyard loading (one-player 4,500), active one-player gameplay and vehicle
|
||||
shadows (5,500 / 6,300), and four advancing snow-arena views with snow/tire effects
|
||||
(four-player 5,500 / 6,300). The windowed one-player route reaches the new vehicle
|
||||
site 11,942 times; the weapon sites remain cold. These captures establish bounded
|
||||
functional coverage, not pixel-exact windowed or console parity.
|
||||
|
||||
All three stereo 48 kHz WAV recordings contain audio. Device logs report
|
||||
27.7 / 77.2 / 29.2 ms of silence (movie / one-player / four-player), with underruns
|
||||
and dropped frames. Deterministic gameplay sound matches the previous increment;
|
||||
flawless device audio, subjective listening and full campaign acceptance are not
|
||||
claimed.
|
||||
|
||||
## Remaining scope
|
||||
|
||||
The two helper inventories now have 76 native forward and 85 native inverse sites.
|
||||
Outside their allowlists remain 193 forward and 49 inverse sites, 242 in total
|
||||
across the game, including sites inside otherwise replaced functions. This is a
|
||||
structural source inventory, not a live cost measurement, and excludes other helper
|
||||
families and inline VU operations. Full campaign acceptance and console visual/audio
|
||||
parity remain separate work.
|
||||
@@ -0,0 +1,79 @@
|
||||
# Native launcher special-weapon forward transforms (held aim and lock-on arcs)
|
||||
|
||||
[The weapon hit-test batch](NATIVE_WEAPON_HIT_FORWARD.md) follows with six RockHD/RicoHD sites.
|
||||
|
||||
Seven more `Launcher::UpdateSpecial` forward returns use native XYZ arithmetic after
|
||||
the [type-100 sweep batch](NATIVE_SPECIAL_SWEEP_FORWARD.md). Known forward coverage
|
||||
grows from 209 to 216 of 269 returns (53 remain). Known inverse coverage stays 134
|
||||
of 134; BozoEngine stays at `4a8f70a`.
|
||||
|
||||
All seven are in `Launcher::UpdateSpecial` (`14dae0`):
|
||||
|
||||
| Return PC | Producer and consumer |
|
||||
| --- | --- |
|
||||
| `14ed94` | Vehicle type `100` with a shot held (`+284`): the turret is turned, no animation is running, and the aim point at `+350` is smoothed toward `(0, gp-629c, 0)`. It goes through the vehicle's coordinate system into frame `+0`, plus the vehicle system's position, into the position of the object at `+34c`; the owner then returns |
|
||||
| `14e2d0`, `14e320` | Vehicle type `a0` lock-on arc: a side offset in frame `+0` goes through the vehicle's coordinate system into frame `+20`, plus the vehicle position. That is the arc's first point |
|
||||
| `14e498`, `14e4dc` | With a target at `+2f4`, a heading-selected table slot (frame `+40` or `+70`) goes through the target's coordinate system into frame `+30`, plus the target's position. That is the arc's second point |
|
||||
| `14e6a8`, `14e6ec` | The second type `a0` block: the same heading-selected slots through the target's system into frame `+30`, plus the target's position, arcing from the vehicle position |
|
||||
|
||||
Every arc ends in `particleElectricArc`, which reads its two points only as XYZ.
|
||||
`mathfAddVector` reads its operands only as XYZ. The owner never reads frame `+0c`,
|
||||
`+2c` or `+3c`, and it reads no VU registers, accumulator or flags. The existing
|
||||
native helper computes separately rounded XYZ, preserves destination W and leaves
|
||||
VU state untouched. Unknown and historical callers keep the original ABI. No engine
|
||||
or gameplay formula changes.
|
||||
|
||||
## Generated comparisons
|
||||
|
||||
Evidence is under `D:/BozoScratch/special-arcs-forward`, against parent `2d3c0f4`
|
||||
(PR #79). Parent headless/window binaries are preserved there and match PR #79's
|
||||
qualified build. Generated bodies, retail data and runtime recordings stay outside
|
||||
Git.
|
||||
|
||||
- Added coverage is 3,584 generated sequences / 224 whole-memory comparisons (caller
|
||||
kinds 314 to 320): helper-boundary continuations and full entries, across four
|
||||
rounding modes, FTZ/DAZ, RAM aliases, identity/quarter-turn bases and arbitrary W
|
||||
payloads.
|
||||
- `14ed94` runs from the owner's start: the type dispatch, the turret step and
|
||||
bound, the node-matrix rebuild, the animation check and the aim-point smoothing,
|
||||
to the owner's real return. The arc entries start at the call-return label before
|
||||
each transform (`14e2b8`, `14e308`, `14e3f8`, `14e608`): the heading bounding and
|
||||
the window thresholds select the slot, and the fixture stops at
|
||||
`particleElectricArc` after `rand`.
|
||||
- The harness requires each full entry to reach exactly its own transform. The
|
||||
vehicle and target bases are fixture-known, so every site is checked against an
|
||||
independent identity or quarter-turn result.
|
||||
- Published values are asserted exactly against the original FPU arithmetic: the
|
||||
aimed object's position, and the arc end in frame `+20` or `+30` at the arc
|
||||
call. Publications: 512 for each site.
|
||||
- The VU rule from the earlier weapon increments applies. Only forward scratch W
|
||||
(frame `+0c`, `+2c` or `+3c`) is normalized for test comparison, after every real
|
||||
consumer.
|
||||
- New caller kinds shift the shared random fill for later rounding modes, so two
|
||||
data-dependent counts in earlier fixtures moved (vehicle tire jumps 715 → 709,
|
||||
real libm errno cases 829 → 830). All scenario-defined counts and assertions are
|
||||
unchanged.
|
||||
- Aggregate caller coverage is 164,352 generated sequences / 8,256 whole-memory
|
||||
comparisons. Historical forward ABI coverage is 13,248 / 828; inverse remains
|
||||
8,576 / 134.
|
||||
|
||||
## Replay and window qualification
|
||||
|
||||
Player, headless runner, historical checker and all eleven native test targets
|
||||
build. All eleven native suites and twelve Python tooling tests pass, with every
|
||||
previous publication assertion enabled.
|
||||
|
||||
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
|
||||
frames. Every recording field matches parent `2d3c0f4`, including the RAM hash on
|
||||
every frame: scratchpad, calls, draws, sound, thread state and EE timing/counts.
|
||||
Sampled 32 MiB RAM images are identical. Strict/default recordings and snapshots
|
||||
are byte exact; strict comparisons report no mismatch. The seven returns are cold on these routes and are qualified by the generated owner suite above.
|
||||
|
||||
Fresh isolated window runs, started after the headless replays had finished,
|
||||
complete 6,500 one-player, 6,500 actual four-player and 4,200 movie frames.
|
||||
Reviewed captures show the intro and credits, menus, vehicle and level selection,
|
||||
driving with the HUD and four simultaneous views. Each route has five distinct
|
||||
captures. Stereo 48 kHz, 16-bit WAV recordings contain nonzero audio. Audio device
|
||||
underruns: 31.4 ms of silence in one-player, 652.5 ms in four-player and 20.9 ms in
|
||||
the movie run. These are functional checks, not a performance or flawless-playback
|
||||
claim. The four-player window run overlapped other work on the machine (39 to 48 frames/s around frame 3,300). A back-to-back four-player rerun of new and parent builds then gave 35.1 ms and 103.1 ms of silence at 59.3 frames/s. The other special weapons in actual play, full campaign and physical controller/hardware acceptance remain open.
|
||||
@@ -0,0 +1,84 @@
|
||||
# Native launcher special-weapon forward transforms (first batch)
|
||||
|
||||
[The second special-weapon batch](NATIVE_SPECIAL_VOLLEY_FORWARD.md) follows with vehicle types 1c0 and 140.
|
||||
|
||||
Five `Launcher::UpdateSpecial` forward returns use native XYZ arithmetic after the
|
||||
[FinalBoss movement forwards](NATIVE_BOSS_MOVE_FORWARD.md). Known forward coverage
|
||||
grows from 196 to 201 of 269 returns (68 remain). Known inverse coverage stays 134
|
||||
of 134; BozoEngine stays at `4a8f70a`.
|
||||
|
||||
`Launcher::UpdateSpecial` (`14dae0`) runs each vehicle's special weapon, dispatched
|
||||
on the vehicle type at `+20a8`. This batch covers three of its branches:
|
||||
|
||||
| Return PC | Vehicle type | Producer and consumer |
|
||||
| --- | --- | --- |
|
||||
| `14dc44` | `60` | Table offset `23cfa0` through the vehicle's coordinate system, added to the vehicle position into the launcher's `+620` |
|
||||
| `14dccc` | `60` | Table offset `23cfb0` through a matrix at frame `+40`, built from the turret angles (`+290` plus the vehicle's), added to `+620`; then `Weapons::CreateWeapon` |
|
||||
| `14dea8` | `120` | Table offset `23cfc0` through the vehicle's coordinate system, added into `+620` |
|
||||
| `14df2c` | `120` | Table offset `23cfd0` through the turret matrix at frame `+30`, added to `+620`; then `CreateStaticWeapon` from `+620` |
|
||||
| `14e020` | `c0` | The launcher's offset at `+400` through the vehicle's coordinate system into `+620`; after `GetLockOn`, `TheGame::CreateWeapon` |
|
||||
|
||||
Each fires when its countdown at `+98` runs out. Every result is the frame vector at
|
||||
`+0`, read only by `mathfAddVector`, which writes X/Y/Z into `+620`. The
|
||||
environment-gun increment showed that `CreateStaticWeapon` reads only X/Y/Z.
|
||||
Frame `+0c` is never read in the owner, and the W of `+620` is not written by
|
||||
these paths. The owner reads no VU registers, accumulator or flags. The existing
|
||||
native helper computes separately rounded XYZ, preserves destination W and leaves
|
||||
VU state untouched. Unknown and historical callers keep the original ABI. No engine
|
||||
or gameplay formula changes.
|
||||
|
||||
## Generated comparisons
|
||||
|
||||
Evidence is under `D:/BozoScratch/special-guns-forward`, against parent `8f0fdf3`
|
||||
(PR #76). Parent headless/window binaries are preserved there and match PR #76's
|
||||
qualified build. Generated bodies, retail data and runtime recordings stay outside
|
||||
Git.
|
||||
|
||||
- Added coverage is 2,560 generated sequences / 160 whole-memory comparisons
|
||||
(caller kinds 301 to 305): helper-boundary continuations and owner entries,
|
||||
across four rounding modes, FTZ/DAZ, RAM aliases, identity/quarter-turn bases and
|
||||
arbitrary W payloads.
|
||||
- Owner entries for types `60` and `c0` run from the owner's start: the type
|
||||
dispatch, the countdown, both transforms of a pair with the real angle bounding
|
||||
and `mathfRotMatrixRPH`, and for `c0` the real `GetLockOn`. Type `120` entries
|
||||
start right after the branch's `UpdateHearse` call, whose own forward transform is
|
||||
covered by its earlier increment. Each stops at its weapon creation; reaching it
|
||||
is asserted. Without a countdown, types `60`/`c0` return, and type `120` stops at
|
||||
its gun-sound update.
|
||||
- The first transform of each pair uses the fixture's vehicle basis, and so does
|
||||
`c0`, so their cases are checked against an independent identity or quarter-turn
|
||||
result. The second transform's matrix is rebuilt from the turret angles, so it is
|
||||
checked independently only when a case starts at its own helper boundary.
|
||||
- The final launch point in `+620` is asserted exactly against the original FPU
|
||||
addition, and for type `120` also as the origin `CreateStaticWeapon` receives.
|
||||
Publications: 704/960, 704/960 and 480.
|
||||
- The VU rule from the earlier weapon increments applies. Only forward scratch W at
|
||||
frame `+0c` is normalized for test comparison, after every real consumer.
|
||||
- New caller kinds shift the shared random fill for later rounding modes, so two
|
||||
data-dependent counts in earlier fixtures moved (vehicle tire jumps 701 → 702,
|
||||
real libm errno cases 830 → 801). All scenario-defined counts and assertions are
|
||||
unchanged.
|
||||
- Aggregate caller coverage is 156,672 generated sequences / 7,776 whole-memory
|
||||
comparisons. Historical forward ABI coverage is 12,288 / 768; inverse remains
|
||||
8,576 / 134.
|
||||
|
||||
## Replay and window qualification
|
||||
|
||||
Player, headless runner, historical checker and all eleven native test targets
|
||||
build. All eleven native suites and twelve Python tooling tests pass, with every
|
||||
previous publication assertion enabled.
|
||||
|
||||
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
|
||||
frames. Every recording field matches parent `8f0fdf3`, including the RAM hash on
|
||||
every frame: scratchpad, calls, draws, sound, thread state and EE timing/counts.
|
||||
Sampled 32 MiB RAM images are identical. Strict/default recordings and snapshots
|
||||
are byte exact; strict comparisons report no mismatch. The type-60 returns `14dc44` and `14dccc` are live: each runs natively 66 times on the one-player route with no recorded difference. The other three are cold on these routes and are qualified by the generated owner suite above.
|
||||
|
||||
Fresh isolated window runs, started after the headless replays had finished,
|
||||
complete 6,500 one-player, 6,500 actual four-player and 4,200 movie frames.
|
||||
Reviewed captures show the intro and credits, menus, vehicle and level selection,
|
||||
driving with the HUD and four simultaneous views. Each route has five distinct
|
||||
captures. Stereo 48 kHz, 16-bit WAV recordings contain nonzero audio. Audio device
|
||||
underruns: 53.8 ms of silence in one-player, 29.6 ms in four-player and 21.3 ms in
|
||||
the movie run. These are functional checks, not a performance or flawless-playback
|
||||
claim. The other special weapons in actual play, full campaign and physical controller/hardware acceptance remain open.
|
||||
@@ -0,0 +1,78 @@
|
||||
# Native launcher special-weapon forward transforms (type 100)
|
||||
|
||||
[The held-aim and lock-on arc batch](NATIVE_SPECIAL_ARCS_FORWARD.md) follows with seven sites.
|
||||
|
||||
Three more `Launcher::UpdateSpecial` forward returns use native XYZ arithmetic after
|
||||
the [second special-weapon batch](NATIVE_SPECIAL_VOLLEY_FORWARD.md). Known forward
|
||||
coverage grows from 206 to 209 of 269 returns (60 remain). Known inverse coverage
|
||||
stays 134 of 134; BozoEngine stays at `4a8f70a`.
|
||||
|
||||
All three are in the vehicle type `100` branch of `Launcher::UpdateSpecial`
|
||||
(`14dae0`). The branch runs while no shot is held (`+284`) and the turret angle at
|
||||
`+290` (stepped down by `gp-62b0`) stays above `gp-42a0`:
|
||||
|
||||
| Return PC | Producer and consumer |
|
||||
| --- | --- |
|
||||
| `14eb9c` | The turret node's matrix (node at `+2a0`, matrix at `+10`) is rebuilt from that angle with `mathfRotMatrixRPHNoTrans`; table offset `23d070` goes through it into frame `+0`, plus `23d060`, into frame `+20` |
|
||||
| `14ec04` | The global sweep angle at `gp-3090` (stepped and bounded) builds a matrix at frame `+30`; table offset `23d0a0` goes through it into frame `+0`, added to frame `+20` |
|
||||
| `14ec70` | The launcher's aim point at `+350`, smoothed toward frame `+20`, goes through the vehicle's coordinate system into frame `+0`, plus the vehicle position; this becomes the position of the object at `+34c` |
|
||||
|
||||
When the angle runs below the limit, the branch instead fires from the table
|
||||
(`CreateStaticWeapon`), with no transform. All three results are the frame vector
|
||||
at `+0`, read only by `mathfAddVector`. Frame `+20` is read by `mathfAddVector` and
|
||||
as scalar `smoothEasyIn` targets. The owner never reads frame `+0c` or `+2c`. It
|
||||
reads no VU registers, accumulator or flags. The existing native helper computes
|
||||
separately rounded XYZ, preserves destination W and leaves VU state untouched.
|
||||
Unknown and historical callers keep the original ABI. No engine or gameplay formula
|
||||
changes.
|
||||
|
||||
## Generated comparisons
|
||||
|
||||
Evidence is under `D:/BozoScratch/special-sweep-forward`, against parent `e1cf669`
|
||||
(PR #78). Parent headless/window binaries are preserved there and match PR #78's
|
||||
qualified build. Generated bodies, retail data and runtime
|
||||
recordings stay outside Git.
|
||||
|
||||
- Added coverage is 1,536 generated sequences / 96 whole-memory comparisons (caller
|
||||
kinds 311 to 313): helper-boundary continuations and full-owner entries, across
|
||||
four rounding modes, FTZ/DAZ, RAM aliases, identity/quarter-turn bases and
|
||||
arbitrary W payloads.
|
||||
- Full entries run from the owner's start: the type dispatch, the angle step, the
|
||||
real node-matrix rebuild, all three transforms with the angle bounding,
|
||||
`mathfRotMatrixRPH` and the aim-point smoothing, to the owner's real return. With
|
||||
the angle below its limit they fire instead and stop at `CreateStaticWeapon`.
|
||||
- The vehicle basis is fixture-known, so `14ec70` is always checked against an
|
||||
independent identity or quarter-turn result. The other two use rebuilt matrices,
|
||||
so they are checked independently only from their own helper boundary.
|
||||
- Published values are asserted exactly against the original FPU arithmetic: the
|
||||
sweep point in frame `+20`, and the aimed object's position. Publications:
|
||||
928, 1,184 and 1,440.
|
||||
- The VU rule from the earlier weapon increments applies. Only forward scratch W at
|
||||
frame `+0c` is normalized for test comparison, after every real consumer.
|
||||
- New caller kinds shift the shared random fill for later rounding modes, so one
|
||||
data-dependent count in an earlier fixture moved (real libm errno cases 835 →
|
||||
829). All scenario-defined counts and assertions are unchanged.
|
||||
- Aggregate caller coverage is 160,768 generated sequences / 8,032 whole-memory
|
||||
comparisons. Historical forward ABI coverage is 12,800 / 800; inverse remains
|
||||
8,576 / 134.
|
||||
|
||||
## Replay and window qualification
|
||||
|
||||
Player, headless runner, historical checker and all eleven native test targets
|
||||
build. All eleven native suites and twelve Python tooling tests pass, with every
|
||||
previous publication assertion enabled.
|
||||
|
||||
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
|
||||
frames. Every recording field matches parent `e1cf669`, including the RAM hash on
|
||||
every frame: scratchpad, calls, draws, sound, thread state and EE timing/counts.
|
||||
Sampled 32 MiB RAM images are identical. Strict/default recordings and snapshots
|
||||
are byte exact; strict comparisons report no mismatch. The three type `100` returns are cold on these routes and are qualified by the generated owner suite above.
|
||||
|
||||
Fresh isolated window runs, started after the headless replays had finished,
|
||||
complete 6,500 one-player, 6,500 actual four-player and 4,200 movie frames.
|
||||
Reviewed captures show the intro and credits, menus, vehicle and level selection,
|
||||
driving with the HUD and four simultaneous views. Each route has five distinct
|
||||
captures. Stereo 48 kHz, 16-bit WAV recordings contain nonzero audio. Audio device
|
||||
underruns: 49.1 ms of silence in one-player, 31.8 ms in four-player and 14.4 ms in
|
||||
the movie run. These are functional checks, not a performance or flawless-playback
|
||||
claim. A first window run on a loaded machine reported 9.7 s of one-player silence and a late capture. A back-to-back one-player rerun of parent and new builds then gave 43.8 ms and 51.2 ms at 59.7 frames/s, and the fresh window run above was taken after it. The other special weapons in actual play, full campaign and physical controller/hardware acceptance remain open.
|
||||
@@ -0,0 +1,100 @@
|
||||
# Native launcher special-weapon torch forward transforms
|
||||
|
||||
[The LoopTank batch](NATIVE_LOOPTANK_FORWARD.md) follows with its two segment points.
|
||||
|
||||
Ten more `Launcher::UpdateSpecial` forward returns use native XYZ arithmetic after
|
||||
the [Ferris wheel and final boss batch](NATIVE_FERRIS_BOSS_FORWARD.md). Known forward
|
||||
coverage grows from 226 to 236 of 269 returns (33 remain). Known inverse coverage
|
||||
stays 134 of 134; BozoEngine stays at `4a8f70a`. With these, every forward return in
|
||||
`Launcher::UpdateSpecial` (`14dae0`) is native.
|
||||
|
||||
They are the flame-torch specials of three vehicle types:
|
||||
|
||||
| Return PC | Vehicle type | Producer and consumer |
|
||||
| --- | --- | --- |
|
||||
| `14f190` | `180` (tank car) | A locked-on target within 250: the offset in frame `+60` goes through the turret matrix at frame `+80`, plus the vehicle position, and is line-tested from the vehicle (`hdLosCsTest` end point) |
|
||||
| `14f1c4` | `180` | Without a close target: the same offset through the vehicle's coordinate system, then the same line test |
|
||||
| `14f3e8` | `180` | On a line-test hit: `(0, 5, 0)` in frame `+0` goes through the vehicle's system and is handed to `DispatchHit` |
|
||||
| `14f654` | `1e0` (Minion) | The nozzle offset at `+3a0` goes through the matrix at frame `+80` into the launcher's `+620`, plus the vehicle position |
|
||||
| `14f68c` | `1e0` | The offset at `+3b0` goes through the matrix at frame `+40` into frame `+0` and is added into `+620`. That point is then aimed at the target (`mathfRotationFromPointToPoint`), measured and line-tested |
|
||||
| `14f72c` | `1e0` | The flame offset in frame `+20` goes through the torch matrix at `+2b0`, plus `+620`, and is line-tested from `+620` |
|
||||
| `14f954` | `1e0` | On a hit: `(0, 5, 0)` through the vehicle's system, handed to `DispatchHit` |
|
||||
| `14fb7c` | `220` (Tanker) | The table offset `23d1f0` goes through the matrix at frame `+70` into `+620`, plus the vehicle position |
|
||||
| `14fbb8` | `220` | `23d200` goes through the matrix at frame `+30` into frame `+0`, added into `+620` |
|
||||
| `14fc24` | `220` | Like `14f72c`, line-tested from `+620` |
|
||||
|
||||
A consumer audit followed every path from each return until the owner returns or
|
||||
the slot is rewritten whole. It found these consumers:
|
||||
|
||||
- `mathfAddVector`.
|
||||
- `hdLosCsTest`, whose readers use the points only as XYZ (see the
|
||||
[weapon hit-test batch](NATIVE_WEAPON_HIT_FORWARD.md)).
|
||||
- `DispatchHit` and all of its handlers.
|
||||
- `mathfRotationFromPointToPoint`.
|
||||
- `particleCreateFx` and `particleTruncateFlameThrower`. The latter passes the point
|
||||
only to `mathfSubVector`.
|
||||
- `Weapons::CreateWeapon`, which copies `+620` with `mathfCopyVector`.
|
||||
|
||||
The torch sound updaters get other fields. None of these reads W.
|
||||
|
||||
The owner never loads frame `+0c`, `+2c` or `+6c`. Launcher `+62c`, the W of the
|
||||
persistent `+620`, has no reader anywhere. The owner reads no VU registers,
|
||||
accumulator or flags. The existing native helper computes separately rounded XYZ,
|
||||
preserves destination W and leaves VU state untouched. Unknown and historical callers
|
||||
keep the original ABI. No engine or gameplay formula changes.
|
||||
|
||||
## Generated comparisons
|
||||
|
||||
Evidence is under `D:/BozoScratch/special-torch-forward`, against parent `366c6b2`
|
||||
(PR #82). Parent headless/window binaries are preserved there and match PR #82's
|
||||
qualified build. Generated bodies, retail data and runtime recordings stay outside
|
||||
Git.
|
||||
|
||||
- Added coverage is 5,120 generated sequences / 320 whole-memory comparisons (caller
|
||||
kinds 331 to 340): helper-boundary continuations and entries at the call-return
|
||||
label before each transform. They run across four rounding modes, FTZ/DAZ, RAM
|
||||
aliases, identity/quarter-turn bases and arbitrary W payloads. The entry labels are
|
||||
`14f17c`, `14f0d4` (with the target distance at least 250), `14f3d4`, `14f644`,
|
||||
`14f67c`, `14f718`, `14f940`, `14fb68`, `14fba4` and `14fc10`.
|
||||
- Each run stops at the first call after the result has been consumed:
|
||||
- `hdLosCsTest` for the line tests;
|
||||
- `DispatchHit` for the hits;
|
||||
- `mathfMulMatrix` after the `+620` launch points;
|
||||
- `mathfRotationFromPointToPoint` after the frame `+0` additions.
|
||||
- A transform read only by `DispatchHit` is recorded at that call with a zero base.
|
||||
- Every basis is fixture-known, so every site is checked against an independent
|
||||
identity or quarter-turn result.
|
||||
- Published values are asserted exactly against the original FPU arithmetic: the
|
||||
launcher's `+620`, the line-test end point (and that `hdLosCsTest` receives that
|
||||
address), and `DispatchHit`'s point and address. Publications: 512 for each site.
|
||||
- The VU rule from the earlier weapon increments applies. Only forward scratch W
|
||||
(frame `+0c`, `+2c`, `+6c` or launcher `+62c`) is normalized for test comparison,
|
||||
after every real consumer.
|
||||
- New caller kinds shift the shared random fill for later rounding modes, so two
|
||||
data-dependent counts in earlier fixtures moved (vehicle tire jumps 709 → 703,
|
||||
real libm errno cases 843 → 816). All scenario-defined counts and assertions are
|
||||
unchanged.
|
||||
- Aggregate caller coverage is 174,592 generated sequences / 8,896 whole-memory
|
||||
comparisons. Historical forward ABI coverage is 14,528 / 908; inverse remains
|
||||
8,576 / 134.
|
||||
|
||||
## Replay and window qualification
|
||||
|
||||
Player, headless runner, historical checker and all eleven native test targets
|
||||
build. All eleven native suites and twelve Python tooling tests pass, with every
|
||||
previous publication assertion enabled.
|
||||
|
||||
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
|
||||
frames. Every recording field matches parent `366c6b2`, including the RAM hash on
|
||||
every frame: scratchpad, calls, draws, sound, thread state and EE timing/counts.
|
||||
Sampled 32 MiB RAM images are identical. Strict/default recordings and snapshots
|
||||
are byte exact; strict comparisons report no mismatch. The ten returns are cold on these routes and are qualified by the generated owner suite above.
|
||||
|
||||
Fresh isolated window runs, started after the headless replays had finished,
|
||||
complete 6,500 one-player, 6,500 actual four-player and 4,200 movie frames.
|
||||
Reviewed captures show the intro and credits, menus, vehicle and level selection,
|
||||
driving with the HUD and four simultaneous views. Each route has five distinct
|
||||
captures. Stereo 48 kHz, 16-bit WAV recordings contain nonzero audio. Audio device
|
||||
underruns: 907.3 ms of silence in one-player, 35.5 ms in four-player and 26.4 ms in
|
||||
the movie run. These are functional checks, not a performance or flawless-playback
|
||||
claim. The one-player window run overlapped a long read-only audit on the machine and reported 907.3 ms of silence. A back-to-back one-player rerun of new and parent builds then gave 78.4 ms and 59.9 ms at 59.4 and 59.7 frames/s. The torch specials in actual play, full campaign and physical controller/hardware acceptance remain open.
|
||||
@@ -0,0 +1,90 @@
|
||||
# Native launcher special-weapon forward transforms (second batch)
|
||||
|
||||
[The type-100 special-weapon batch](NATIVE_SPECIAL_SWEEP_FORWARD.md) follows with three sweep sites.
|
||||
|
||||
Five more `Launcher::UpdateSpecial` forward returns use native XYZ arithmetic after
|
||||
the [first special-weapon batch](NATIVE_SPECIAL_GUNS_FORWARD.md). Known forward
|
||||
coverage grows from 201 to 206 of 269 returns (63 remain). Known inverse coverage
|
||||
stays 134 of 134; BozoEngine stays at `4a8f70a`.
|
||||
|
||||
| Return PC | Vehicle type | Producer and consumer |
|
||||
| --- | --- | --- |
|
||||
| `14ee10` | `1c0` | A volley shot's table offset (`23d150`, with the launcher's `+4` set) through the vehicle's coordinate system into frame `+0` |
|
||||
| `14ee2c` | `1c0` | The same with table `23d0b0` (`+4` clear) |
|
||||
| `14ee48` | `1c0` | That frame vector, in place, through the basis of the vehicle part at `+1ec8`, added to the vehicle position into the launcher's `+620`; then `Weapons::CreateWeapon` |
|
||||
| `14ef50` | `140` | A constant offset (`gp-6298`) written into `+620`, transformed in place through the vehicle's coordinate system, plus the vehicle position; then `Weapons::CreateWeapon` |
|
||||
| `14ef80` | `140` | The launcher's `+400` offset through the vehicle's coordinate system into `+620`, plus the vehicle position |
|
||||
|
||||
The type `1c0` volley fires ten shots once its countdown runs out. Each shot chains
|
||||
two transforms in the frame vector at `+0` and then adds the vehicle position. The
|
||||
frame vector is read only by the second transform (X/Y/Z input) and
|
||||
`mathfAddVector`, and frame `+0c` is never read in the owner.
|
||||
|
||||
The type `140` sites write `+620`, which is the vehicle's `+2760` launch point,
|
||||
since the launcher sits at `vehicle+2140`. There the transform's W persists. No code
|
||||
in the game reads `vehicle+276c` (or a 64-bit or 128-bit block covering it) at a
|
||||
fixed offset. `Weapons::CreateWeapon` copies the launch point with
|
||||
`mathfCopyVector` (X/Y/Z only), and the owner hands `+620` only to
|
||||
`mathfAddVector`.
|
||||
|
||||
The owner reads no VU registers, accumulator or flags. The existing native helper
|
||||
computes separately rounded XYZ, preserves destination W and leaves VU state
|
||||
untouched. It reads its input before writing, so the in-place transforms are safe.
|
||||
Unknown and historical callers keep the original ABI. No engine or gameplay formula
|
||||
changes.
|
||||
|
||||
## Generated comparisons
|
||||
|
||||
Evidence is under `D:/BozoScratch/special-volley-forward`, against parent
|
||||
`c4a4fac` (PR #77). Parent headless/window binaries are preserved there and match
|
||||
PR #77's qualified build. Generated bodies, retail data and runtime recordings stay
|
||||
outside Git.
|
||||
|
||||
- Added coverage is 2,560 generated sequences / 160 whole-memory comparisons
|
||||
(caller kinds 306 to 310): helper-boundary continuations and owner entries,
|
||||
across four rounding modes, FTZ/DAZ, RAM aliases, identity/quarter-turn bases and
|
||||
arbitrary W payloads.
|
||||
- Type `140` entries run from the owner's start through the type dispatch,
|
||||
countdown and flag. A launcher still counting down returns without a transform.
|
||||
- Type `1c0` entries start right after the volley's `timerGetCurTics` call. That
|
||||
call reads the hardware timer, which the harness does not model. From there each
|
||||
entry runs the first shot of the volley, both transforms and the addition, and
|
||||
stops at `Weapons::CreateWeapon`.
|
||||
- The volley's two transforms chain without an addition between them. For these
|
||||
kinds, the test records the first transform's output as the second transform's
|
||||
input, and checks both.
|
||||
- Every basis is fixture-known (the vehicle's coordinate system and the part's
|
||||
basis), so every case is checked against an independent identity or quarter-turn
|
||||
result. The final launch point in `+620` is asserted exactly against the original
|
||||
FPU addition. Publications: 640/640/1,536 and 480/480.
|
||||
- The VU rule from the earlier weapon increments applies. Only the forward W (frame
|
||||
`+0c`, or `+62c` for type `140`) is normalized for test comparison, after every
|
||||
real consumer.
|
||||
- New caller kinds shift the shared random fill for later rounding modes, so two
|
||||
data-dependent counts in earlier fixtures moved (vehicle tire jumps 702 → 715,
|
||||
real libm errno cases 801 → 835). All scenario-defined counts and assertions are
|
||||
unchanged.
|
||||
- Aggregate caller coverage is 159,232 generated sequences / 7,936 whole-memory
|
||||
comparisons. Historical forward ABI coverage is 12,608 / 788; inverse remains
|
||||
8,576 / 134.
|
||||
|
||||
## Replay and window qualification
|
||||
|
||||
Player, headless runner, historical checker and all eleven native test targets
|
||||
build. All eleven native suites and twelve Python tooling tests pass, with every
|
||||
previous publication assertion enabled.
|
||||
|
||||
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
|
||||
frames. Every recording field matches parent `c4a4fac`, including the RAM hash on
|
||||
every frame: scratchpad, calls, draws, sound, thread state and EE timing/counts.
|
||||
Sampled 32 MiB RAM images are identical. Strict/default recordings and snapshots
|
||||
are byte exact; strict comparisons report no mismatch. The volley returns `14ee2c` and `14ee48` are live: each runs natively 20 times on the one-player route with no recorded difference. The other three are cold on these routes and are qualified by the generated owner suite above.
|
||||
|
||||
Fresh isolated window runs, started after the headless replays had finished,
|
||||
complete 6,500 one-player, 6,500 actual four-player and 4,200 movie frames.
|
||||
Reviewed captures show the intro and credits, menus, vehicle and level selection,
|
||||
driving with the HUD and four simultaneous views. Each route has five distinct
|
||||
captures. Stereo 48 kHz, 16-bit WAV recordings contain nonzero audio. Audio device
|
||||
underruns: 56.7 ms of silence in one-player, 32.5 ms in four-player and 18.3 ms in
|
||||
the movie run. These are functional checks, not a performance or flawless-playback
|
||||
claim. The other special weapons in actual play, full campaign and physical controller/hardware acceptance remain open.
|
||||
@@ -0,0 +1,90 @@
|
||||
# Native sphere/LOD and collision helper calculations
|
||||
|
||||
The subsequent [hierarchy helper increment](NATIVE_HIERARCHY_HELPERS.md) adds twelve more returns,
|
||||
with generated consumer tails and a paired trace of height-BSP temporary W.
|
||||
|
||||
Three inline difference blocks now use native XYZ records: `hdSphereTest` at `1c6710`,
|
||||
`hdLodNode` at `1c69a0`, and the sphere overload at `1cadb8`. Their instruction ranges are
|
||||
`1c6714..1c6720`, `1c69bc..1c69c8`, and `1cadc4..1cadd0`. Together with the preceding
|
||||
[terrain/contact increment](NATIVE_TERRAIN_CONTACTS.md), the contact handler owns thirty blocks
|
||||
covering 162 instruction sites. It snapshots operands, computes XYZ once at the final store,
|
||||
preserves destination W, and leaves VU state untouched. The existing scalar sphere radius tests,
|
||||
LOD thresholds, selected-child metadata, return ABI and checkpoints remain compiled game code.
|
||||
|
||||
Six additional helper returns also use the existing audited native implementations:
|
||||
|
||||
| Helper | Return PCs | Consumer |
|
||||
|---|---|---|
|
||||
| Forward direction `1da298` | `1cb19c` | Collision node setup |
|
||||
| Inverse direction `1da1e8` | `1cb1e4`, `1cb4a4`, `1cb530` | Collision node point/normal setup |
|
||||
| Inverse direction `1da1e8` | `1cb770`, `1cb834` | Point-contact setup and scalar axis tests |
|
||||
|
||||
The inverse allowlist now has twenty entries; the forward-direction allowlist has nine.
|
||||
Inverse output matches all four components, including the first basis record's W. Forward output
|
||||
retains its established XYZ/preserved-destination-W contract. Historical hosts and unaudited
|
||||
returns retain the original complete helper ABI. This does not replace every remaining helper
|
||||
caller or all VU operations. Renderer hierarchy LOD calculation was already native in
|
||||
[the scene increment](NATIVE_SCENE.md); this change handles the separate collision LOD selector.
|
||||
BozoEngine remains pinned at `4a8f70a`; no engine or renderer change is included.
|
||||
|
||||
## Numerical and generated-caller checks
|
||||
|
||||
Evidence is local under `D:/BozoScratch/sphere-lod`, against main `90c9e21` (PR #24).
|
||||
Generated game code, disc data, captures and RAM dumps are excluded from the commit.
|
||||
|
||||
- The contact suite passes 983,040 original-block comparisons and 960 complete-memory checks.
|
||||
Existing scalar contact continuations retain 3,584 cases, 112 complete-memory checks and
|
||||
1,024 ordered-alias cases.
|
||||
- Another 6,144 complete generated sphere/LOD callers, including 48 complete-memory checks,
|
||||
exercise sphere class/minimum-radius branches, exact and neighbouring radius boundaries,
|
||||
LOD selection limits and metadata. Only the unused local difference W is normalized in the
|
||||
reference comparison. CPU state outside retired VU, complete outgoing host FP effects,
|
||||
clocks/checkpoints, decisions and other memory must match; native VU state must be untouched.
|
||||
- Another 3,072 generated helper-consumer sequences, with 96 complete-memory checks, exercise
|
||||
the six new return sites through their following scalar/vector setup or query boundary.
|
||||
Cases include zero/copy, normalization and unit-box axis branches. Inverse XYZW is exact;
|
||||
only the existing forward destination-W contract is normalized before continuation.
|
||||
These are bounded consumer sequences, not complete collision-query executions.
|
||||
- Checks cover four host rounding modes, denormal controls and RAM aliases. The hierarchy suite
|
||||
retains 786,432 helper cases, 384 complete-memory checks, 8,000 geometric edges, 1,024 recursive
|
||||
BSP callers and 2,048 unknown-caller ABI cases. Its historical-host coverage now rotates
|
||||
through all twenty inverse sites (1,280 cases, twenty complete-memory checks). Another 64
|
||||
cases/four complete-memory checks prove the new forward site's historical CPU/VU ABI.
|
||||
- Player, headless and historical checker builds, all eleven native suites and twelve Python
|
||||
tooling tests pass. Temporary diagnostics were removed; restored contact/forward compiled
|
||||
objects match their saved pre-diagnostic hashes, and all three binaries contain no trace markers.
|
||||
|
||||
## Gameplay, loading and movies
|
||||
|
||||
Default and strict routes complete 9,500 one-player and 8,500 actual four-player frames.
|
||||
Every non-RAM frame-record field matches the baseline throughout: scratchpad, library calls and
|
||||
counts, draws and counts, sound and sample counts, thread state and EE clock. Strict contact,
|
||||
hierarchy, math and projection comparisons pass and reproduce the default recording files
|
||||
byte-for-byte. A clean rebuild after diagnostic removal reproduces all four qualified recording
|
||||
files byte-for-byte. Default runs perform zero original comparisons and zero VU0 microprogram calls.
|
||||
|
||||
The three new inline blocks execute 1,283,655 / 54,166 times in one-player / four-player. All three
|
||||
are reached in one-player; four-player reaches only the sphere overload. The five new inverse
|
||||
sites execute 52,688 / 13,904 times; the new forward site executes 9,779 / 140 times. Thus the
|
||||
six helper sites retire another 62,467 / 14,044 original helper executions. These are execution
|
||||
counts, not timing or FPS measurements.
|
||||
|
||||
RAM hashes differ on 2,242 one-player frames (5593 through 9499) and 3,798 four-player frames
|
||||
(4702 through 8499). A complete 32 MB snapshot at one-player frame 7000 is identical. At four-player
|
||||
frame 6000 exactly three bytes differ, in words `8ff0dc`, `8ff1fc` and `8ff35c`: baseline zero versus
|
||||
native integer bits 9. The first two are directly traced to unused sphere temporary W stores at
|
||||
`1cadd0`, returning to `1cb138` and `1ca85c`. The third is a reused stack word: loading writes the
|
||||
decompressor's scratch count there, and traversal also reuses it for matrix storage. Its complete
|
||||
last-write divergence chain has not been established. Consequently these snapshots do not prove
|
||||
every RAM difference harmless or every possible consumer covered. No new hash mask, padding
|
||||
restoration, shadow VU state or generated-code instrumentation is shipped. An additional snapshot
|
||||
requested at one-player frame 5593 is baseline-exact; strict/default snapshots are identical too.
|
||||
|
||||
Window runs complete 4,201 movie/menu frames and 6,501 frames each for one-player and four-player.
|
||||
Reviewed captures show decoded movies, loading, active Junkyard combat and four snow-arena views.
|
||||
Initial device logs report 447.8 / 57.7 / 39.4 ms of silence (movie / one-player / four-player).
|
||||
A clean movie-only rerun without concurrent builds completes 4,201 game frames with decoded
|
||||
captures and reports 22.4 ms of silence, three underruns and 1,712 dropped audio frames. This is
|
||||
additional device evidence, not proof of the cause of the initial underruns. Deterministic sound
|
||||
records match. Full campaign acceptance, flawless device audio and console visual parity remain
|
||||
unclaimed.
|
||||
@@ -0,0 +1,92 @@
|
||||
# Native suspension and tire-height transforms
|
||||
|
||||
Two hot vehicle calls of forward helper `1da298` now use the existing native XYZ
|
||||
calculation. The forward allowlist grows from 66 to 68; inverse coverage stays at
|
||||
82. BozoEngine remains pinned to `4a8f70a`.
|
||||
|
||||
| Return PC | Owner | Actual consumer |
|
||||
| --- | --- | --- |
|
||||
| `1888e8` | `suspCreateSuspensionMat` (`188738`) | Transformed Z contributes to suspension ride height at vehicle + `55c` |
|
||||
| `18b4c0` | `tireUpdateCarHeight` (`18b420`) | Pivot reconstruction, vehicle position and coordinate-system publication, then height smoothing/clamp |
|
||||
|
||||
The native transform snapshots its operands, writes XYZ and preserves destination
|
||||
W. It leaves VU registers, accumulator, flags and data memory untouched. Historical
|
||||
hosts and unknown callers retain the original complete ABI. Suspension angle/RPH
|
||||
matrix generation, tire pivot selection, scalar vector consumers, smoothing and
|
||||
physics remain compiled game code; this increment replaces their transform leaves.
|
||||
|
||||
## Generated consumers and numerical checks
|
||||
|
||||
Local evidence is under `D:/BozoScratch/suspension-tire`, compared with main
|
||||
`9156063` (PR #35). Generated code, retail assets and runtime captures stay outside Git.
|
||||
|
||||
- Both new consumer tails run through their actual generated return. Suspension
|
||||
consumes only output Z; tire-height consumes XYZ through real subtract/add/copy
|
||||
routines, including the coordinate-system position and height update. Their
|
||||
output W words are unused by these consumers. Meaningful coordinate-system W
|
||||
remains unchanged and is compared.
|
||||
- Added coverage is 1,024 sequences / 48 whole-memory comparisons, including 256
|
||||
complete tire-height entry calls / 16 whole-memory comparisons. These execute
|
||||
actual pivot selection, lowest-tire selection, input construction, transform and
|
||||
complete scalar tail. The remaining new cases enter at the transform boundary.
|
||||
Suspension angle/matrix production is outside the generated-consumer fixture.
|
||||
- Four host FP modes, RAM aliases, arbitrary W payloads, signed zero/subnormal and
|
||||
integer-adjacent suspension inputs, four tire selections, and values immediately
|
||||
around the -3 height clamp are covered. CPU outside retired VU, outgoing host FP
|
||||
effects, clocks/checkpoints and consumer memory agree. Native VU stays untouched.
|
||||
Original forward W is normalized only after the complete real consumer has run.
|
||||
- Aggregate consumer coverage is 61,952 sequences / 1,952 whole-memory comparisons.
|
||||
Historical forward coverage is 3,776 / 236; inverse coverage stays at 5,248 / 82.
|
||||
The hierarchy suite retains 786,432 helper cases / 384 whole-memory, 8,000 geometric
|
||||
edges, 1,024 complete recursive BSP callers / 32 whole-memory and 2,048 unknown ABI
|
||||
cases. The math suite retains 1,048,576 / 512 and 2,048 unknown ABI cases.
|
||||
- Player, headless, historical checker and all native test targets rebuild. All
|
||||
eleven native suites and twelve Python tooling tests pass.
|
||||
|
||||
## Gameplay, loading and movies
|
||||
|
||||
Default and strict runs complete 9,500 one-player and 8,500 actual four-player
|
||||
frames. All non-RAM frame fields match the preceding main: scratchpad, calls/counts,
|
||||
draws/counts, sound/sample counts, threads and EE clock. One-player RAM hashes match
|
||||
at every frame. Four-player has one RAM-hash difference, at recording frame 4702.
|
||||
Full 32 MB snapshots at one-player frame 7000 and four-player frame 6000 are exact.
|
||||
Strict contact, hierarchy, math and projection checks pass; their recordings and
|
||||
snapshots are byte-identical to default. Default performs zero original comparisons
|
||||
and zero VU0 microprogram calls; strict intentionally runs original oracles.
|
||||
|
||||
A focused paired replay localizes the transient difference to one stack word,
|
||||
`8ff2ec`: tire-height transform output `SP+1c`. The original writes inherited
|
||||
`VF16.w` (zero); native retains destination bits `0000000c`. Eight paired writes
|
||||
across two logical frames identify return `18b4c0` as the writer, at matching EE
|
||||
cycles. The generated tail's subtract/add/copy consumers read only XYZ. Paired
|
||||
observer recordings reproduce the qualified baseline/native prefixes exactly,
|
||||
and observer snapshots reproduce the corresponding one-word-difference snapshots.
|
||||
The snapshot uses graphics frame 4703; the differing recording index is 4702.
|
||||
This is a bounded unused-W difference, not raw-RAM identity or console parity.
|
||||
No production mask or VU-state reconstruction is introduced. Observer sources are
|
||||
restored, original math/hierarchy object hashes verified and clean binaries rebuilt.
|
||||
All eleven suites and both complete default/strict routes pass again after restoration;
|
||||
the player, headless and checker binaries contain no observer markers.
|
||||
|
||||
The two new native returns execute 61,829 times in one-player and 30,384 times in
|
||||
four-player. Total native forward counts are 1,060,013 / 260,479. These are reached
|
||||
call counts, not a measured speedup.
|
||||
|
||||
Fresh windowed routes complete 4,200 movie/menu frames and 6,500 frames each for
|
||||
one-player and actual four-player, through clean exit with isolated scratch user
|
||||
data. Reviewed captures show decoded movie pictures (frame 1000), Junkyard loading
|
||||
(one-player 4500), active combat (one-player 6300), and four advancing snow-arena
|
||||
views (four-player 5500/6300). All three stereo 48 kHz WAV recordings contain audio.
|
||||
Device logs report 26.1 / 64.2 / 36.6 ms of silence (movie / one-player / four-player),
|
||||
with underruns and dropped frames. Deterministic gameplay sound matches; flawless
|
||||
device audio, subjective listening and full campaign/console parity are not claimed.
|
||||
|
||||
## Remaining scope
|
||||
|
||||
The two helper inventories now contain 68 native forward and 82 native inverse
|
||||
sites. Outside those allowlists remain 201 forward and 52 inverse sites: 253 across
|
||||
the game, including sites inside otherwise replaced functions. This is a structural
|
||||
source inventory, not a live cost measurement, and excludes other helper families
|
||||
and inline VU operations. The previously closed narrow hierarchy/terrain direct-call
|
||||
inventory remains closed. Other helpers, particle/camera callers, full campaign
|
||||
acceptance and console visual parity remain separate work.
|
||||
@@ -0,0 +1,89 @@
|
||||
# Native inline terrain and contact calculations
|
||||
|
||||
The subsequent [sphere/LOD increment](NATIVE_SPHERE_LOD.md) extends this handler to thirty blocks
|
||||
and replaces six additional collision hierarchy helper returns.
|
||||
|
||||
The player now calculates all 27 inline vector blocks in these four collision owners from native
|
||||
matrix/vector records. There are no VU register loads, arithmetic, accumulator/flag updates or
|
||||
register stores on these block paths. The 150 retired instruction sites include 48 arithmetic VU
|
||||
operations. Other code in these functions remains compiled, including branches, allocation/result
|
||||
bookkeeping, scalar query consumers and calls to separately implemented helpers.
|
||||
|
||||
| Owner | Blocks | Calculations |
|
||||
| --- | ---: | --- |
|
||||
| `hdColNode` (`1cb0d8`) | 8 | Two basis products and six point/offset sums |
|
||||
| `hdColNodeCheckPt` (`1cb690`) | 8 | Two basis products, five sums and one difference |
|
||||
| `hdRayTest` (`1cbd00`) | 8 | Two basis products, five differences and one sum |
|
||||
| `hdTerrain` (`1cc7a0`) | 3 | Basis products with translation for terrain query points |
|
||||
|
||||
`tmb_contact_math.h` names each input/output record boundary. The last instruction of each block
|
||||
reads its current records, snapshots aliased inputs, calculates separately rounded XYZ and writes
|
||||
only those twelve bytes. An earlier block can change a later block's inputs; no result or register
|
||||
image is cached across blocks, branches or scheduler continuations. Destination W remains its
|
||||
existing payload. The complete CPU/VU context and host FP control state are unchanged by a block.
|
||||
The historical checker still executes the original instructions. `TMB_NATIVE_CONTACT_CHECK=1`
|
||||
compares native XYZ against independent original blocks extracted from fresh generated output;
|
||||
those diagnostics and game instruction bodies stay in the build tree.
|
||||
|
||||
BozoEngine remains at the qualified `4a8f70a`. This does not remove the remaining sphere/LOD inline
|
||||
math, unaudited inverse/helper entries, scalar collision algorithms or all VU emulation globally.
|
||||
|
||||
## Numerical and continuation validation
|
||||
|
||||
The local evidence directory is `D:/BozoScratch/terrain-contacts`; final expanded runs use the
|
||||
`final27-` prefix. The baseline is main `75b6b35` (PR #23). Earlier unprefixed files record the
|
||||
initial nineteen-block increment, before the downstream ray-result builder was included.
|
||||
|
||||
- `tmb-native-contact-tests` passes 884,736 comparisons against actual generated instruction blocks
|
||||
and 864 complete flat-memory checks. Cases include arbitrary/extreme number bits, signed zero,
|
||||
denormals, four host FP modes, denormal controls, record overlap, RAM aliases, low address bits
|
||||
and scratchpad. Native CPU/VU state, complete host MXCSR and destination W must remain untouched.
|
||||
- Another 1,024 ordered alias cases overwrite a later point input or basis column before its
|
||||
calculation. Each reference block adopts the same explicit destination-W contract.
|
||||
- 3,584 generated continuation cases and 112 full-memory checks execute seven scalar boundaries:
|
||||
terrain point setup through zero-buffer dispatch, terrain point pairs through quick-height query
|
||||
dispatch, node/point contact setup through the next inverse query, ray setup through normalization
|
||||
dispatch, and the complete ray-contact result-building tail through metadata writes and epilogue.
|
||||
CPU, clocks/checkpoints, complete outgoing FP effects and other memory match outside retired VU
|
||||
and destination-W effects. Native VU state stays unchanged through each tested continuation.
|
||||
These are bounded segments, not complete end-to-end collision-algorithm replacements.
|
||||
- Player, headless and historical checker build. All eleven native suites and twelve Python
|
||||
release-tool tests pass. Generated instruction fixtures and test inputs require the local game
|
||||
ELF; they are not committed or run by the game-free GitHub CI jobs.
|
||||
|
||||
## Gameplay and RAM boundary
|
||||
|
||||
Default and strict one-player runs complete 9,500 frames; actual four-player runs complete 8,500.
|
||||
Every non-RAM frame-record field matches the baseline throughout both routes: scratchpad, library
|
||||
calls and counts, draws and counts, sound and sample counts, thread state and EE clock. Default
|
||||
runs perform no original comparisons and no VU0 microprogram calls. Strict contact, math, hierarchy
|
||||
and projection comparisons pass, reproducing both default recording files byte-for-byte.
|
||||
|
||||
The native blocks execute 609,504 times in one-player and 254,389 times in four-player. All 27 run
|
||||
in one-player; four-player exercises 26 (the alternate point sum ending `1cb904` is absent).
|
||||
These are execution counts, not a timing or FPS measurement.
|
||||
|
||||
Raw RAM hashes differ on 3,907 one-player frames (starting at 5593) and 3,798 four-player frames
|
||||
(starting at 4702). Complete 32 MB snapshots at one-player frame 7000 and four-player frame 6000
|
||||
differ by 72 bytes in 35 words / 15 bytes in six words, respectively. Every differing word is a
|
||||
fourth vector component:
|
||||
|
||||
- One-player has 27 contact-position W words in the vehicle `b10` result arrays and one cached
|
||||
contact-position W at Vehicle+`1e8c`. Those change from inherited 60.0 to zero. The cache copy
|
||||
is the retained scalar Z/W load/store at `189f98`/`189f9c`; it copies the preceding contact record.
|
||||
- Four query-vector W words at `5253bc`/`5253cc`/`5253dc`/`5253ec` and three stack-vector W words
|
||||
account for the remaining one-player differences. Four-player differs in `5253ec` and five
|
||||
stack-vector W words. Existing destination payloads survive where the old block stored VU residue.
|
||||
- The terrain-to-contact copy chain documented in [the inverse increment](NATIVE_BSP_INVERSES.md)
|
||||
remains compiled. Native terrain XYZ calculations stop injecting the inherited VF16.W into that
|
||||
chain. The prior generated body-result XYZ consumer test still passes with arbitrary input W.
|
||||
|
||||
The snapshot classification is bounded evidence, not a claim that every raw RAM byte is identical
|
||||
or that every possible campaign consumer has been exercised. No new memory-hash mask, padding
|
||||
restoration, shadow VU state or generated-code instrumentation is used for this change.
|
||||
|
||||
Window qualification covers 4,201 movie/menu frames and 6,501 frames each for one-player and
|
||||
four-player. Reviewed captures show decoded movie pictures, level loading, rainy combat and four
|
||||
advancing snow-arena views. Device logs report 23.8 / 60.6 / 35.8 ms of silence (movie / one-player /
|
||||
four-player), with dropped frames and underruns; deterministic sound records match.
|
||||
Full-campaign acceptance, flawless device audio and console visual parity remain unclaimed.
|
||||
@@ -0,0 +1,90 @@
|
||||
# Native terrain debug, edit and wave transforms
|
||||
|
||||
Eight more inverse-helper returns use native record calculations, extending the
|
||||
[car/particle increment](NATIVE_CAR_PARTICLE_HELPERS.md). The inverse allowlist grows from
|
||||
74 to 82; the forward list stays at 66. BozoEngine remains pinned to `4a8f70a`.
|
||||
|
||||
| Return PCs of inverse helper `1da1e8` | Owner |
|
||||
|---|---|
|
||||
| `1f5414`, `1f5458` | Terrain grid-space debug line `1f53e0` |
|
||||
| `1f54f4`, `1f5538` | Terrain grid-space two-colour line `1f54b8` |
|
||||
| `1f55d4`, `1f5618` | Terrain grid-space debug box `1f55a0` |
|
||||
| `1f56a8` | Terrain modification coordinates `1f5678` |
|
||||
| `1f5904` | Terrain wave coordinates `1f5898` |
|
||||
|
||||
The existing native inverse snapshots operands before overlapping writes, preserves exact
|
||||
output XYZW (including meaningful basis[0].W), and leaves VU registers, accumulator, flags
|
||||
and data memory untouched. Historical hosts and unknown callers retain the complete original
|
||||
ABI. Scalar translation, debug records, grid indexing, input polling, wave metadata/type
|
||||
dispatch and game checkpoints remain compiled game code.
|
||||
|
||||
## Generated consumers and numerical checks
|
||||
|
||||
Local evidence is under `D:/BozoScratch/hierarchy-terrain-final`, against main `199d9a6` (PR #34).
|
||||
Generated game code, retail assets, recordings, snapshots and captures are excluded from Git.
|
||||
|
||||
- Consumer coverage grows from 56,832 to 60,928 sequences and from 1,776 to 1,904 whole-memory
|
||||
comparisons: 4,096 / 128 added. Four host rounding modes, denormal controls, RAM aliases
|
||||
and arbitrary meaningful W payloads remain covered. CPU outside retired VU, outgoing host
|
||||
FP effects, clocks/checkpoints and memory match exactly; native VU stays untouched.
|
||||
- Paired debug endpoints run both inverse transforms and scalar world sums through the real
|
||||
line or two-colour vertex builder and actual `drawLines` dispatch. The box also runs real
|
||||
corner construction and its first line producer to the same dispatch. Complete colour RGBA
|
||||
and vertex XYZW are compared; rendering and subsequent box edges remain outside the fixture.
|
||||
- The compared debug region expands to `7484f0`–`74870f`, covering the actual two-colour line
|
||||
records. The actual input-map word `66fcc4` is also initialized/restored/compared. The fixture
|
||||
uses a common region table; all older consumers rerun with the expanded memory checks.
|
||||
- Terrain editing runs to return: translated XYZ, actual integer conversion/row-stride cell
|
||||
lookup, protected-cell branch, and real `inputGetInput` disabled-device branches. Both
|
||||
protected and unprotected cells are covered on a 9x9 grid, with coordinates around integer
|
||||
boundaries, zero and a subnormal. Button-driven height changes remain outside this fixture.
|
||||
- Wave inputs use the actual six-entry type table: types 0/1/4/5 run scalar translation and
|
||||
the real rounded bounds/extent metadata to timer dispatch; type 2 reaches undulate dispatch,
|
||||
and type 3 reaches the random-number dispatch before shock-wave work. Four wave slots,
|
||||
radii 0/0.25/0.5/1/9.5/10.5, signed integer-adjacent coordinates and general bases are covered.
|
||||
Timer input, special-wave effects and later height-cache population are outside the fixture.
|
||||
- Historical inverse coverage grows from 4,736 / 74 to 5,248 / 82 cases / whole-memory checks.
|
||||
Forward coverage stays at 3,648 / 228. The hierarchy suite retains 786,432 helper cases / 384
|
||||
whole-memory, 8,000 geometric edges, 1,024 complete recursive BSP callers / 32 whole-memory
|
||||
and 2,048 unknown-caller ABI cases. The math suite retains 1,048,576 cases / 512 whole-memory
|
||||
and 2,048 unknown-caller ABI cases.
|
||||
- Player, headless, historical-checker and every native test target rebuild successfully;
|
||||
all eleven native suites and twelve Python tooling tests pass.
|
||||
|
||||
## Gameplay, loading and movies
|
||||
|
||||
Default and strict runs complete 9,500 one-player and 8,500 actual four-player frames.
|
||||
Each complete default recording is byte-identical to the preceding main, including RAM,
|
||||
scratchpad, library calls/counts, draws/counts, sound/sample counts, threads and EE clock.
|
||||
Full 32 MB snapshots at one-player frame 7000 and four-player frame 6000 are exact too.
|
||||
Strict contact, hierarchy, math and projection checks pass; their recordings and snapshots
|
||||
are byte-identical to default. Default runs perform zero original comparisons and zero VU0
|
||||
microprogram calls; strict diagnostic runs intentionally execute original oracles.
|
||||
|
||||
All eight new inverse counters remain zero in both default and strict routes. These sites
|
||||
have generated-consumer, numerical and historical-ABI coverage without live-route reach.
|
||||
This increment does not claim retired gameplay executions or a measured speedup.
|
||||
|
||||
Fresh windowed runs complete the configured 4,200-frame movie/menu route and 6,500-frame
|
||||
one-player and actual four-player routes through clean exit, using isolated scratch user data.
|
||||
Reviewed captures show decoded movie pictures, Junkyard loading, active one-player gameplay
|
||||
and four advancing snow-arena views. Device logs report 17.7 / 42.4 / 76.2 ms of silence
|
||||
(movie / one-player / four-player), with underruns and dropped frames. Deterministic sound
|
||||
remains exact; flawless device audio, full campaign and console visual parity remain unclaimed.
|
||||
|
||||
## Remaining scope
|
||||
|
||||
A structural scan of the two helpers now counts 66 native forward and 82 native inverse
|
||||
sites. Outside their allowlists remain 203 forward and 52 inverse sites, 255 in total across
|
||||
the game, including code inside otherwise replaced functions. This is a source inventory,
|
||||
not a live cost measurement, and excludes other helper families and inline VU operations.
|
||||
|
||||
Within the narrow hierarchy/collision owner range `1c0000`–`1dffff` and terrain range
|
||||
`1ef000`–`1f5fff`, every direct call to these two transform helpers is now native. Other
|
||||
helpers, inline VU, full campaign acceptance and console visual parity remain separate work.
|
||||
|
||||
The qualified routes still execute 193,096 / 151,213 original forward calls outside those
|
||||
ranges in one-player / four-player. Active candidates include suspension return `1888e8`,
|
||||
tire-height return `18b4c0`, particle emission `1e4818`, and camera returns `113f28` / `1142d8` /
|
||||
`114394`. Their W/state consumers require separate audits before native routing. These are
|
||||
reach counts, not timing measurements; local caller/owner evidence is in `remaining-forward-reach.json`.
|
||||
@@ -0,0 +1,102 @@
|
||||
# Native terrain bounds and query-input transforms
|
||||
|
||||
Eleven further inverse-helper returns use the existing native record calculation. The inverse
|
||||
allowlist grows from fifty-three to sixty-four entries; the forward list stays at fifty-two.
|
||||
This extends the [point/ray increment](NATIVE_POINT_RAY_HELPERS.md). BozoEngine stays at
|
||||
`4a8f70a`; no engine or renderer change is included.
|
||||
|
||||
| Return PCs of inverse helper `1da1e8` | Owner |
|
||||
|---|---|
|
||||
| `1ef318` | Terrain animated-node setup `1ef090` |
|
||||
| `1ef44c`, `1ef484`, `1ef4c0`, `1ef4fc` | Terrain-node corner bounds `1ef3c0` |
|
||||
| `1ef68c`, `1ef6d4` | Terrain-node height extrema `1ef3c0` |
|
||||
| `1efc5c`, `1efca0` | Terrain height-query endpoints `1efb98` |
|
||||
| `1efef8` | Quick height-query coordinates `1efe10` |
|
||||
| `1f06b4` | Material-query coordinates `1f0550` |
|
||||
|
||||
Native leaves snapshot operands before overlapping writes, retain separately rounded XYZ
|
||||
arithmetic and leave VU registers, accumulator, flags and data memory untouched. All output
|
||||
XYZW matches the original, including meaningful basis[0].W. Historical hosts and unknown
|
||||
callers retain the complete original helper ABI. Scalar height scans, bounds publication,
|
||||
integer grid math, traversal/query dispatch, clocks and checkpoints remain compiled game code.
|
||||
Other helper returns and inline VU operations remain; this is not complete VU removal.
|
||||
|
||||
## Generated consumers and numerical checks
|
||||
|
||||
Local evidence is under `D:/BozoScratch/hierarchy-terrain-inputs`, against main `279e3a1` (PR #31).
|
||||
Generated game code, disc data, recordings, RAM dumps and captures are excluded from the commit.
|
||||
|
||||
- The consumer harness grows from 38,912 to 44,544 sequences and from 1,216 to 1,392 whole-memory
|
||||
comparisons (5,632 / 176 added). Four host FP modes, denormal controls, RAM aliases and arbitrary
|
||||
W payloads are covered. CPU outside retired VU, outgoing host FP effects, clocks/checkpoints and
|
||||
other memory match exactly; native VU remains untouched.
|
||||
- Terrain-node continuations run through return: corner transformation/addition, scalar XY
|
||||
minima/maxima, actual unsigned-height scan, transformed height extrema, per-node table writes
|
||||
and aggregate bounds. Width/height 0, 1, 2 and 3, first/subsequent node publication and heights
|
||||
0, `561e`, `561f`, `ffff` exercise empty grids and the original minimum-height sentinel.
|
||||
- The compared fixture region now starts at `4c0000` rather than `4d0000`, retaining the same
|
||||
upper bound and explicitly covering the terrain bounds table at `4ce290`. All older consumer
|
||||
cases rerun with this expanded memory comparison; complete flat-memory checks remain too.
|
||||
- Animated-node continuations run packed material/state publication and either return or stop
|
||||
at the actual child-push boundary. Height endpoints retain real context translation, paired
|
||||
transforms and integer-cell arguments before the terrain-cell query dispatch.
|
||||
- Quick-height/material continuations retain context translation, valid-grid bounds checks and
|
||||
integer coordinate conversion through the real row-stride multiplication dispatch. Identity
|
||||
bases and stored values adjacent to integer 1 and 7, zero and a positive subnormal are covered.
|
||||
Complete terrain-cell/interpolation queries remain outside those bounded fixtures.
|
||||
- Historical inverse checks cover all sixty-four returns: 4,096 cases / 64 whole-memory checks.
|
||||
Historical forward checks remain 2,752 / 172. The hierarchy suite retains 786,432 helper cases,
|
||||
384 whole-memory checks, 8,000 geometric edges, 1,024 recursive BSP callers / 32 whole-memory
|
||||
checks and 2,048 unknown-caller ABI cases.
|
||||
- The math suite retains 1,048,576 helper cases, 512 whole-memory checks and 2,048 unknown-caller
|
||||
ABI cases, including overlap, alignment, aliases and scratchpad coverage.
|
||||
- Player, headless and historical checker builds, all eleven native suites and twelve Python
|
||||
tooling tests pass.
|
||||
|
||||
## Gameplay, loading and movies
|
||||
|
||||
Default and strict routes complete 9,500 one-player and 8,500 actual four-player frames. Strict
|
||||
contact, hierarchy, math and projection checks pass; strict/default recordings and snapshots
|
||||
are byte-identical. Every non-RAM frame-record field matches baseline throughout: scratchpad,
|
||||
calls/counts, draws/counts, sound/sample counts, thread state and EE clock. Default runs perform
|
||||
zero original comparisons and zero VU0 microprogram calls.
|
||||
|
||||
The six terrain-node returns execute once each in both routes. Material-query return `1f06b4`
|
||||
executes 500,428 / 250,178 times in one-player / four-player, retiring 500,434 / 250,184 helper
|
||||
executions in total. Animated-node, paired height-query and quick-height returns have generated-
|
||||
consumer/historical coverage without live-route coverage. These are counts, not timing or FPS
|
||||
measurements.
|
||||
|
||||
RAM hashes differ on 3,906 one-player frames (5593–9499) and 3,797 four-player frames
|
||||
(4703–8499). The complete 32 MB snapshots at one-player frame 7000 and four-player frame 6000
|
||||
differ by four and nine bytes respectively, in two and three fourth-component words.
|
||||
|
||||
- One-player `4a26dc`: the original forward at BurnMan spawn return `112524` stores inherited
|
||||
VF16.W, baseline `42700000` versus native zero. Its following scalar vector addition consumes
|
||||
XYZ. This forward remains outside the native allowlist and retains its complete original ABI.
|
||||
- One-player `40a85c`: `AmbientSoundManager::requestScream` copies that same position from
|
||||
`4a26d0` into its position record with two 64-bit stores. A direct copy observer confirms the
|
||||
changed high word at destination `40a85c` at identical cycle 35028251672 in both runs.
|
||||
- Four-player `3a7d9c`, `3a7dac`, `3a7dbc`: the original camera forward at return `113f28`
|
||||
stores inherited VF16.W, baseline `42b20000` versus native `c51bc000`. All 11,391 watched calls
|
||||
pair at identical cycles, 3,797 for each field. The following scalar vector sums consume XYZ.
|
||||
This forward also retains the original complete ABI.
|
||||
|
||||
Retiring the inverse's VU clobbers changes the register payload later original forwards inherit;
|
||||
the new inverses' actual output XYZW remains exact. All observer recordings and snapshots
|
||||
reproduce their qualified baseline/native files byte-for-byte in both routes, including a
|
||||
separate one-player sound-position copy trace. This is bounded source/write/snapshot evidence,
|
||||
not a classification of every RAM difference or possible campaign consumer.
|
||||
|
||||
Observers were removed and restored sources forced to rebuild. The native math, hierarchy and
|
||||
generated objects match their original qualified hashes; all three executables contain no
|
||||
observer markers. All eleven native suites pass again. Final clean default replays reproduce
|
||||
both complete qualified recordings and snapshots byte-for-byte. No padding restoration, hash
|
||||
mask or shadow VU state is shipped.
|
||||
|
||||
Fresh windows complete the configured 4,200-frame movie/menu route and 6,500-frame one-player
|
||||
and actual four-player routes through clean exit. Reviewed captures show decoded movie pictures,
|
||||
Junkyard loading and active rainy gameplay, and four advancing snow-arena views. Device logs
|
||||
report 22.2 / 51.2 / 30.1 ms of silence (movie / one-player / four-player), with underruns and
|
||||
dropped frames. Deterministic sound matches. Flawless device audio, full campaign acceptance
|
||||
and console visual parity remain unclaimed.
|
||||
@@ -0,0 +1,115 @@
|
||||
# Native terrain LOS, cell and ray transforms
|
||||
|
||||
Ten further inverse-helper returns use native record calculations, extending the
|
||||
[terrain-input increment](NATIVE_TERRAIN_INPUT_HELPERS.md). The inverse allowlist grows
|
||||
from 64 to 74; the forward list stays at 52. BozoEngine remains at `4a8f70a`.
|
||||
|
||||
| Return PCs of inverse helper `1da1e8` | Owner |
|
||||
|---|---|
|
||||
| `1f11a8`, `1f11ec` | Terrain line-of-sight endpoint setup `1f10c0` |
|
||||
| `1f1b88`, `1f1c38` | Terrain line-of-sight result reconstruction `1f10c0` |
|
||||
| `1f2480`, `1f24c0` | Terrain cell BSP endpoint setup `1f2370` |
|
||||
| `1f2e4c`, `1f2ef8` | Terrain cell result reconstruction `1f2370` |
|
||||
| `1f3110`, `1f315c` | Terrain ray grid endpoints `1f30a0` |
|
||||
|
||||
The existing native inverse calculation preserves all output XYZW, including meaningful
|
||||
basis[0].W, without VU register, accumulator, flag or data-memory state. Overlapping operands
|
||||
are captured before writes. Historical hosts and unknown callers keep the complete original
|
||||
helper ABI. Translation, grid walking, scalar intersection tests, normalization, metadata,
|
||||
query dispatch and checkpoints remain compiled game code.
|
||||
|
||||
## Numerical and generated-consumer checks
|
||||
|
||||
Local evidence is under `D:/BozoScratch/hierarchy-terrain-los`, against main `c4afff2` (PR #32).
|
||||
Generated code, retail assets, recordings, RAM dumps and captures are excluded from Git.
|
||||
|
||||
- The consumer harness grows from 44,544 to 49,664 sequences and from 1,392 to 1,552
|
||||
whole-memory checks. Four host rounding modes, denormal controls, RAM aliases and W
|
||||
payloads remain covered. CPU outside retired VU, outgoing host FP effects, clocks,
|
||||
checkpoints and memory match; native VU is untouched.
|
||||
- Paired LOS/ray endpoint tests retain both inverse transforms and real context translations
|
||||
through segment-subtraction dispatch. They do not run the complete grid walk.
|
||||
- Cell BSP inputs run both transforms, translation and actual segment record publication,
|
||||
including the indexed BSP pointer lookup, through real BSP query dispatch.
|
||||
- LOS result tails retain translated position copy, normal construction, actual normalization,
|
||||
normal copy and distance publication through debug-normal draw dispatch.
|
||||
- Cell result tails run to return, including translated position/meaningful W copy, normal
|
||||
normalization, distance and packed result flags. Both result branches are exercised.
|
||||
- Historical inverse coverage grows to 4,736 cases / 74 whole-memory checks. Forward coverage
|
||||
stays at 2,752 / 172. The hierarchy suite retains 786,432 helper cases / 384 whole-memory,
|
||||
8,000 geometric edges, 1,024 complete recursive BSP callers / 32 whole-memory and 2,048
|
||||
unknown-caller ABI cases. The math suite retains 1,048,576 helper cases / 512 whole-memory
|
||||
and 2,048 unknown-caller ABI cases.
|
||||
- Player, headless and historical-checker builds, all eleven native suites and twelve Python
|
||||
tooling tests pass. All eleven native suites pass again after removing local observers.
|
||||
|
||||
## Gameplay, loading and movies
|
||||
|
||||
Default and strict runs complete 9,500 one-player and 8,500 actual four-player frames.
|
||||
Strict contact, hierarchy, math and projection comparisons pass; strict/default recordings
|
||||
and snapshots are byte-identical. All non-RAM frame fields match the preceding main throughout:
|
||||
scratchpad, library calls/hash/counts, draws/hash/counts, sound/hash/sample counts, threads and
|
||||
EE clock. Default runs make zero original comparisons and zero VU0 microprogram calls.
|
||||
|
||||
| New return | One-player executions | Four-player executions |
|
||||
|---|---:|---:|
|
||||
| `1f2480`, `1f24c0` | 3,319 each | 435,307 each |
|
||||
| `1f2e4c` | 931 | 0 |
|
||||
| `1f2ef8` | 828 | 0 |
|
||||
| `1f3110`, `1f315c` | 192,000 each | 140,024 each |
|
||||
| **Total** | **392,397** | **1,150,662** |
|
||||
|
||||
The four LOS returns have generated-consumer and historical coverage without live reach in
|
||||
these routes. These are helper execution counts, not a measured speedup.
|
||||
|
||||
RAM hashes differ on 3,769 one-player frames (5731–9499) and 3,797 four-player frames
|
||||
(4703–8499). Full 32 MB snapshots at frames 7000 / 6000 differ by 62 / 9 bytes in 31 / 3
|
||||
fourth-component words. Paired temporary observers identify the original helpers writing them:
|
||||
|
||||
- One-player `26bb7c`: peeling-out forward return `1abd60`, output at Vehicle+`520`.
|
||||
Its inherited VF16.W is `c4f00000` in the sampled baseline versus zero natively. The
|
||||
audited later vehicle-coordinate sum consumes XYZ via the already-native vehicle block.
|
||||
- One-player `4062ec`–`40640c` and `406e0c`–`406e9c`, stride 16: debris velocity vectors
|
||||
written by the original `BlowDebris` forwards `120838` / `1209a0`. Sampled W is `42700000`
|
||||
or `c4f00000` versus zero. `Debris::Update` reads velocity XYZ at offsets `120`/`124`/`128`
|
||||
for scalar integration; its fourth component is not part of those calculations.
|
||||
- One-player `8fefdc`: shared stack temporary, last written by original debris forward
|
||||
`1208dc`; sampled W is `42700000` versus zero. Immediate position reconstruction reads
|
||||
XYZ. The same address also receives native ray inverse output earlier, whose W agrees.
|
||||
- Four-player `3a7d9c`, `3a7dac`, `3a7dbc`: original camera forward return `113f28`.
|
||||
All 11,391 watched writes pair at identical cycles, 3,797 per field, with inherited W
|
||||
`c51bc000` versus zero; following scalar vector additions consume XYZ.
|
||||
|
||||
The one-player traces pair all 92 watched calls at identical cycles, with 57 differing W
|
||||
writes: six peeling-out, 34 / seven debris-velocity and ten debris-temporary writes. Every one
|
||||
of the 31 differing snapshot words equals its last watched helper write before the snapshot
|
||||
in both runs. All four observer recordings and snapshots reproduce the corresponding qualified
|
||||
baseline/native files byte-for-byte. Those original forwards remain outside the allowlist and
|
||||
retain their complete ABI. Retiring inverse VU clobbers changes the payload they later inherit;
|
||||
the newly native inverses' output XYZW is exact.
|
||||
|
||||
This is bounded writer/consumer/snapshot evidence, not a classification of all RAM differences
|
||||
or all possible campaign consumers. No W restoration, memory-hash mask or shadow VU is added.
|
||||
Observers were removed; original qualified math/hierarchy object hashes were restored and the
|
||||
player, headless and checker executables contain no observer markers. Fresh observer-free
|
||||
default replays reproduce both complete qualified recordings and snapshots byte-for-byte.
|
||||
|
||||
Fresh windowed runs complete the configured 4,200-frame movie/menu route and 6,500-frame
|
||||
one-player and actual four-player routes through clean exit, using isolated scratch user data.
|
||||
Reviewed captures show decoded movie pictures, Junkyard loading, active one-player gameplay
|
||||
and four advancing snow-arena views. Device logs report 20.8 / 37.9 / 38.6 ms of silence
|
||||
(movie / one-player / four-player), with underruns and dropped frames. Deterministic sound is
|
||||
exact; flawless device audio, full campaign acceptance and console visual parity remain unclaimed.
|
||||
|
||||
## Remaining scope
|
||||
|
||||
A structural scan of direct generated call sites before this increment counted 269 forward
|
||||
and 134 inverse sites for these two helpers, of which 52 / 64 were native. This increment
|
||||
leaves 217 / 60 sites outside their allowlists, 277 in total. This is a source inventory,
|
||||
including paths inside otherwise replaced functions, not a live cost or speedup measurement.
|
||||
It excludes other helper families and inline VU operations.
|
||||
|
||||
Within owners in the hierarchy/collision range `1c0000`–`1dffff` and terrain range
|
||||
`1ef000`–`1f5fff`, 22 sites remain: twelve older `hdCarTest` forward returns, two
|
||||
`hierParticleNode` forward returns, six debug terrain drawing inverses, and the terrain
|
||||
modify/wave setup inverses. This is not complete VU removal or campaign/console parity.
|
||||
@@ -0,0 +1,81 @@
|
||||
# Native texture consumer inputs
|
||||
|
||||
The subsequent [native upload-link increment](NATIVE_TEXTURE_UPLOADS.md) replaces the separate upload
|
||||
leaf at its audited callers. The evidence below records the earlier texture-input increment.
|
||||
|
||||
The traversal's texture activation path now reads its parameters directly from the source object.
|
||||
This removes the last three `pktAddVu1ObjAsm` payload stores (`1eabd0`, `1eabd4`, `1eabd8`) that the
|
||||
[previous increment](NATIVE_OBJECT_PACKETS.md) retained. The complete per-object builder now emits no
|
||||
output packet bytes in the native player. Its scalar source-copy loops, context results and cursor/cache
|
||||
bookkeeping remain. BozoEngine stays at `4a8f70a`; the earlier player release is unchanged.
|
||||
|
||||
## Producer and consumer boundary
|
||||
|
||||
Both assembly traversals enqueue an object and a cursor for its old texture copy. Their four audited
|
||||
texture-helper returns are `1d330c`, `1d3340`, `1d2d84` and `1d2db8`. At those returns, the native input
|
||||
handler resolves the object and texture index from the game's actual queue and saved helper frame.
|
||||
The source qword alignment matches the original builder's aligned loads.
|
||||
|
||||
Four reads in `texmGetTextureAddrs`/`texmActivateTexture` use the original base/filter/flag fields directly.
|
||||
Six writes that only patched the retired copy or its mip table are skipped. The filtering read and
|
||||
zero-texture patch are branch delay-slot sites `1f9130` and `1f9158`; the native guards run at those
|
||||
instructions, preserving their enclosing branches. Unknown callers, the C builder's `1d3afc` return,
|
||||
and the historical checker retain the original complete behavior.
|
||||
|
||||
The input handler has no binding, cached parameter image, packet-address map or register shadow.
|
||||
Activation and mip helpers validate their own saved return before resolving the enclosing texture
|
||||
helper's frame. Consequently, the handler can run from a suspended/resumed context without relying
|
||||
on an earlier native function invocation or a live C++ local. Each read uses the owning runtime's memory.
|
||||
|
||||
The game's allocation, eviction, resident flags, last-used counters, loaded-texture updates and upload
|
||||
cursor still execute in the original statically compiled helper chain, with unchanged checkpoints.
|
||||
`pktAddVu1Tex` still builds its separate upload link. Those scalar helpers and that separate builder are
|
||||
remaining work; this increment removes the per-object copy/read/patch transport, not the texture manager.
|
||||
The native renderer continues to use its existing texture pack and material records.
|
||||
|
||||
## Validation
|
||||
|
||||
Evidence: `D:/BozoScratch/texture-inputs`, against main `3fd4257`, using the same USA disc, engine and
|
||||
input scripts. All game runs have private user folders. These are functional checks, without a
|
||||
performance or full-campaign claim.
|
||||
|
||||
- The new `tmb-native-texture-input-tests` executes the actual generated consumer, activation,
|
||||
allocator, eviction, last-used, mip and upload-tag helpers. 8,192 cases pass across four host FP modes,
|
||||
all four returns, object word alignments, texture formats, zero IDs, resident/new/evicted textures,
|
||||
zero through seven mip levels and filtering switches. Complete CPU/context/host control, stack,
|
||||
source data, texture-manager state and cursors match outside the sole retired 48-byte texture output.
|
||||
There are 32 complete flat-memory checks; all ten new instruction sites are reached.
|
||||
- 268 cases use an inaccessible texture output pointer: the helper completes without a device access,
|
||||
with identical manager/loaded-texture state and upload cursor. 136 fallback cases retain the original
|
||||
caller/historical ABI. Another 320 reconstructed-context cases cover every site, return, object word
|
||||
alignment and two independent runtime owners, without any prior producer or scoped binding.
|
||||
- The existing object-builder suite now checks all 41 output stores plus three RGB reads, with the
|
||||
complete output arena untouched. Its 8,192 cases, 32 full-memory checks and 1,158 inaccessible-output
|
||||
cases pass, including textured cases previously excluded by the retained producer.
|
||||
- All nine native suites and 12 release-tool tests pass; player, headless and historical checker build.
|
||||
- Default 1P (9,500 frames) and actual 4P (8,500) match main on every non-RAM field: scratchpad, draws
|
||||
and counts, sound and samples, calls, threads and EE clocks. Default VU0 program counts remain zero.
|
||||
Strict/default recordings are byte-identical. No hash mask is widened. RAM hashes differ on
|
||||
9,496 / 8,496 frames.
|
||||
- The two default routes perform 526,557 / 484,986 direct texture reads and skip 398,778 / 273,524
|
||||
obsolete texture patches. Total per-object stores retired are 34,979,313 / 49,034,910; the three
|
||||
newly retired copy stores account for 4,887,132 / 7,651,320 of those.
|
||||
|
||||
Full 32 MB snapshots at 1P frame 7,000 and 4P frame 6,000 isolate every differing byte to these buffers,
|
||||
with zero differences elsewhere:
|
||||
|
||||
| Half-open interval | 1P differing bytes | 4P differing bytes |
|
||||
| --- | ---: | ---: |
|
||||
| `564a80..5eca80` (`hierObjPkt`) | 689 | 613 |
|
||||
| `5eca80..630a80` (`hierObjPkt2`) | 29,303 | 15,482 |
|
||||
| `630a80..64ea80` (`hierAlphaPkt`) | 7,467 | 2,116 |
|
||||
| `64ea80..66ca80` (`hierAlphaPkt2`) | 5,750 | 2,756 |
|
||||
|
||||
This snapshot boundary does not prove all possible campaign paths. Other packet builders/alpha links,
|
||||
legacy extents, game texture-manager bookkeeping and unconverted VU macro helper callers remain.
|
||||
|
||||
Windowed movie/menu (4,201 frames) and 1P/4P (6,501 each) finish through loading into active arenas.
|
||||
Direct captures show decoded movie action, readable loading, textured vehicles/rain/HUD in the 1P arena
|
||||
and four snowy views with distinct vehicles, effects and targeting. These are visual smoke checks,
|
||||
not console/pixel parity. Device logs retain dropped frames and 22.0 / 67.3 / 24.0 ms of inserted silence
|
||||
in movie/1P/4P. Exact deterministic sound is not flawless-device-audio or subjective listening acceptance.
|
||||
@@ -0,0 +1,60 @@
|
||||
# Native texture upload-link completion
|
||||
|
||||
`pktAddVu1Tex` (`1ea5c8`) now uses a native leaf at its two audited activation/mip returns, `1f947c`
|
||||
and `1f977c`. Texture content is already supplied by the native pack/material path. The native leaf
|
||||
advances control `+8` by 16 bytes and preserves the original CPU caller results; it reads no upload
|
||||
descriptor and emits or dispatches no hardware tag. Its three former output stores are gone from
|
||||
this native path. No graphics register bank, transfer queue or synthetic interrupt is added.
|
||||
|
||||
The original leaf has no checkpoints. Its complete context ABI is retained: low 64-bit results in
|
||||
registers 2/3/5/6/7, the original full-register clear of register 3, return PC, and untouched CPU/FPU/VU
|
||||
state, clocks and checkpoint count. Native completion preserves the game's legacy extent metadata;
|
||||
it is not a GPU fence or a new rendering operation.
|
||||
|
||||
Unknown callers and the historical checker execute the original complete leaf. Deliberate overlap
|
||||
between the output writes and the 20-byte control record also retains the original behavior, because
|
||||
the old writes can change subsequent cursor loads. The guard compares physical flat-memory spans,
|
||||
including RAM aliases. Ordinary disjoint records need no mapped output pointer.
|
||||
|
||||
## Validation
|
||||
|
||||
Evidence: `D:/BozoScratch/texture-uploads`, against main `6341d9b`, with the same USA disc, engine and
|
||||
input scripts. All game runs use private user directories. BozoEngine stays at `4a8f70a`; the earlier
|
||||
player release is unchanged. These are functional checks, with no performance claim.
|
||||
|
||||
- The expanded texture-input suite checks 4,096 original/native leaf cases in four FP modes, five
|
||||
RAM views, scratchpad, word-aligned controls/cursors and arbitrary descriptor arguments.
|
||||
Complete CPU/FPU/VU/context, host FP control, clocks/checkpoints, cursor and other memory match, with
|
||||
the native output arena untouched. There are 32 complete flat-memory checks.
|
||||
- 128 inaccessible-output cases complete with exact pointer-relative CPU results and no device
|
||||
access. 128 unknown/historical cases retain the original output/context behavior. Another 16 cases
|
||||
compare complete flat memory and context for overlapping control/output records through RAM aliases.
|
||||
- The actual consumer/activation/allocator/mip chain still passes 8,192 cases, 32 full-memory checks,
|
||||
268 inaccessible texture-output cases, 136 input fallback cases and 320 reconstructed-context/owner
|
||||
cases. Its only memory exclusions are the explicitly retired 48-byte object texture output and
|
||||
the exact number of 16-byte upload links formerly appended at the upload cursor.
|
||||
- All nine native suites and 12 release-tool tests pass; player, headless and historical checker build.
|
||||
- Complete 1P (9,500 frames) and actual 4P (8,500) recordings match main on every non-RAM field:
|
||||
scratchpad, draws/counts, sound/samples, library calls, threads and EE clocks. Separate strict/default
|
||||
recordings are byte-identical. Default VU0 program counts remain zero. No hash mask is widened.
|
||||
- The two routes execute 36 / 13 native upload leaves, retiring 108 / 39 tag stores. This is a small
|
||||
execution count, not evidence of a meaningful performance improvement.
|
||||
|
||||
RAM hashes differ on 1P frames `5593..9499` (3,907 frames), and on seven 4P frames: `4704`, `4731`,
|
||||
`4793..4795`, `5747`, `5865`. The checked 32 MB snapshots isolate ten differing bytes in `hierAlphaPkt`
|
||||
at 1P frame 7,000, five in that same buffer at 4P frame 4,794, and zero differences at 4P frame 6,000.
|
||||
There are no differing bytes outside that packet buffer in these snapshots. Old untouched tag bytes
|
||||
are not cleared or restored artificially. The snapshots are bounded evidence, not a campaign-wide proof.
|
||||
|
||||
Windowed movie/menu (4,201 frames) and 1P/4P (6,501 each) finish through loading into active arenas.
|
||||
Direct captures show movie action, readable loading, rainy combat with targeting/health/HUD/fire/effects,
|
||||
and four snowy views with distinct vehicles. These are visual smoke checks, not console/pixel parity.
|
||||
Device logs retain dropped frames and 29.2 / 54.9 / 25.1 ms of inserted silence in movie/1P/4P; exact
|
||||
deterministic sound does not imply flawless device audio or subjective listening acceptance.
|
||||
|
||||
## Remaining scope
|
||||
|
||||
Game texture allocation/eviction/last-used bookkeeping, per-object source-copy loops and legacy
|
||||
extents remain. Placeholder tags, alpha-link builders and other mixed packet helpers remain separate
|
||||
work, along with unconverted VU macro helper callers. This increment replaces the audited upload-link
|
||||
leaf rather than claiming complete packet/emulation removal or console visual parity.
|
||||
@@ -0,0 +1,90 @@
|
||||
# Native tire-pair correction forward transforms
|
||||
|
||||
[Combo-launch forwards](NATIVE_COMBO_FORWARD.md) follow with five vehicle combo sites.
|
||||
|
||||
Two vehicle-orientation forward returns use native XYZ arithmetic after the
|
||||
[machine-gun muzzle forwards](NATIVE_MACHINE_GUN_FORWARD.md). Known forward coverage
|
||||
grows from 167 to 169 of 269 returns (100 remain). Known inverse coverage stays 134
|
||||
of 134; BozoEngine stays at `4a8f70a`.
|
||||
|
||||
| Return PC | Owner | Producer and consumer |
|
||||
| --- | --- | --- |
|
||||
| `18b10c` | `Vehicle::tireUpdateCarRotation` (`18adb8`) | The first axle's height correction `(0,0,-c)` (`c` at `+1e58`) through the vehicle basis at `+d0`, into frame `+50`, added to that tire pair's midpoint into frame `+70` |
|
||||
| `18b19c` | The same | The second axle's correction (`c` at `+1e68`), added into frame `+80` |
|
||||
|
||||
`tireUpdateCarRotation` rebuilds a vehicle's orientation from its tires each frame.
|
||||
For the 4- and 5-wheel layouts (`+1790`), each axle with a nonzero correction moves
|
||||
its tire-pair midpoint along the vehicle's up direction. Instead, layout 6 scales
|
||||
the up vector (`mathfScaleVector`) for the first axle and layout 3 for the second,
|
||||
with no transform. Then it:
|
||||
|
||||
1. rebuilds the forward axis from the corrected midpoints (difference, average,
|
||||
`mathfNormalize`);
|
||||
2. rebuilds the side and up axes with `mathfCrossProduct`;
|
||||
3. applies the per-layout tilt (`mathfRotMatrixRPH`) and `mathfMulMatrix` through
|
||||
the vehicle's coordinate system.
|
||||
|
||||
Both transforms write frame `+50`. It is read only by `mathfAddVector`; on the other
|
||||
paths `mathfScaleVector` and `mathfSetFVector` write only its X/Y/Z. Frame `+5c` is
|
||||
never read. The corrected midpoints in frame `+70`/`+80` are read only by
|
||||
`mathfSubVector`. The owner reads no VU registers, accumulator or flags. The
|
||||
existing native helper computes separately rounded XYZ, preserves destination W
|
||||
and leaves VU state untouched. Unknown and historical callers keep the original
|
||||
ABI. No engine or gameplay formula changes.
|
||||
|
||||
## Generated comparisons
|
||||
|
||||
Evidence is under `D:/BozoScratch/tire-rotation-forward`, against parent `027357a`
|
||||
(PR #69). Parent headless/window binaries are preserved there and match PR #69's
|
||||
qualified build. Generated bodies, retail data and runtime recordings stay outside
|
||||
Git.
|
||||
|
||||
- Added coverage is 1,024 generated sequences / 64 whole-memory comparisons (caller
|
||||
kinds 272 and 273): helper-boundary continuations and owner entries, across four
|
||||
rounding modes, FTZ/DAZ, RAM aliases, identity/quarter-turn bases and arbitrary
|
||||
W payloads.
|
||||
- Owner entries start inside the owner at `18b088`, right after its up-vector
|
||||
normalize, with the frame and saved registers as its prologue leaves them. This
|
||||
is the same approach as the earlier boss fixture. The earlier part of the owner
|
||||
contains no transform and is not run.
|
||||
- From that point, each entry runs both axle blocks and the whole rebuild through
|
||||
the real math helpers to the owner's real return.
|
||||
- Scenarios cover both 4- and 5-wheel layouts, each axle on its own, layout 6
|
||||
(scale only) and a 2-wheel layout (no corrections).
|
||||
- The basis at `+d0` is fixture-known in every case, so every output is checked
|
||||
against an independent identity or quarter-turn result.
|
||||
- Both corrected midpoints are asserted exactly against the original FPU addition,
|
||||
after the owner has finished. Cases where both run check both, in order. The
|
||||
sites publish in 608 and 864 cases.
|
||||
- The VU rule from the earlier weapon increments applies. Only forward scratch W at
|
||||
frame `+5c` is normalized for test comparison, after every real consumer.
|
||||
- New caller kinds shift the shared random fill for later rounding modes, so one
|
||||
data-dependent count in earlier fixtures moved (vehicle tire jumps 705 → 700).
|
||||
All scenario-defined counts and assertions are unchanged.
|
||||
- Aggregate caller coverage is 140,288 generated sequences / 6,752 whole-memory
|
||||
comparisons. Historical forward ABI coverage is 10,240 / 640; inverse remains
|
||||
8,576 / 134.
|
||||
|
||||
## Replay and window qualification
|
||||
|
||||
Player, headless runner, historical checker and all eleven native test targets
|
||||
build. All eleven native suites and twelve Python tooling tests pass, with every
|
||||
previous publication assertion enabled.
|
||||
|
||||
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
|
||||
frames. Every recording field matches parent `027357a`, including the RAM hash on
|
||||
every frame: scratchpad, calls, draws, sound, thread state and EE timing/counts.
|
||||
Sampled 32 MiB RAM images are identical. Strict/default recordings and snapshots
|
||||
are byte exact; strict comparisons report no mismatch. The first-axle return
|
||||
`18b10c` is live: it runs natively 17 times on the one-player route with no
|
||||
recorded difference. The second-axle return `18b19c` is cold on these routes and
|
||||
is qualified by the generated owner suite above.
|
||||
|
||||
Fresh isolated window runs, started after the headless replays had finished,
|
||||
complete 6,500 one-player, 6,500 actual four-player and 4,200 movie frames.
|
||||
Reviewed captures show the intro and credits, menus, vehicle and level selection,
|
||||
driving with the HUD and four simultaneous views. Each route has five distinct
|
||||
captures. Stereo 48 kHz, 16-bit WAV recordings contain nonzero audio. Audio device
|
||||
underruns: 63.2 ms of silence in one-player, 27.3 ms in four-player and 23.2 ms in
|
||||
the movie run. These are functional checks, not a performance or flawless-playback
|
||||
claim. Full campaign and physical controller/hardware acceptance remain open.
|
||||
@@ -0,0 +1,95 @@
|
||||
# Native tow-truck launcher transforms
|
||||
|
||||
Four transform returns in `UpdateTowTruck` (`150b60`) now use native record
|
||||
calculations, extending the [shadow increment](NATIVE_SHADOWS.md). Forward
|
||||
coverage grows from 76 to 79 sites and inverse coverage from 85 to 86.
|
||||
BozoEngine remains pinned to `4a8f70a`.
|
||||
|
||||
| Return PC | Helper | Following consumers |
|
||||
| --- | --- | --- |
|
||||
| `150bc8` | Forward `1da298` | Base-position XYZ addition and publication |
|
||||
| `150cc0` | Forward `1da298` | Offset addition and three-axis position smoothing |
|
||||
| `150d2c` | Forward `1da298` | Vehicle-space conversion and attachment-position publication |
|
||||
| `150d98` | Inverse `1da1e8` | Local-direction subtraction, normalization and orientation construction |
|
||||
|
||||
The existing native forward calculation snapshots operands, computes separately
|
||||
rounded XYZ and retains destination W. The inverse snapshots its operands and
|
||||
publishes the first basis vector's W as data. The shared forward temporary is
|
||||
consumed as XYZ and then completely replaced by the real inverse. Native paths
|
||||
leave VU registers, accumulator, flags and data memory untouched. Historical
|
||||
hosts and unknown callers keep the complete original ABI. Launcher selection,
|
||||
tilt/clamping, rotation construction, smoothing, normalization, material selection
|
||||
and game checkpoints remain compiled game code.
|
||||
|
||||
## Generated consumers and numerical checks
|
||||
|
||||
Local evidence is under `D:/BozoScratch/tow-truck-transforms`, against main
|
||||
`f1118f4` (PR #38). Generated game code, retail data, recordings and captures stay
|
||||
outside Git.
|
||||
|
||||
- Added coverage is 2,048 complete generated consumer sequences / 128 whole-memory
|
||||
comparisons. Aggregate coverage is 69,632 / 2,336. The tow-truck cases compare
|
||||
all final memory, including stack W, without any forward-W exclusion: an
|
||||
explicit assertion checks that the inverse has overwritten the shared temporary.
|
||||
- Every new site runs through the complete scalar tail and return: vector
|
||||
addition/subtraction, smoothing, normalized direction, orientation matrix,
|
||||
attachment position, material-pointer selection and visibility-byte writes.
|
||||
Zero-length and vertical directions exercise the actual normalization and
|
||||
orientation fallback branches. Consumers and trigonometry run their actual
|
||||
generated code. The visibility byte starts nonzero, making clearing and
|
||||
retention observable, including the disabled early returns.
|
||||
- 512 of those cases enter at the actual function entry: 256 complete
|
||||
updates, 192 updates reusing the existing launcher position and 64 disabled
|
||||
early returns. The complete updates include all four transform calls. Another
|
||||
256 start at the real tilt/clamp and rotation producer; 256 start at the final
|
||||
smoothed-Z producer. Rotation inputs stay within half a radian; wider argument
|
||||
reduction is outside these consumer fixtures.
|
||||
- Four host FP modes, denormal controls, RAM aliases and arbitrary opaque W
|
||||
payloads are covered. CPU outside retired VU state, outgoing host FP effects,
|
||||
clocks/checkpoints and memory agree. Native VU stays untouched through the
|
||||
complete consumers. Inverse W is compared exactly as meaningful data.
|
||||
- Historical forward coverage grows to 4,480 / 280 cases / whole-memory checks;
|
||||
historical inverse coverage grows to 5,504 / 86. Existing hierarchy coverage
|
||||
retains 786,432 helper cases / 384 whole-memory, 8,000 geometric edges, 1,024
|
||||
complete recursive BSP callers / 32 whole-memory and 2,048 unknown ABI cases.
|
||||
- Player, headless runner, historical checker and all native test targets build.
|
||||
All eleven native suites and twelve Python tooling tests pass. The hierarchy
|
||||
suite passes again with the explicit no-W-exclusion assertion enabled.
|
||||
|
||||
## Gameplay, loading and movies
|
||||
|
||||
Default and strict-check builds complete 9,500 one-player frames and 8,500 actual
|
||||
four-player frames. Every recorded frame field agrees with the shadow baseline,
|
||||
including raw RAM, scratchpad, calls, draws, sound, threads, counts and EE clocks.
|
||||
Both full 32 MiB snapshots also agree. Strict/default recording files and snapshots
|
||||
are byte-identical. No observer, RAM mask or VU-state restoration is needed.
|
||||
|
||||
Each of the four new sites executes 3,596 times in one-player and 3,798 times in
|
||||
four-player: 14,384 / 15,192 new native executions in total. Total native forward
|
||||
calls become 1,138,018 / 295,330. Default routes make zero original-helper
|
||||
comparisons and execute zero VU0 microprograms. These are coverage counts, not a
|
||||
measured speedup.
|
||||
|
||||
Fresh 6,500-frame one-player and actual four-player windowed routes and a
|
||||
4,200-frame movie/menu route complete through clean exit, using isolated scratch
|
||||
user data. Reviewed captures show decoded movie playback (1,000), return to menu
|
||||
(1,800), Junkyard loading (one-player 4,500), active one-player gameplay with the
|
||||
tow-truck launcher (5,500 / 6,300), and four advancing snow-arena views with
|
||||
snow/tire effects and the attached tow-truck launcher (four-player 5,500 / 6,300).
|
||||
Each new site runs 1,706 / 1,799 times in windowed one-player / four-player:
|
||||
6,824 / 7,196 new native executions in total. These captures establish bounded
|
||||
functional coverage, not pixel-exact windowed or console parity.
|
||||
|
||||
All three stereo 48 kHz WAV recordings contain audio. Device logs report
|
||||
21.0 / 54.5 / 8.0 ms of silence (movie / one-player / four-player), with underruns
|
||||
and dropped frames. Deterministic gameplay sound matches the shadow baseline;
|
||||
flawless device audio and subjective listening are not claimed. Production player,
|
||||
headless and checker binaries contain no prior temporary observer markers.
|
||||
|
||||
## Remaining scope
|
||||
|
||||
These two helper inventories now contain 79 native forward and 86 native inverse
|
||||
sites. Outside their allowlists remain 190 forward and 48 inverse sites, 238 in
|
||||
total across the game. This is a structural source inventory, not a live cost
|
||||
measurement, and excludes other helper families and inline VU operations. Full
|
||||
campaign acceptance and console visual/audio parity remain separate work.
|
||||
@@ -0,0 +1,78 @@
|
||||
# Native UpdateLauncher forward transforms
|
||||
|
||||
[The HUD laser batch](NATIVE_HUD_LASER_FORWARD.md) follows with the laser sight's two points.
|
||||
|
||||
The three `Launcher::UpdateLauncher` forward returns use native XYZ arithmetic after
|
||||
the [FireSpecial types c0/1e0/220 batch](NATIVE_FIRE_TORCH_FORWARD.md). Known forward
|
||||
coverage grows from 255 to 258 of 269 returns (11 remain). Known inverse coverage
|
||||
stays 134 of 134; BozoEngine stays at `4a8f70a`.
|
||||
|
||||
`Launcher::UpdateLauncher` (`147260`) has the launcher in `s1` and the vehicle in
|
||||
`s3`:
|
||||
|
||||
| Return PC | Producer and consumer |
|
||||
| --- | --- |
|
||||
| `147a8c` | The aim offset in frame `+0` goes through the vehicle's coordinate system in place. `mathfAddVector` adds it to the vehicle position into the launcher's `+230`, which is height-tested (`hdHatTest`) and copied on with `mathfCopyVector` |
|
||||
| `147cc8` | The current weapon's muzzle offset (`+3f0` indexed by the weapon number at `+0`) goes through the vehicle's system into frame `+0`, plus the vehicle position, into `+620`. Then `FireCurrentWeapon` fires |
|
||||
| `147cf4` | For vehicle type `1c0`, that point first goes through the turret part's matrix (`+1ec8`, `+10`) in place |
|
||||
|
||||
The consumers are `mathfAddVector` and the next transform's input (whose W the
|
||||
transform ignores). `hdHatTest`, `mathfCopyVector` and `FireCurrentWeapon` get
|
||||
launcher fields, not the frame vector; launcher `+62c` has no reader. UpdateLauncher
|
||||
never loads frame `+0c`, 64 bits at `+08` or 128 bits from its frame. It reads no VU
|
||||
registers, accumulator or flags.
|
||||
|
||||
`147a8c` and `147cf4` are in place, so the input is read whole before the output is
|
||||
written. The existing native helper computes separately rounded XYZ, preserves
|
||||
destination W and leaves VU state untouched. Unknown and historical callers keep the
|
||||
original ABI. No engine or gameplay formula changes.
|
||||
|
||||
## Generated comparisons
|
||||
|
||||
Evidence is under `D:/BozoScratch/update-launcher-forward`, against parent `24ef197`
|
||||
(PR #87). Parent headless/window binaries are preserved there and match PR #87's
|
||||
qualified build. Generated bodies, retail data and runtime recordings stay outside
|
||||
Git.
|
||||
|
||||
- Added coverage is 1,536 generated sequences / 96 whole-memory comparisons (caller
|
||||
kinds 360 to 362). They are helper-boundary continuations and entries at the
|
||||
call-return label before each transform (`147a78`, `147ca8`, `147cc8`), across four
|
||||
rounding modes, FTZ/DAZ, RAM aliases, identity/quarter-turn bases and arbitrary W
|
||||
payloads.
|
||||
- Each run stops after its result is consumed: at `hdHatTest` (`147a8c`) or at
|
||||
`FireCurrentWeapon`. The type-`1c0` check is real: `147cc8` runs use another type
|
||||
and skip the turret transform.
|
||||
- Every basis is fixture-known, so every site is checked against an independent
|
||||
identity or quarter-turn result. Published values are asserted exactly against the
|
||||
original FPU arithmetic: the launcher's `+230` (at `hdHatTest`) and `+620` (at
|
||||
`FireCurrentWeapon`). Publications: 512 for each site.
|
||||
- The VU rule from the earlier weapon increments applies. Only forward scratch W at
|
||||
frame `+0c` is normalized for test comparison, after every real consumer.
|
||||
- New caller kinds shift the shared random fill for later rounding modes, so two
|
||||
data-dependent counts in earlier fixtures moved (vehicle tire jumps 708 → 711,
|
||||
real libm errno cases 831 → 810). All scenario-defined counts and assertions are
|
||||
unchanged.
|
||||
- Aggregate caller coverage is 185,856 generated sequences / 9,600 whole-memory
|
||||
comparisons. Historical forward ABI coverage is 15,936 / 996; inverse remains
|
||||
8,576 / 134.
|
||||
|
||||
## Replay and window qualification
|
||||
|
||||
Player, headless runner, historical checker and all eleven native test targets
|
||||
build. All eleven native suites and twelve Python tooling tests pass, with every
|
||||
previous publication assertion enabled.
|
||||
|
||||
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
|
||||
frames. Every recording field matches parent `24ef197`, including the RAM hash on
|
||||
every frame: scratchpad, calls, draws, sound, thread state and EE timing/counts.
|
||||
Sampled 32 MiB RAM images are identical. Strict/default recordings and snapshots
|
||||
are byte exact; strict comparisons report no mismatch. `147cc8` and `147cf4` are live on the one-player route: they run natively 17 and 6 times with no recorded difference. `147a8c` is cold on these routes and is qualified by the generated owner suite above.
|
||||
|
||||
Fresh isolated window runs, started after the headless replays had finished,
|
||||
complete 6,500 one-player, 6,500 actual four-player and 4,200 movie frames.
|
||||
Reviewed captures show the intro and credits, menus, vehicle and level selection,
|
||||
driving with the HUD and four simultaneous views. Each route has five distinct
|
||||
captures. Stereo 48 kHz, 16-bit WAV recordings contain nonzero audio. Audio device
|
||||
underruns: 101.9 ms of silence in one-player, 33.8 ms in four-player and 19.4 ms in
|
||||
the movie run. These are functional checks, not a performance or flawless-playback
|
||||
claim. The one-player window run, made while a read-only audit was running, reported 101.9 ms of silence. A back-to-back one-player rerun of new and parent builds then gave 48.1 ms and 53.0 ms at 59.5 and 59.7 frames/s. Full campaign and physical controller/hardware acceptance remain open.
|
||||
@@ -0,0 +1,117 @@
|
||||
# Native vehicle spatial calculations
|
||||
|
||||
[Minion shield forwards](NATIVE_MINION_FORWARD.md) adds seven hit-point sites with
|
||||
actual distance, health, HUD and hierarchy-switch publication consumers.
|
||||
|
||||
[Attachment/environment forwards](NATIVE_ATTACHMENT_FORWARD.md) adds five helicopter,
|
||||
cable, gascan, saw-blade and taxi-spike sites with actual grid/query/publication consumers.
|
||||
|
||||
[Collision forward transforms](NATIVE_COLLISION_FORWARD.md) adds six velocity,
|
||||
force, impact-offset and morph-placement sites with actual state consumers.
|
||||
|
||||
[Driver forward transforms](NATIVE_DRIVER_FORWARD.md) adds seven path-offset,
|
||||
lookahead and driving-LOS sites with complete generated owners and real queries.
|
||||
|
||||
[Rigid-body forward transforms](NATIVE_RIGID_BODY_FORWARD.md) adds ten sites for local
|
||||
forces/torques/impulses, integration and world-point publication.
|
||||
|
||||
[Final inverse returns](NATIVE_FINAL_INVERSES.md) completes all 134 known inverse sites,
|
||||
including force-field, health-stand, HUD/radar and particle visibility/sorting consumers.
|
||||
|
||||
[Vehicle/light inverses](NATIVE_VEHICLE_LIGHT_INVERSES.md) adds six native inverse sites
|
||||
with complete tire/rollover/damage/light entries and state-publication checks.
|
||||
|
||||
[Driver/boss inverses](NATIVE_DRIVER_BOSS_INVERSES.md) adds five native inverse sites
|
||||
and the coupled boss forward publication, with actual driver and attachment consumers.
|
||||
|
||||
[AI inverses](NATIVE_AI_INVERSES.md) adds five native inverse call sites with steering,
|
||||
attack-range and front/rear shot-policy comparisons.
|
||||
|
||||
[Rigid-body inverses](NATIVE_RIGID_BODY_INVERSES.md) adds seven native inverse call sites
|
||||
with complete collision/impulse entries and downstream point-velocity checks.
|
||||
|
||||
[Collision/drift inverses](NATIVE_COLLISION_DRIFT_INVERSES.md) adds sixteen native inverse call sites,
|
||||
including drift velocity publication and collision-force coordinates, with full XYZW comparisons.
|
||||
|
||||
The player runtime now calculates the vehicle basis product (`vu0MulMatrix3x3`, `1dcc08`) directly over
|
||||
matrix records. Its three calls are in `vehicleUpdatePosition` and `vehicleSetCsMat`. All four output
|
||||
components and the final identity column retain the original ordered arithmetic and alias behavior.
|
||||
|
||||
Thirteen inline blocks in those two functions also use native records: four direction transforms,
|
||||
seven sums and two differences. Their 68 load/arithmetic/store instructions no longer transport VU
|
||||
registers, accumulator or flags. Each block snapshots its current operands at its existing store, then
|
||||
writes XYZ while retaining the destination's fourth component. CPU branches, loops and checkpoints
|
||||
stay at their original locations. This does not replace all the functions they call.
|
||||
|
||||
| Store | Calculation |
|
||||
| --- | --- |
|
||||
| `1aadc4` | Selected attachment transform |
|
||||
| `1aaddc` | Attachment world position |
|
||||
| `1aae44` | Repeated movement-step sum |
|
||||
| `1aaf8c` | Attachment transform |
|
||||
| `1aafa0` | Combined position |
|
||||
| `1aafb4` | Position difference |
|
||||
| `1aafc4` | Position update |
|
||||
| `1aaff8` | Direction transform |
|
||||
| `1ab008` | Position update |
|
||||
| `1ab01c` | Position difference |
|
||||
| `1ab140` | Light offset transform |
|
||||
| `1ab150` | Light position |
|
||||
| `1ab2a8` | Coordinate-system position |
|
||||
|
||||
The audited skid-mark call of `mathfMulTransVec` (`1da298`, return address `168b30`) uses the same native
|
||||
direction calculation. The helper's other callers retain the generated path until their contracts are
|
||||
audited. This distinction matters: the original stores an inherited `VF16.w`; its following skid-mark
|
||||
vector-add consumer uses only XYZ. A memory trace found this store writing the four tire-position W
|
||||
words after removing vehicle register clobbers. The native record boundary retains those destinations
|
||||
without reconstructing any VU state. The resulting tested frame records match the baseline completely.
|
||||
|
||||
## Validation
|
||||
|
||||
Artifacts are local under `D:/BozoScratch/native-vehicle`, compared with main `74fd638` / engine `149bf90`.
|
||||
|
||||
- `tmb-native-vehicle-tests`: 425,984 comparisons against extracted generated blocks, 416 complete-memory
|
||||
cases and 1,024 ordered overlapping-block cases pass. Four host FP modes, arbitrary/extreme values,
|
||||
RAM aliases, scratchpad and quadword alignment are covered. Every CPU/VU byte and host MXCSR remain
|
||||
unchanged for the inline replacements.
|
||||
- Another 1,024 tests execute the complete generated `vehicleSetCsMat` caller, including both helper
|
||||
calls, overlapping matrix input/output, saved registers, scalar tail, return and its exact 16 cycles /
|
||||
two checkpoints. Context and memory agree with the documented XYZ/destination-W contract; native
|
||||
VU state stays untouched.
|
||||
- The matrix/direction suite passes 1,048,576 cases and 512 whole-memory comparisons. This includes
|
||||
262,144 skid-direction cases. Another 2,048 cases verify the complete original ABI for other callers.
|
||||
- Original block extraction now writes to `native_original`, outside the recompiler's prefix-cleaned
|
||||
output folder. A forced recompiler regeneration followed by full game/test builds passes.
|
||||
- The 9,500-frame 1P and 8,500-frame 4P strict routes exactly reproduce **every** baseline frame-record
|
||||
field: RAM, scratchpad, draw/sound hashes and counts, calls, threads and EE clocks.
|
||||
- Live strict comparisons pass for 92,744 / 45,576 vehicle basis products, 187,011 / 60,768 inline blocks
|
||||
and 4,100 / 8,363 skid directions (1P / 4P). Twelve inline sites run in 1P; four run in 4P. The repeated
|
||||
movement-step sum at `1aae44` has original-block tests but was not reached by these scripts.
|
||||
|
||||
Independent default 1P/4P runs reproduce the strict records byte-for-byte, with zero original comparisons.
|
||||
Windowed default runs complete 4,201 movie/menu frames and 6,501 frames each for 1P and 4P. Captures
|
||||
directly show combat, movement, effects and all four snow-arena views after loading. The window logs
|
||||
record 22.8/54.4/28.7 ms of silence respectively; deterministic sound is exact, but this is not a flawless
|
||||
device-audio or subjective listening claim.
|
||||
|
||||
Existing camera/HUD tests and the 12 release-tool regressions pass. Full campaign, rare multi-step
|
||||
movement, other direction-helper callers and the remaining hierarchy/VU math are not claimed qualified.
|
||||
|
||||
[The suspension/tire-height increment](NATIVE_SUSPENSION_TIRE.md) subsequently adds the two
|
||||
forward transform leaves used by suspension ride-height and tire pivot reconstruction, with
|
||||
generated consumer tails and complete tire-height entry-call comparisons.
|
||||
|
||||
[Native shadow transforms](NATIVE_SHADOWS.md) subsequently add the vehicle shadow vertex
|
||||
transform and five weapon shadow motion/height-sample transforms, with generated vertex-loop
|
||||
and height-query staging comparisons.
|
||||
|
||||
[Native tow-truck launcher transforms](NATIVE_TOW_TRUCK.md) subsequently add three forward
|
||||
and one inverse site, with complete generated positioning, smoothing and orientation consumers.
|
||||
|
||||
[Native peel-out transform](NATIVE_PEEL_OUT.md) subsequently adds the vehicle's
|
||||
visual-offset forward transform, checked through the full producer and the real
|
||||
coordinate-system consumer, including matrix aliases and the opaque source W boundary.
|
||||
|
||||
[Native weapon/skid transforms](NATIVE_WEAPON_SKID_TRANSFORMS.md) subsequently add
|
||||
weapon translation and skid creation/stretch offsets, including complete scalar
|
||||
vertex publication, material/list bookkeeping and stationary/moving entry checks.
|
||||
@@ -0,0 +1,114 @@
|
||||
# Native vehicle and object-light inverses
|
||||
|
||||
Six more inverse returns use native record arithmetic, following the
|
||||
[driver/boss increment](NATIVE_DRIVER_BOSS_INVERSES.md). Inverse coverage grows
|
||||
from 122 to 128 of 134 returns. Forward coverage stays at 96 of 269, and
|
||||
BozoEngine stays at `4a8f70a`.
|
||||
|
||||
| Return PC | Owner | Qualified consumer |
|
||||
| --- | --- | --- |
|
||||
| `18bc9c` | `tireCalcLastRotChange` | Local angular delta, previous-delta XYZ copy and meaningful output W |
|
||||
| `1ac85c` | `vehicleInitRollOver` | Rollover angular response, trigonometric/clamp branches and angular-state copies |
|
||||
| `1af120`, `1af148` | `vehicleReactToWeaponDamage` | Direction normalization, tire-jump decisions and damage-state publication |
|
||||
| `1eb4d4`, `1eb58c` | `plightInObject` | Local light position/direction, distance/dot consumers and lighting-table publication |
|
||||
|
||||
The existing inverse implementation preserves separately rounded XYZ and copies
|
||||
first-basis W as meaningful data. All four output components remain exact; no W
|
||||
exclusion is added. Native calls leave VU registers, accumulator, flags and data
|
||||
memory untouched. Unknown callers and historical hosts retain the original ABI.
|
||||
Game branches and scalar consumers remain compiled game code.
|
||||
|
||||
## Generated-code comparisons
|
||||
|
||||
Evidence is under `D:/BozoScratch/remaining-inverses`, against main `99efa7f`
|
||||
(PR #48). Generated code, retail data, recordings and captures stay outside Git.
|
||||
|
||||
- Added coverage is 3,072 generated sequences / 192 whole-memory comparisons.
|
||||
Aggregate coverage is 99,840 / 4,224. Each site has 256 helper-boundary cases
|
||||
through its actual tail and 256 complete owner-entry cases. Four host rounding
|
||||
modes, denormal controls, RAM aliases, rotated bases and arbitrary basis W
|
||||
are covered. Whole-memory entry samples reach active transforms.
|
||||
- Tire entries execute the actual matrices-to-axis, axis-to-matrix and
|
||||
matrix-to-RPH producers before the inverse. Successful delta publication and
|
||||
the XYZ copy to the previous-delta record are required, with meaningful W
|
||||
checked explicitly. A special vehicle/state gate skips the transform.
|
||||
The separate boolean path that calls rollover is outside these tire fixtures;
|
||||
rollover itself has its own complete-entry fixtures.
|
||||
- Rollover entries execute the actual normal-to-matrix producer, inverse,
|
||||
scalar trigonometric/threshold/clamp consumers and both angular-state copies.
|
||||
Signed lateral inputs, positive/negative roll rates, tilted/flat vehicles,
|
||||
vehicle-class scaling and the early state gate are covered. Successful state
|
||||
publication is required in 224 entry cases.
|
||||
- Weapon-damage entries execute both upright-basis and generated-normal-basis
|
||||
routes, sign changes, real normalization, Z clamp, the four-tire loop and
|
||||
real tire-jump/free-fall helpers. Fixtures include zero vectors, blocked tires,
|
||||
existing positive tire velocity, damage below/above 50 and the damage-scaling
|
||||
flag. Switched vehicle classes require the other inverse site to execute.
|
||||
Successful tire-jump execution occurs in 707 comparison cases. The optional
|
||||
`collisSlideVehicle` call is avoided by the fixture inputs; its composed path
|
||||
and all weapon types are not claimed here.
|
||||
- Lighting entries execute the complete eight-slot/four-output loop, including
|
||||
scalar position producers, both inverses, squared-distance rejection, actual
|
||||
dot consumers, attenuation, ambient/nonambient stores, the fourth output lane
|
||||
and the published-light flag. Fixtures include one/four active lights,
|
||||
missing indices, disabled lighting, oversized radius and invisible coordinate
|
||||
systems. Four-light nonambient cases require four real dot consumers.
|
||||
Successful light publication occurs in 192 entry cases. Arbitrary light-table
|
||||
contents and all spatial overlap configurations are outside these fixtures.
|
||||
- Per-site reach assertions distinguish active transforms from gates. CPU outside
|
||||
retired VU, host FP effects, clocks/checkpoints, helper/action counts and final
|
||||
memory agree. Native VU remains untouched through the complete scalar tails.
|
||||
No runtime RAM masking or VU-state reconstruction is introduced.
|
||||
- Historical inverse ABI coverage grows to 8,192 cases / 128 whole-memory checks;
|
||||
forward stays at 5,568 / 348. Existing coverage retains 786,432 hierarchy helper
|
||||
cases / 384 whole-memory, 8,000 geometric edges, 1,024 complete BSP callers /
|
||||
32 whole-memory and 2,048 unknown ABI cases. Front/rear AI attack-publication
|
||||
assertions still pass in 392 / 352 cases.
|
||||
|
||||
## Replay and window qualification
|
||||
|
||||
Player, headless runner, historical checker and all eleven native test targets
|
||||
build. All eleven native suites and twelve Python tooling tests pass.
|
||||
|
||||
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
|
||||
frames. Every recorded field matches the immediate parent: raw RAM, scratchpad,
|
||||
calls, draws, sound, thread state and EE timing/counts. Sampled 32 MiB RAM images
|
||||
are identical. Strict/default recording files and snapshots are byte exact;
|
||||
strict comparisons report no mismatch.
|
||||
|
||||
One-player reaches 11 tire-delta calls, one rollover call and 14 upright-damage
|
||||
calls. Four-player reaches four tire-delta calls. The alternate damage inverse
|
||||
and both lighting inverses are cold in these replay routes; their behavior is
|
||||
qualified by the complete generated owner entries, not claimed as runtime route
|
||||
coverage. The one-call rollover sample is sparse; broader branch coverage comes
|
||||
from its fixtures.
|
||||
|
||||
Fresh isolated window runs complete 6,500 one-player, 6,500 actual four-player
|
||||
and 4,200 movie frames. Reviewed captures show level loading, advancing gameplay,
|
||||
AI opponents, driving/combat effects and vehicle rollover, four simultaneous
|
||||
views, decoded intro images and return to the menu. Each route has five distinct
|
||||
captures. Windowed 1P reaches nine tire-delta, eight rollover and nine upright
|
||||
damage calls; 4P reaches four tire-delta calls. The other new sites are cold in
|
||||
these window routes and covered by generated entries.
|
||||
|
||||
Stereo 48 kHz, 16-bit WAV captures contain nonzero audio. Device underruns remain:
|
||||
46.7 ms silence in 1P, 38.7 ms in 4P and 24.8 ms in movies. These are functional
|
||||
checks, not a timing or flawless-playback claim. Full campaign, all vehicle/weapon
|
||||
combinations and physical-controller/hardware acceptance remain outside this
|
||||
increment.
|
||||
|
||||
## Remaining scope
|
||||
|
||||
Six inverse returns remain outside the native allowlist:
|
||||
|
||||
| Return PC | Owner |
|
||||
| --- | --- |
|
||||
| `12d0b0` | `forceFieldTakeHit` |
|
||||
| `136ce8` | `healthStandInit` |
|
||||
| `13f814`, `13fe54` | `Hud::BuildRadarStuff` |
|
||||
| `14037c` | `Hud::AddRadarSignal` |
|
||||
| `1e9778` | `particleDraw` |
|
||||
|
||||
Together with 173 remaining forward returns, these two families have 179 sites
|
||||
outside the native allowlists. This is a call-site inventory, not a count of all
|
||||
remaining emulation. Additional inline arithmetic remains separate work.
|
||||
@@ -0,0 +1,95 @@
|
||||
# Native weapon hit-test forward transforms (RockHD and RicoHD)
|
||||
|
||||
[The Ferris wheel and final boss batch](NATIVE_FERRIS_BOSS_FORWARD.md) follows with four more hit-test sites.
|
||||
|
||||
Six weapon hit-test forward returns use native XYZ arithmetic after the
|
||||
[held-aim and lock-on arc batch](NATIVE_SPECIAL_ARCS_FORWARD.md). Known forward
|
||||
coverage grows from 216 to 222 of 269 returns (47 remain). Known inverse coverage
|
||||
stays 134 of 134; BozoEngine stays at `4a8f70a`.
|
||||
|
||||
These are the first forwards whose results feed the hd collision system. Their
|
||||
consumers were audited first:
|
||||
|
||||
- `hdPntSphereTest` (`1c4e70`) keeps *pointers* to its point and sphere in gp
|
||||
globals (`gp-3024`, `gp-3020`). Every reader of those globals (`hdHier`,
|
||||
`hdColGrid`, `hdColNode`, `hdTerrain`, `hdBspNode`, `terrainCollision`)
|
||||
reads the point only through XYZ helpers or as separate `x`/`y`/`z` words.
|
||||
Nothing copies the point with its W.
|
||||
- `Interactives::DispatchHit` (`142d98`) only passes the point on. All twelve
|
||||
jump-table handlers ignore it, pass it on, or read it only as XYZ: the vehicle,
|
||||
fodder, destructible, final boss, loop tank and pedestrian strategy handlers,
|
||||
`vehicleReactToWeaponDamage`, `GenericTakeHit` and `DoEffect`. No object field or
|
||||
global receives its W.
|
||||
- `mathfSubVector`, `mathfAddVector`, `mathfNormalize` and
|
||||
`mathfRotationFromVector` load and store only `+0/+4/+8`.
|
||||
`updateRichochetBounce` gets the coordinate system's position, whose W no
|
||||
forward writes.
|
||||
|
||||
| Return PC | Producer and consumer |
|
||||
| --- | --- |
|
||||
| `1b6cd8`, `1b6d3c` | `Weapon::RockHD` (`1b6bf0`): with `+1c` set and a nonzero fall speed at `+98`, or with `+1c` clear, a fixed offset goes through the weapon's basis at `+d0` into frame `+0`, plus its coordinate system's position. It becomes `hdPntSphereTest`'s point; on a hit, `mathfSubVector` rewrites its XYZ and `DispatchHit` gets it |
|
||||
| `1b5168` | `Weapon::RicoHD` (`1b50f0`): a fixed offset through the basis into frame `+10`, plus the position; then `hdPntSphereTest`, the hit's `mathfSubVector` and `DispatchHit` |
|
||||
| `1b52c0` | After a hit, the reflection rebuilds the basis; the direction at `+90` goes through it into frame `+10`, added into the coordinate system's position, which goes to `updateRichochetBounce` |
|
||||
| `1b5528` | With no hit, a new offset goes through the basis into frame `+10`, plus the position, and is tested again (`hdPntSphereTest`, `mathfSubVector` and `mathfRotationFromVector`) |
|
||||
| `1b5630` | The second reflection: the direction at `+90` into frame `+10`; the coordinate system's position becomes `+80` plus it |
|
||||
|
||||
Every result is written in place in the frame. RockHD never loads frame `+0c`, and
|
||||
RicoHD never loads frame `+1c`. Neither reads VU registers, accumulator or flags.
|
||||
The existing native helper computes separately rounded XYZ, preserves destination
|
||||
W and leaves VU state untouched. Unknown and historical callers keep the original
|
||||
ABI. No engine or gameplay formula changes.
|
||||
|
||||
## Generated comparisons
|
||||
|
||||
Evidence is under `D:/BozoScratch/weapon-hit-forward`, against parent `4847649`
|
||||
(PR #80). Parent headless/window binaries are preserved there and match PR #80's
|
||||
qualified build. Generated bodies, retail data and runtime recordings stay outside
|
||||
Git.
|
||||
|
||||
- Added coverage is 3,072 generated sequences / 192 whole-memory comparisons (caller
|
||||
kinds 321 to 326): helper-boundary continuations and full entries, across four
|
||||
rounding modes, FTZ/DAZ, RAM aliases, identity/quarter-turn bases and arbitrary W
|
||||
payloads.
|
||||
- `1b6cd8`, `1b6d3c` and `1b5168` run from the owner's start through the real
|
||||
branch selection and offset setup, and stop at `hdPntSphereTest`. The other three
|
||||
start at the call-return label before each transform (`1b52a4`, `1b5518`,
|
||||
`1b5614`). `1b52c0` stops at `updateRichochetBounce`, `1b5528` at
|
||||
`hdPntSphereTest`, and `1b5630` runs to the owner's real return.
|
||||
- The harness requires each full entry to reach exactly its own transform. Every
|
||||
basis is fixture-known, so every site is checked against an independent identity
|
||||
or quarter-turn result.
|
||||
- Published values are asserted exactly against the original FPU arithmetic: the
|
||||
point `hdPntSphereTest` receives (and that it receives that frame address), the
|
||||
position handed to `updateRichochetBounce`, and the returned position.
|
||||
Publications: 512 for each site.
|
||||
- The VU rule from the earlier weapon increments applies. Only forward scratch W
|
||||
(frame `+0c` or `+1c`) is normalized for test comparison, after every real
|
||||
consumer.
|
||||
- New caller kinds shift the shared random fill for later rounding modes, so two
|
||||
data-dependent counts in earlier fixtures moved (vehicle tire jumps 709 → 718,
|
||||
real libm errno cases 830 → 842). All scenario-defined counts and assertions are
|
||||
unchanged.
|
||||
- Aggregate caller coverage is 167,424 generated sequences / 8,448 whole-memory
|
||||
comparisons. Historical forward ABI coverage is 13,632 / 852; inverse remains
|
||||
8,576 / 134.
|
||||
|
||||
## Replay and window qualification
|
||||
|
||||
Player, headless runner, historical checker and all eleven native test targets
|
||||
build. All eleven native suites and twelve Python tooling tests pass, with every
|
||||
previous publication assertion enabled.
|
||||
|
||||
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
|
||||
frames. Every recording field matches parent `4847649`, including the RAM hash on
|
||||
every frame: scratchpad, calls, draws, sound, thread state and EE timing/counts.
|
||||
Sampled 32 MiB RAM images are identical. Strict/default recordings and snapshots
|
||||
are byte exact; strict comparisons report no mismatch. Four returns are live on the one-player route and run natively there with no recorded difference: `1b6d3c` 1,569 times, `1b5168` and `1b5528` 319 times each and `1b52c0` 5 times. `1b6cd8` and `1b5630` are cold on these routes and are qualified by the generated owner suite above.
|
||||
|
||||
Fresh isolated window runs, started after the headless replays had finished,
|
||||
complete 6,500 one-player, 6,500 actual four-player and 4,200 movie frames.
|
||||
Reviewed captures show the intro and credits, menus, vehicle and level selection,
|
||||
driving with the HUD and four simultaneous views. Each route has five distinct
|
||||
captures. Stereo 48 kHz, 16-bit WAV recordings contain nonzero audio. Audio device
|
||||
underruns: 59.3 ms of silence in one-player, 29.0 ms in four-player and 27.5 ms in
|
||||
the movie run. These are functional checks, not a performance or flawless-playback
|
||||
claim. The other special weapons in actual play, full campaign and physical controller/hardware acceptance remain open.
|
||||
@@ -0,0 +1,84 @@
|
||||
# Native weapon lock-on, satellite and rock forward transforms
|
||||
|
||||
[Ricochet forwards](NATIVE_RICOCHET_FORWARD.md) follow with two more weapon sites.
|
||||
|
||||
Six weapon forward returns use native XYZ arithmetic after the
|
||||
[Minion shield forwards](NATIVE_MINION_FORWARD.md). Known forward coverage grows
|
||||
from 131 to 137 of 269 returns (132 remain). Known inverse coverage stays 134 of
|
||||
134; BozoEngine stays at `4a8f70a`.
|
||||
|
||||
| Return PC | Owner | Producer and consumer |
|
||||
| --- | --- | --- |
|
||||
| `1b1700` | `Weapon::UpdateLockOnVehicle` (`1b16a8`) | Weapon offset through the target vehicle basis, added to the target position for the heading/pitch/distance aim |
|
||||
| `1b1bbc` | `Weapon::UpdateLockAheadOfVehicle` (`1b1ae0`) | Same offset added to the predicted lead point for the aim |
|
||||
| `1b339c` | `Weapon::UpdateSkillSatTrans` (`1b3350`) | Launch offset through the weapon basis, added to the satellite position (state 0) |
|
||||
| `1b3634`, `1b371c` | `Weapon::UpdateSkillSatTrans` | Per-frame velocity through the satellite basis, in place, added to its position (states 1-2 and 3) |
|
||||
| `1b3ef8` | `Weapon::UpdateRockTrans` (`1b3e28`) | Per-frame velocity through the weapon basis, in place, added to the rock position before its height test |
|
||||
|
||||
Every result is a stack-local vector read only through scalar XYZ code:
|
||||
`mathfAddVector` (`1daef0`), and afterwards the rock's `hdHatTest`, which only
|
||||
writes XYZ into that buffer. The destination W is never read again. None of the
|
||||
owners reads VU registers, the accumulator or flags directly. Three sites transform
|
||||
in place; the native helper reads its input before writing. The existing native
|
||||
helper computes separately rounded XYZ, preserves destination W and leaves VU state
|
||||
untouched. Unknown and historical callers keep the original ABI. No engine or
|
||||
gameplay formula changes.
|
||||
|
||||
## Generated comparisons
|
||||
|
||||
Evidence is under `D:/BozoScratch/weapon-lock-forward`, against parent `145964b`
|
||||
(PR #56). Parent headless/window binaries are preserved there. Generated bodies,
|
||||
retail data and runtime recordings stay outside Git.
|
||||
|
||||
- Added coverage is 3,072 generated sequences / 192 whole-memory comparisons:
|
||||
for each return, 256 helper-boundary sequences through the real continuation and
|
||||
256 full-owner entries, across four rounding modes, FTZ/DAZ, RAM aliases,
|
||||
identity/quarter-turn bases and arbitrary W payloads.
|
||||
- Each reached transform's input and output are captured at the real helper and
|
||||
`mathfAddVector` boundaries and checked against an independent identity or
|
||||
quarter-turn result. Full satellite entries rebuild their basis from zero angles
|
||||
through the real `mathfRotMatrixPH`, so they are checked against identity.
|
||||
- The published point is asserted exactly against the original FPU addition:
|
||||
lock-on and look-ahead aim points at `mathfHeadingFromPointToPoint`, the
|
||||
satellite position written back to its coordinate system, and the rock X/Y at
|
||||
`hdHatTest` (Z is lifted for the test). The real height-test consumer executes.
|
||||
Lock-on and look-ahead full entries also cover the no-target, inactive-state and
|
||||
copy-path gates without a transform (416 publishing cases each).
|
||||
Satellites and rock publish in all 512 cases each.
|
||||
- Weapon owners reach real libm and matrix helpers that use VU0 themselves. Their
|
||||
VU state must match the original exactly, except the original leaf's write set
|
||||
(VF11-13, VF15, VF16, ACC, MAC/status). In that set, each word must be either the
|
||||
original's later real write or the value the native leaf found at its entry.
|
||||
Only forward scratch W at each owner's frame `+0c` is normalized for test
|
||||
comparison, after every real consumer.
|
||||
- The rock's impact effect, weapon removal and impact sound are kept on the
|
||||
original path but not reached by these fixtures.
|
||||
- Aggregate caller coverage is 123,904 generated sequences / 5,728 whole-memory
|
||||
comparisons. Historical forward ABI coverage is 8,192 / 512; inverse remains
|
||||
8,576 / 134. All earlier publication assertions remain enabled.
|
||||
|
||||
## Replay and window qualification
|
||||
|
||||
Player, headless runner, historical checker and all eleven native test targets
|
||||
build. All eleven native suites and twelve Python tooling tests pass, with every
|
||||
previous publication assertion enabled.
|
||||
|
||||
Default and strict routes complete 9,500 one-player and 8,500 actual four-player
|
||||
frames. Every recording field matches parent `145964b`: raw RAM, scratchpad,
|
||||
calls, draws, sound, thread state and EE timing/counts. Sampled 32 MiB RAM images
|
||||
are identical. Strict/default recordings and snapshots are byte exact; strict
|
||||
comparisons report no mismatch. The rock return `1b3ef8` runs natively 1,569 times
|
||||
on the one-player route with no recorded difference; the other five sites are cold
|
||||
on these routes, qualified by the generated owner/consumer suite above.
|
||||
|
||||
Fresh isolated window runs complete 6,500 one-player, 6,500 actual four-player
|
||||
and 4,200 movie frames. Reviewed captures show the intro and credits, menus,
|
||||
vehicle and level selection, driving with the HUD and four simultaneous views.
|
||||
Each route has five distinct captures. Stereo 48 kHz, 16-bit WAV recordings
|
||||
contain nonzero audio. None of the six sites is reached within these window
|
||||
lengths.
|
||||
|
||||
Audio device underruns remain: 51.4 ms silence in one-player, 32.9 ms in
|
||||
four-player and 20.8 ms in the movie run. These are functional checks, not a
|
||||
performance or flawless-playback claim. A visible satellite or lock-on weapon
|
||||
encounter, full campaign and physical controller/hardware acceptance remain open.
|
||||
@@ -0,0 +1,109 @@
|
||||
# Native weapon translation and skid-mark transforms
|
||||
|
||||
[Weapon lock-on, satellite and rock forwards](NATIVE_WEAPON_LOCK_FORWARD.md) later add six more
|
||||
weapon owners: lock-on/look-ahead aim points and skill-satellite/rock movement.
|
||||
|
||||
Five forward-transform returns now use native record arithmetic, extending the
|
||||
[weather viewport increment](NATIVE_WEATHER_VIEWPORT.md). Forward coverage grows
|
||||
from 90 to 95 sites; inverse coverage stays at 89. BozoEngine stays at `4a8f70a`.
|
||||
|
||||
| Return PC | Owner | Consumers |
|
||||
| --- | --- | --- |
|
||||
| `1b28cc` | `Weapon::UpdateTranslation` | Weapon-local offset followed by position addition |
|
||||
| `1b28e8` | `Weapon::UpdateTranslation` | Coordinate-system offset followed by position addition |
|
||||
| `168ca0` | `skidmarkAddSkidMark` | Half-width offsets, four vertices, material/colour and mark metadata |
|
||||
| `1691b0` | `skidmarkStretchOldSkidMark` | Stationary left/right endpoint adjustment and completion flags |
|
||||
| `169378` | `skidmarkStretchOldSkidMark` | Moving forward/reverse vertex pairs and orientation history |
|
||||
|
||||
The earlier creation return `168b30` was already native. The existing forward
|
||||
helper snapshots operands, calculates separately rounded XYZ and retains
|
||||
destination W. Historical hosts and unknown callers retain the complete original
|
||||
ABI. All five new results are consumed as XYZ; native calls leave VU registers,
|
||||
accumulator, flags and data memory untouched. Smoothing, timers, material gates,
|
||||
list operations, travel-direction checks and vertex publication stay compiled
|
||||
game code. No register shadow or VU reconstruction is added.
|
||||
|
||||
## Complete generated consumers and entries
|
||||
|
||||
Evidence is under `D:/BozoScratch/weapon-skid-transforms`, against main `c5888d2`
|
||||
(PR #43). Generated code, retail data, recordings and captures stay outside Git.
|
||||
|
||||
- Added coverage is 2,560 sequences / 160 whole-memory comparisons. Aggregate
|
||||
coverage is 79,360 / 2,944. Four host rounding modes, denormal controls, RAM
|
||||
aliases, all four tires/mark slots and arbitrary position/vertex W are covered.
|
||||
- Each site has 256 helper-boundary cases through the complete consumer/return,
|
||||
plus 256 actual function entries: 512 generic weapon updates, 256 skid
|
||||
creation updates and 512 stationary/moving stretch updates in total.
|
||||
- Weapon entries exercise both basis-selection modes, zero/nonzero prior
|
||||
translation, real smoothing and timer-scaled offsets. Generic types 0–3 and
|
||||
the terrain-adjustment-disabled tail are covered. Special weapon update
|
||||
routines and the optional height-query branches are outside these fixtures.
|
||||
- Creation entries cover disabled generation, invalid material, tire rejection,
|
||||
overload rejection, both travel directions, removal from the free list and
|
||||
insertion into the used list, and reuse with an empty free list. Actual
|
||||
material, timer and intrusive-list routines run without stubs. RGB packing,
|
||||
mark-index publication and all four vertex records are compared.
|
||||
- Stretch entries cover material/direction rejection, distance and accumulated
|
||||
angle gates, retained short marks, both moving directions, stationary
|
||||
left/right updates and completion flags. The actual software-double
|
||||
conversion/multiply/conversion width producer executes before moving offsets.
|
||||
Explicit per-site reach assertions distinguish active paths from early exits.
|
||||
- CPU outside retired VU, outgoing host FP effects, clocks/checkpoints, call
|
||||
counts and final memory agree. Native VU stays untouched through the complete
|
||||
consumers. W exclusions occur only after all real consumers run and are
|
||||
restricted to the audited stack offset records and creation's tire-position
|
||||
W. Published coordinate-system and vertex W remain compared exactly.
|
||||
- Whole-memory entry samples cover active weapon translations, new mark creation,
|
||||
stationary stretching and moving vertex updates. Historical forward ABI
|
||||
coverage grows to 5,504 / 344 cases / whole-memory checks; inverse stays at
|
||||
5,696 / 89. Existing hierarchy coverage retains 786,432 helper cases / 384
|
||||
whole-memory, 8,000 geometric edges, 1,024 complete BSP callers / 32 whole-memory
|
||||
and 2,048 unknown ABI cases.
|
||||
- Player, headless runner, historical checker and all test targets build.
|
||||
All eleven native suites and twelve Python tooling tests pass.
|
||||
|
||||
## Replay qualification
|
||||
|
||||
Default and strict routes complete 9,500 one-player and 8,500 actual four-player frames.
|
||||
Every recorded field matches the immediate parent: raw RAM, scratchpad, calls,
|
||||
draws, sound, threads, counts and EE clocks. Both sampled full 32 MiB RAM snapshots
|
||||
match exactly. Strict/default recording files and snapshots are byte-identical.
|
||||
No observer, RAM mask or VU restoration is needed.
|
||||
|
||||
| New return | One-player calls | Four-player calls |
|
||||
| --- | ---: | ---: |
|
||||
| `1b28e8` | 5,648 | 0 |
|
||||
| `168ca0` | 1,522 | 1,449 |
|
||||
| `169378` | 2,578 | 6,914 |
|
||||
| Total | 9,748 | 8,363 |
|
||||
|
||||
Weapon-local `1b28cc` and stationary `1691b0` are cold in these routes and are
|
||||
qualified by the generated comparisons. Total native forward calls become
|
||||
1,172,820 / 375,625. Default routes make zero original-helper comparisons and
|
||||
execute zero VU0 microprograms. Counts establish reach, not a measured speedup.
|
||||
|
||||
Fresh 6,500-frame one-player and actual four-player windowed routes and a
|
||||
4,200-frame movie/menu route complete through clean exit, with isolated scratch
|
||||
user data. Reviewed captures show decoded movie action (1,000), return to menu
|
||||
(1,800), Junkyard loading (one-player 4,500), movement and active combat with
|
||||
weapon effects (one-player 5,500 / 6,300), and four advancing snow-arena views
|
||||
with skid effects (four-player 5,500 / 6,300). These are bounded functional
|
||||
checks, not pixel-exact windowed or console parity.
|
||||
|
||||
Windowed one-player reaches coordinate-system weapon translation 1,718 times,
|
||||
skid creation 450 times and moving stretch 778 times: 2,946 new native calls.
|
||||
Four-player reaches creation/stretch 825 / 3,195 times: 4,020 new calls. The two
|
||||
fixture-qualified cold sites remain cold here; all five are cold in the movie route.
|
||||
|
||||
All three stereo 48 kHz WAV recordings contain audio. Device logs report
|
||||
25.6 / 53.4 / 31.2 ms of silence (movie / one-player / four-player), with underruns
|
||||
and dropped frames. Deterministic gameplay sound is exact; flawless device audio
|
||||
and subjective listening are not claimed.
|
||||
|
||||
## Remaining scope
|
||||
|
||||
The two inventories now contain 95 native forward and 89 native inverse sites.
|
||||
Outside their allowlists remain 174 forward and 45 inverse sites, 219 in total
|
||||
across the game. This structural count excludes other helper families and inline
|
||||
VU operations. Full campaign, every weapon/special attack and console visual/audio
|
||||
parity remain separate work.
|
||||
Loaded 100 of 223 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user