SECRET OF MANA USA - ORIGINAL CONTENT PRESERVATION AND JAVA WORK

STATUS: The complete playable Java recreation is unfinished.
Native Java/HTML5 build:0.16.0.
This package preserves the selected original cartridge and exports authentic
game assets/data into editable forms. Its HTML5 Java build now includes an
opening-event interpreter, original walking playback, counted actor transport,
original Randi88 stagger and9D held pose, source visibility toggles,
supported original exits and flat-ground movement. The original fresh opening
A0 now executes source world movement and wrapping. Its nested frame programs
also run in a separate fixed-position artwork preview. The two original C0/C1
NPC reactions after A0 now execute34/action82 with source sprites and X
transport through the original pre-door wait. The browser includes a short
Try the opening guide beside its controls. The fresh waterfall landingA2 now
runs original height/velocity effects and per-background fine scroll masks.
Its sourcecamera stays360,328 and its actual reflected movement is488-to518-to508
atworldY442, returningheight0. The next original A9 reaction now runs eight
frames in Java, completes its original busy barrier and resumes the dialogue
after the source wait. Randi remains at508,442. The earlier original34/action80
now restores its five equipment palette words in Java with the original body
colors unchanged. Original sound remains pending.
The verified fresh A2/A9 FF now enters its original ordinary group0 palette,
preset and frame program in the same eligible call. Event00 clears F1; the
next original player-input callback remains an explicit development pause.
It is not a running campaign. No emulator or generic prototype is included.
STATUS.json describes coverage and remaining work.

SELECTED ORIGINAL
Secret of Mana (USA), revision 0 (version 1.0), 2,097,152 bytes, no copier header.
SHA-256: 4c15013131351e694e05f22e38bb1b3e4031dedac77ec75abecebe8520d82d5f
reference/ preserves the exact supplied archive and cartridge plus provenance.
The source archive/cartridge were not changed.

AUTHENTIC AND EDITABLE CONTENT
assets/sprites/: original indexed pixel banks, palettes, assembled frames,
  source metadata and explicit limits. Read its README and manifest first.
assets/maps/: original maps/layers, pixel indices, metatile definitions,
  palettes, collision bytes, object/trigger data and source addresses.
  All 512 map records are retained. Some graphics remain undecoded; every
  rejected/unsupported decode is recorded in failures.json. Static scenery
  legacy inspection exports omit animation, runtime effects, original source
  priority/backdrop composition and event-dependent visibility. The five
  separately verified browser Mode1 maps are under java-viewer/dist/assets/.
assets/ui-audio/: original UI bitplanes, packed menu-icon indices, two
  compressed title blocks, 64 sequence records and 33 BRR samples. UI grayscale
  palettes are inspection palettes; original UI display colors remain pending.
  Music data is preserved; playback is not implemented.
original-data/: 2,560 original event/name entries, 128 enemy records and
  1,024 original doors. Exact bytes remain alongside interpreted fields.
java-content/: Java importer/exporter, 4,291 source checks, original-content
  evidence and specific combat-glitch research. No claimed fixes yet.
java-viewer/: editable native Java/HTML5 runtime foundation, TeaVM0.16.0.
  Original script progression/dialogue/flags/choices, door coordinates,
  facing and counted walking, supported exits and map-entry events run
  in Java. Potos's original story-conditioned map piece updates its graphics
  and six collision cells together. Unfinished world effects remain pending
  and require explicitly
  labelled acknowledgement for inspection. All 37 opening objects and 14
  sprite sheets use original coordinates, palettes and source anchors.
  Five Mode1 backgrounds now honor original subtile priority and CGRAM0
  backdrop, repairing black holes in the tall grass. Their selected regular
  animation frame is documented; exact startup DMA, continuing animation,
  sprite depth and original color math remain unfinished.
  Original group1 walking for Randi and three opening NPC species now runs
  with source velocity presets, phased dispatch, actor completion and timers.
  Randi's original88 stagger and9D held pose now execute through the source
  forced31/34 modes with their original frame words, delays and completion.
  Original04/05 body flags reveal the player; CF01 gates its shadow separately; original09
  refresh removes the flag-invalid opening proxy while retaining valid actors.
  These returning commands yield until the next source event call.
  Nine forced-action profiles preserve284 atlas cells verified against53
  independent source frames. General equipment palette state, other fall contexts,
  other forced actions, ready/run groups, full actor AI/combat/state gates and
  complete event execution remain pending.
  Preview original fall frames executes the genuine addressed A0 graph inJava
  at fixed worldXY, including three sequential F1 calls and nested FF returns.
  Its source F95700 sound request stays pending until Continue preview without
  sound is explicitly chosen. This operation plays no audio. The scene's
  fresh opening movement uses the verified original FF0 viewport, inactive
  party partners and stationary camera24,24. Other contexts remain pending.
  The supported fresh opening06 clear path now setsF1bit80 and yields.
  Fresh A0 world transport begins at152,132, accepts195 downward pixels and
  wraps once toY7 while retaining the source CF01 shadow state. The body
  is drawn under its separate E00E flags; the prior body filter is corrected. Its world
  path also pauses atF95700; explicit skipping remains soundless inspection.
  Read ORIGINAL-OPENING-FALL-TRANSPORT.md, ORIGINAL-PARTY-VIEWPORT.md,
  ORIGINAL-OPENING-CAMERA.md and ORIGINAL-OPENING-PARTY.md in java-viewer.
