TwinPlay 0.1.6: The New Worlds Moon Jump correction
Date: 2026-11-04

SUPPORTED GAME

The supplied "New Super Mario Bros The New Worlds.nds" is identified in the
database as Super Mario Bros. - The New Worlds v3.1.0.
Game code and database header checksum: A2DE-23B09FAD
ROM SHA-256: 8199b015b98fa7874247bd55f40b70a1432d7e8828ab6c945b7b0fe2f10e9f8d

USE THE CUSTOM CODE IN TWINPLAY 0.1.5

1. Select The New Worlds. Open its card menu > Manage cheats, or open the
   in-game menu > Cheats.
2. Disable the original Moon Jump. Disable other jump modifiers while first
   checking the correction.
3. Select Add custom code. Name it "Moon Jump (Hold B, fixed)" and paste all
   six lines from MOONJUMP.txt into the code field. Select Add cheat.
4. Turn on Enable cheats and enable the new custom entry. Adding a custom
   code does not enable it automatically.
5. Resume the game. Hold B to rise continuously; release B to fall normally.
   Restart the game if the original code already affected the running session.
   Restarting discards unsaved progress.

This option requires no emulator rebuild and preserves any imported database.
The code uses the same 0x3800 upward speed as the original moonjump.

IMPORT THE SMALL DATABASE INSTEAD

From the selected game's cheat page, choose Database > Import usrcheat.dat
and select this directory's usrcheat.dat (588 bytes). Enable its entry named
"Moon Jump (Hold B, fixed)", enable global cheats, and disable the original
Moon Jump. TwinPlay also accepts the same file with a descriptive .dat name.

TwinPlay merges imported codes with bundled codes. Importing this correction
does not remove or disable the old bundled entry. TwinPlay stores only one
imported database: this import replaces any previously imported DAT. Use the
custom-code option above if you want to keep another imported database.

UPDATED SOURCE PACKAGE

The TwinPlay 0.1.6 source package already contains the corrected full database
at assets/cheats/usrcheat.dat. After building/installing 0.1.6, enable the
bundled "Moon Jump" for The New Worlds again. The corrected code has a new
selection key, so its old enabled flag is not reused automatically. Disable
any separate old imported/custom moonjump entry that still writes 021B6AB0.

Do not replace the full bundled database with the small add-on: the add-on
intentionally contains only one game's one corrected code.

CAUSE AND CORRECTION

In the tested World 1-1 session, memory at 0208B35C held player pointer
021B6FDC. Mario's vertical velocity is at player pointer + D4 = 021B70B0.
The original database wrote 021B6AB0, which was 0x600 bytes too low.

The corrected code follows the current pointer on each execution. It keeps
the B-held condition and existing 020CA880 guard, checks that the pointer is
nonzero, writes 00003800 to the player's D4 field, and resets the AR offset.
The exact pointer-based pattern is also present in the supplied community
database for Super Mario - Endless Earth v1.04.

VALIDATION

The uploaded ROM was booted and played in TwinPlay's actual vendored melonDS
core, on x86_64 with JIT, FreeBIOS, generated firmware, and software rendering.
From the same World 1-1 save state, the old code reproduced the failure while
the corrected code made Mario rise continuously. Releasing B resumed falling
and Mario landed. Holding A instead produced an ordinary jump.

Native TwinPlay database parsing, exact revision matching, custom-code
parsing, interpreter/JIT homebrew smoke tests, and source/UI checks passed.
All 4,262 unrelated game records and the other 103 New Worlds cheat entries
are byte-for-byte unchanged in the corrected full database.

Actual Ubuntu Touch hardware, later levels, multiplayer, different ROM
revisions, and combinations with other movement cheats were not tested.
See ../../TEST-RESULTS.md, database-verification.json, static-evidence.json,
and validation/ for the evidence and reproducible gameplay harness.

REPRODUCING THE DATABASE PATCH

The patcher requires Python 3 and the exact original database from the
supplied ubuntu-touch-twinplay-src-0.1.5.zip. It checks that file's SHA-256,
edits one cheat, updates its length fields and later DAT offsets, then checks
all unrelated record bytes. It preserves the input and refuses to overwrite
an existing output.

   python3 patch_new_worlds_moonjump.py patch ORIGINAL_USRCHEAT.dat FIXED_USRCHEAT.dat
   python3 patch_new_worlds_moonjump.py addon NEW_ADDON.dat

The corrected full database has 4,263 records and 55,503,284 bytes.
Full database SHA-256:
7f13c13153ba2455faf7b7f0a1eded0452165aff4054ad45cc0dd6b114fe7cd3
Small add-on SHA-256:
96b1a8c1470eb0843e135148b5d7b1914024947baa6f3405c2acd827faf0a5ba

ENCODING

These instructions, source, and cheat text use ASCII characters compatible
with UTF-8. Keep the cheat as plain text, with ordinary spaces and line
breaks. Editors that insert nonbreaking spaces or other formatting can make
TwinPlay reject a pasted code. Do not open or resave either binary DAT in a
text editor; that can corrupt its bytes and string encodings. The patcher
preserves all existing database label bytes without converting their encoding.

ATTRIBUTION

Database: DeadSkullzJr and contributors, base revision 2025-08-12.
The full package retains the original notices and AGPL-3.0 database license.
This is a local TwinPlay correction, not a new upstream database release.
The patcher is provided under GPL-3.0-or-later.
