New Worlds moonjump validation, v0.1.6
====================================

Purpose
-------
This reproduces the comparison made with the supplied Twinplay melonDS core:
no cheat, the existing fixed-address cheat, and the corrected player-pointer
cheat, all starting from one saved state in World 1-1. The test also releases
B to verify falling and holds A without B to check the button condition.

The ROM is supplied by the person running the test. This folder contains no
ROM, BIOS dump, compiled binary, screenshot, RAM dump, or saved-state bytes.
Source, JSON, commands, and logs are UTF-8 text using ASCII characters. Keep
these encodings when editing; rich-text editors can corrupt code/hex digits.

Exact input used
---------------
Filename: New Super Mario Bros The New Worlds.nds
Size: 33554432 bytes
SHA-256: 8199b015b98fa7874247bd55f40b70a1432d7e8828ab6c945b7b0fe2f10e9f8d
Cheat database identity: A2DE-23B09FAD

Build
-----
Requirements: Linux x86_64, Python 3, gcc, g++, ar, and the complete supplied
Twinplay source. This recipe uses the vendored dependencies and needs no
network downloads, Qt, external firmware, external BIOS, or CMake.

From the extracted Twinplay source root:

   python3 fixes/new-worlds/validation/build-harness.py \
      --source . --build-dir validation-build --jobs 4

If this folder is elsewhere, use its actual path for build-harness.py. The
--source argument must still identify the extracted Twinplay source root.
The source set and flags match the original successful manual build.
The build recipe targets x86_64 desktop validation, not an Ubuntu Touch app.

Run from a fresh game
--------------------
Use a NEW writable test directory so a previous battery save does not change
the File 1 menu or world-map position. The ROM path can be absolute or relative.
The harness reads the supplied ROM but does not modify it.

   validation-build/harness \
      '/path/to/New Super Mario Bros The New Worlds.nds' \
      validation-run-01 \
      < fixes/new-worlds/validation/fresh-run-commands.txt \
      > validation-run-01.log 2>&1

The initial black screen is ordinary boot timing. The scripted input waits
900 frames, selects Singleplayer and a new File 1, moves right on the map,
enters World 1-1, waits until the player is controllable, and saves baseline.
It then restores that baseline before each comparison. Counts are emulated
frames; there is no dependence on sleep duration or host playback speed.

The harness creates game.sav, baseline.state, and two PPM screenshots in the
chosen test directory. These files contain game data and remain local test
outputs. Do not add them to the source package. Their creation is deliberate;
no existing saves outside this dedicated directory are used.

Expected observations
---------------------
At the tested World 1-1 starting point:

   0208B35C = 021B6FDC  current player pointer
   021B7040 = FFEF0000  initial Y position, player + 0x64
   021B70B0 = FFFFE000  initial Y velocity, player + 0xD4
   020CA880 = 00000000  gameplay guard

The existing cheat writes 021B6AB0, which is 0x600 bytes below the current
velocity address. After 60 frames holding B, both no-cheat and old-cheat
cases have landed at the initial Y position. The corrected code instead
produces Y=FFFBE680 and velocity=00003700, with Mario above the visible screen.
The game's physics runs after the cheat write, so a steady 00003700 readback
is compatible with the cheat writing 00003800. On first takeoff, ordinary
jump logic briefly produces 00003980.

After releasing B, velocity is downward after 20 frames. After 150 released
frames Mario is back at the initial Y position. With the corrected cheat
enabled and only A held, the normal jump has ended by frame 60; there is no
sustained moonjump.

Evidence and scope
------------------
results.json records the exact observed values and the limited test scope.
fresh-run-commands.txt and fresh-run-output.txt are the authoritative complete
fresh-game rerun. This rerun used a new test directory and the FULL ORIGINAL
database cheat, including the 920CA880 00000000 guard. It completed all
same-state comparisons, release/fall, and A-only checks successfully.

recorded-commands.txt and recorded-output.txt preserve the earlier actual
second-process comparison. That earlier harness's old-code vector omitted
the guard. The guard was zero throughout the comparison, making the measured
behavior equivalent in that scene. The fresh rerun removes this ambiguity:
the full original code reproduces the failure, and the pointer fix works.
Every comparison memory value matches the earlier log exactly. Fresh log
FRAME counts are higher by 2265 because the rerun also includes boot and
navigation. The fresh command file creates its own baseline; no saved-state
bytes are supplied with this package.

The player pointer was observed as zero at the menu and 021B6FDC in World 1-1.
The guard was 8 during level entry and 0 during play. Suppression of writes
while the pointer was null or the guard was nonzero was not separately
measured in this gameplay run. The conditions are part of the supplied code.

Gameplay was tested with Twinplay's bundled core on Linux x86_64 with JIT,
FastMemory=false, FreeBIOS, generated firmware, and software rendering.
It was not tested on physical Ubuntu Touch hardware, ARM64, later levels,
or multiplayer. No emulator-core behavior was changed for this fix.

Reproduction status
-------------------
The original manual build and original harness were compiled and used for
the initial gameplay. The packaged harness was compiled and linked again
after restoring the full original guarded comparison code. The complete
fresh-run command file then passed from a new test directory.

The generalized Python build recipe was syntax/argument checked, and its
91-source list matches the successful manual build exactly. Its full clean
rebuild was not rerun. The fresh validation reused the previously compiled
unchanged core archive and rebuilt the packaged harness.