tools/: reproducible extraction and preview tools.

RUN THE JAVA / HTML5 DEVELOPMENT BUILD
Requires a Java17+ JDK. In this package directory:
  java tools/PreviewServer.java java-viewer/dist 8080
Then open http://127.0.0.1:8080/ . Ctrl+C stops the local server.
Alternatively serve java-viewer/dist using any static HTTP server.
This build contains five genuine opening-area maps. Camera controls inspect
scenery. Enable Move Randi in Sword Falls or another ground map for native
movement on verified flat terrain. Original flat trigger tiles execute their
events and exits between these five maps. Slopes/corners/special tiles and
exits to unloaded maps are blocked. The log is cutscene-only. Speed, footprint,
the simplified trigger latch and object
interaction radius are development rules, not verified original movement.
Space routes nearby visible objects to their original event IDs.
Replay opening script executes event106 and its original calls, dialogue,
flags and waterfall door82. Remaining scene effects, sound and actions are pending;
the UI explicitly labels acknowledgements and skipped delays as inspection.
Original32 commands apply source actor selectors/E071 restrictions and
counted ordinary walks on supported flat terrain. Original walking programs
and velocity presets execute under the source five-phase NMI-paced nominal
clock. Original08 barriers and28 timers run on their source event phases.
Original31/34 modes execute supported Randi88/9D profiles. Active31 blocks08
until its source FF, while34 loops as the event remains active and is not busy.
The exact fresh opening34/action80 now runs its original83 palette copy;
other A0/A2 contexts, other actions, geometry/state gates, original input movement
and ready/run groups remain pending. Unknown geometry suspends the exact request.
Read java-viewer/README.md, NATIVE-ACTOR-RUNTIME.md, ORIGINAL-FORCED-ANIMATION.md
and ORIGINAL-ACTOR-ACTIONS.md
for exact limitations. Preview original fall frames is artwork inspection,
not game-world movement; it keeps original playerXY fixed and stops at audio.
The original fall sprite sheet and addressed programs are accessible through
the browser footer. Potos piece13 activates only at rawflag10=6..F;
sword acquisition at1 does not invent a Sword Falls geometry replacement.
Combat data allows seven reversible enemy-stat edits and validates exported
mods against the selected cartridge hash. These edits are data overrides;
they do not patch the original ROM or run a battle. Reset restores originals.

REBUILD AND RE-EXPORT
Build browser renderer (Java17+, Maven): cd java-viewer ; mvn package
Check compiled module (Node): cd java-viewer ; node check-viewer.mjs
Native Java event checks: 8,415 pass against the selected original bytes.
Native actor-command checks: 754 pass. Native trigger checks: 8 pass.
Original opening composition/raw-counter checks: 1,320 pass.
Original walking script checks: 481 pass; 24 atlas cells match 12 independent
original frame decodes. Three NPC walking atlases match 80 cells against 28
independent source frames. Ordinary-loop checks:314; clock:122; timer:268;
scripted-motion checks:695; scheduler source regions:40; collision audit:10,254.
Forced parser checks:1,284; player visibility/06/event-call yield checks:31.
Original unsigned16-bit coordinate wrap checks:14,980 with7 source regions;
wrapping does not grant movement. A0 world eligibility research:41 guards.
Original party viewport checks:295,172; combined A0 transport checks:22,774.
Fresh camera proof:30 source guards/86 event boundaries; fresh party proof:
44 source guards/68 event prefix boundaries. Scope is the source fresh opening.
Forced assets:9 profiles,284 atlas cells,53 distinct independent source frames,
15 source guards and32 original pointer selectors. Forced execution evidence
guards25 original source regions. World playback covers88/9D and the verified
fresh opening A0 and the exact C0/C1 NPC82 reactions. A separate fixed-position
A0 preview inspects the artwork. NPC82 combined checks:12,309 with104 source
regions; dedicated proof:39 guards,6 pointers,3 programs and5 presets. The
natural2810 wait yields154 pixels per NPC before door82 resets the old map.
Other palette/action contexts, fall contexts and remaining groups stay pending.
Original backdrop/display/DMA source checks: 26 pass. Corrected Mode1 images
independently verify source bitplanes, palette words and subtile attributes.
Native movement checks: 10 pass. Original runtime standing frames: 34 verified
pixel-for-pixel using an independent Java decoder. Collision export: 28,608
entries, 37 objects and 20 positioned triggers source-verified.
Compile content tools from package root:
  javac --release 17 -d build-tools java-content/src/preservation/mana/original/*.java
Check imported source:
  java -cp build-tools preservation.mana.original.OriginalDataChecks reference/secret-of-mana-usa.sfc
Export original content:
  java -cp build-tools preservation.mana.original.ExportOriginalData reference/secret-of-mana-usa.sfc new-data
Export sprites:
  java tools/SpriteExtractor.java reference/secret-of-mana-usa.sfc new-sprites
Export UI/audio:
  java tools/UiAudioExporter.java reference/secret-of-mana-usa.sfc new-ui-audio
Export guarded forced-action evidence:
  python tools/export_forced_action_evidence.py reference/secret-of-mana-usa.sfc --output new-forced-evidence.json
Export original forced programs/art (Python3 + Pillow):
  python java-viewer/dist/assets/runtime/export_forced_opening.py --rom reference/secret-of-mana-usa.sfc --output new-forced-assets
Export guarded fall/palette research:
  python tools/export_fall_palette_evidence.py reference/secret-of-mana-usa.sfc --output new-fall-evidence.json
Read verification/FALL-PALETTE-RESEARCH.md for the26 checked source regions
and remaining native fall/audio/equipment-palette work.
Export original fall world eligibility and coordinate bounds:
  python tools/export_a0_world_evidence.py reference/secret-of-mana-usa.sfc --output new-a0-world-evidence.json
  python tools/export_coordinate_wrap_evidence.py reference/secret-of-mana-usa.sfc --output new-wrap-evidence.json
Read verification/A0-WORLD-ELIGIBILITY.md, ORIGINAL-COORDINATE-WRAP.md and
A0-A2-ASSET-INTEGRATION.md. All112 A0/A2 atlas cells have an additional exact
word/attribute/source-pixel audit. The fresh A2 landing is implemented; other
contexts and original audio remain pending. New landing checks:393,941;
effects proof:15 guards; scope proof:64 regions/17 keys/32,768 height cases.
Four original BG priority planes recompose pixel-for-pixel to the prior image.
Their source jitter uses nominal counter parity; original initial F4 parity
remains unverified. A2 audit:72 atlas cells/11 independent source frames.
Export the bounded fresh camera and party proofs:
  python tools/export_opening_camera_evidence.py reference/secret-of-mana-usa.sfc --output new-camera-evidence.json
  python tools/export_opening_party_evidence.py reference/secret-of-mana-usa.sfc --output new-party-evidence.json
Read verification/ORIGINAL-OPENING-CAMERA.md and ORIGINAL-OPENING-PARTY.md.
Export the source NPC82 reaction proof:
  python tools/export_opening_npc82_evidence.py reference/secret-of-mana-usa.sfc --output new-npc82-evidence.json
Read verification/ORIGINAL-OPENING-NPC82.md and
java-viewer/ORIGINAL-OPENING-NPC-FALL-TRANSPORT.md for exact scope and checks.
Export the landing source/effects proofs:
  python tools/export_opening_a2_evidence.py reference/secret-of-mana-usa.sfc --output new-a2-evidence.json
  python tools/export_a2_animation_effects_evidence.py reference/secret-of-mana-usa.sfc --output new-a2-effects.json
Read verification/ORIGINAL-OPENING-A2.md and
java-viewer/ORIGINAL-LANDING-ANIMATION-EFFECTS.md.
The original plane exporter and A2 atlas audit are undertools/; portable
commands and limitations are in verification/A2-RENDER-ASSETS.md.
Inspection suspension checks:3,275 with11 original source guards;
clock122 and timer268 regressions pass. Source phases/counters and newly
created timers/RTS yields survive pending effects without elapsed catch-up.
Read java-viewer/ORIGINAL-WORLD-SUSPENSION.md for portable reproduction.
Export the landing reaction source and artwork proofs:
  python tools/export_opening_a9_evidence.py reference/secret-of-mana-usa.sfc --output new-a9-evidence.json
  python tools/audit_a9_render_assets.py --rom reference/secret-of-mana-usa.sfc --runtime java-viewer/dist/assets/runtime --independent-frames assets/sprites --before verification/forced-profiles-before-a9.json --output new-a9-assets.json
Native A9 parser/event checks:111,811. Source proof:27 regions/11 literal keys.
All32 A9 atlas cells match9 independent source frames; all25 earlier forced
asset files remain byte-identical. Full forced set:9 profiles/284 cells/53
distinct entity-frame pairs. Read java-viewer/ORIGINAL-LANDING-REACTION.md,
verification/ORIGINAL-OPENING-A9.md and verification/A9-RENDER-ASSETS.md.
General idle/status and arbitrary A9 contexts remain pending. The verified
fresh active-event A2/A9 ordinary group0 restart is implemented separately.
The original DB waterfall splash now uses transparent idle frame7, its
exact group0 side program, source86 flicker,88 flag clear and89 deactivation.
It takes16 eligible animation calls and cannot respawn through an inferred
ordinary loop. All28 water cells match8 independent Java frames;64 earlier
runtime asset files remain unchanged. Nonzero walks/general streaming remain
pending. CF01 gates later shadow output, not the previously emitted body;
the corrected A0 renderer retains body80 hide and40 odd-counter flicker.
Native water/body checks:381,343. Source proofs:water43 regions/16 literal
keys; body/shadow12 regions/7 keys.
Read java-viewer/ORIGINAL-WATER-ANIMATION.md and
verification/ORIGINAL-BODY-SHADOW-GATES.md for reproduction and limits.
  python tools/export_opening_water_evidence.py reference/secret-of-mana-usa.sfc --output new-water-evidence.json
  python tools/export_body_shadow_gates_evidence.py reference/secret-of-mana-usa.sfc --output new-body-shadow-evidence.json
See java-viewer/dist/assets/runtime/WATER-ORDINARY-RESEARCH.md for the
portable sprite exporter, independent Java wrapper and exact pixel verifier.
The early fresh opening34/action80 loops its original frames and83 copy.
The actual new-character initializer equips item9/class1; its pre-event
refresh installs selector24 from11F6F0 at RAM0702..070B. Native83 copies
those five raw words and clears byteE104. Sword Falls header5=41 sets the
complete DP98word0800 and selects auxiliary82/mainA2. Only the current20
palette words are known; prior bank colors can be replaced by object loads. It retains15
original Randi body colors. Twenty OBJ words are known; other colors remain
unverified. General idle/status, equipment overlays and DMA timing are pending.
Native palette checks:4,328,870. Source proof:43 regions/16 literal keys and43
event prefix boundaries. Art audit:16 guards/12 atlas cells/3 Java frames/8
equipment contexts. Read java-viewer/ORIGINAL-AUXILIARY-PALETTE.md,
verification/ORIGINAL-OPENING-ACTION80.md and ACTION80-PALETTE-ART.md.
  python tools/export_opening_action80_evidence.py reference/secret-of-mana-usa.sfc --output new-action80-evidence.json
  python tools/audit_action80_palette.py --rom reference/secret-of-mana-usa.sfc --runtime java-viewer/dist/assets/runtime --independent-frames assets/sprites --output new-action80-art.json
Original ordinary idle checks:119,116 against56 source regions and9 inline
guards. Independent proof:31 literal keys,4 selectors,3 programs,48 family
comparisons,32,768 height cases and256 FE cases. Both fresh A2/A9 FF enter83,
A7 and the first source frame in the same animation call. Player32's actual
direction change reselects naturally; a same-code player32 retains its cache.
Ordinary FF loops independently ofD0, but the host supports only the verified
active-event input gates. Original00 clears wholeF1; the C1:8089-to-C0002D
input callback remains pending, with no invented zero-input state.
The idle profile shares the unchanged original48x128 PNG and33-byte program
binary. Its12cells match3 independent Java frames;17 asset source guards and8
equipment contexts pass. 72 earlier runtime files remain unchanged; the palette JSON has one explicitly source-verified correction. The original fingerprint is retained.
Read java-viewer/ORIGINAL-IDLE-ANIMATION.md, ORIGINAL-OPENING-IDLE.md and
RANDI-IDLE-ASSETS.md for source contracts and portable reproduction.
  python tools/export_opening_idle_evidence.py reference/secret-of-mana-usa.sfc --output new-idle-evidence.json
  python java-viewer/dist/assets/runtime/export_randi_idle.py --rom reference/secret-of-mana-usa.sfc --output java-viewer/dist/assets/runtime
  python java-viewer/dist/assets/runtime/verify_randi_idle.py --rom reference/secret-of-mana-usa.sfc --runtime java-viewer/dist/assets/runtime --independent-frames assets/sprites --before verification/asset-fingerprints-before-randi-idle.json
Build0.15 corrects the conditional equipment0/reset model to actual fresh
equipment9, palette24 and source family2240. All preserved body PNGs/BINs
and15 main colors remain unchanged. Read java-viewer/FRESH-START-CORRECTIONS.md.
The explicit browser controllerPacket API keeps opposed direction bits.
Java directional checks:45,790. No-button candidate checks:496,172 against
44 source regions/14 additional inline guards. Source artifact audit:25 guards,
36 indexed/RGBA cells and6 programs. Candidates refuse required callbacks
transactionally; they do not implement native post-END gameplay. Actual
dirty7 requires stat/graphics/object refresh. The source camera is held there.
  python tools/export_postevent_input_evidence.py reference/secret-of-mana-usa.sfc --output new-input-evidence.json
Read java-viewer/ORIGINAL-POSTEVENT-INPUT-HELPERS.md for portable Java checks.

Build0.16 adds real native Java stat formulas for the original fresh hero,
including the144 source-owned initialized stat bytes. The dirty7 preparation
now runs both stat callbacks,12 original party tile reloads (including inactive
partners), the source-owned768-byte pool scan,64-tile equipment conversion
and the actual five-word auxiliary palette copy. No callback is a successful
placeholder. The complete candidate is isolated and commits only changed
owned actor fields after matching its retained actor/global/pool/scratch and
all three actual party species. Original PNG/BIN artwork remains accessible.
Source contact/proximity writes are separate from the later object scan.
Native Java counts: stat190,448; dirty7 with real stats7,078; graphics9,781;
pool/contact3,065; complete preparation266,835; hardware-NMI protocol1,152.
The clock preserves physical field parity separately from sourceF4/phase.
Source EC02 wakes the graphics wait without a normal game update; EC01 later
finishes that same logical dispatch. Neither the event nor the input/stat/
transport/countdown call may be repeated during the retained continuation.
Independent pool/contact/NMI proof45regions/24literals; continuation-state
proof17regions/10literals. Exact callerDP0C is retained for all256 raw counts;
the separate source proof permits symbolic unknown0C until ordinary overwrite.
These are completed source-owned preparation components. They are not yet
connected to the live player-control handoff. The current browser opening
still pauses after its dialogue; full native controls and campaign are pending.
Read java-viewer/ORIGINAL-FRESH-CHARACTER-REFRESH.md,
ORIGINAL-FRESH-STAT-CALCULATION.md, ORIGINAL-FRESH-GRAPHICS.md,
ORIGINAL-LANDING-OBJECT-POOL.md and ORIGINAL-HARDWARE-NMI-CLOCK.md.
  python tools/export_fresh_stat_runtime.py reference/secret-of-mana-usa.sfc --output new-stat-runtime.json
  python tools/export_fresh_graphics.py --rom reference/secret-of-mana-usa.sfc --output new-fresh-graphics
  python tools/verify_fresh_graphics.py --rom reference/secret-of-mana-usa.sfc --assets new-fresh-graphics --output new-fresh-graphics-verification.json
  python tools/export_landing_object_pool_data.py --rom reference/secret-of-mana-usa.sfc --output new-pool-runtime.json
  python tools/export_landing_pool_nmi_evidence.py reference/secret-of-mana-usa.sfc --output new-pool-nmi-evidence.json
  python tools/export_landing_continuation_evidence.py reference/secret-of-mana-usa.sfc --output new-continuation-evidence.json

Export all map data and scenery (Python3 + Pillow):
  python tools/export_maps.py --rom reference/secret-of-mana-usa.sfc --output new-maps --all
Read assets/maps/README.txt for limited/no-render exports and limitations.
Recompose opening pieces for native raw flag values (from java-viewer):
  python tools/compose_opening_maps.py --rom ../reference/secret-of-mana-usa.sfc --maps-dir ../assets/maps --output new-composition --flag 0x10=6
Read dist/data/opening-composition/ and dist/assets/runtime/ for precise
original layer/trigger/animation evidence and remaining playback limits.

REUSE AND PRESERVATION
New source code is separated from the original game's data. This supports
an editable native Java implementation and reuse of the new tools/structure.
The original game assets and data retain their original attribution; they are
not newly authored art. TeaVM's runtime/compiler license and notice are in
licenses/. Primary format/research references are retained in the manifests,
source comments, and evidence documents.

CHECKSUMS.json contains SHA-256 for every packaged file except itself.
