Gundam Wing: Endless Duel (SNES) Static Recompilation - Source
Version 1.0.0

This package contains the Gundam Wing: Endless Duel-specific static core and
its native Windows Launcher frontend. The original game ROM is not included.

Running the application
-----------------------

Place the verified Shin Kidou Senki Gundam W - Endless Duel ROM in the Rom
folder beside Launcher.exe, then run Launcher.exe. Browse ROM can select the
verified file elsewhere. The complete ROM identity is checked before play is
enabled.

Escape switches between gameplay and the launcher without resetting the
machine. Press 1 or 2 to save or load the current snapshot slot. F1 opens the
Welcome guide, F2/F3 open the Save/Load Snapshot windows, F4 opens Settings,
F5 opens Controller Bindings, F6 opens Audio Settings, F7 runs the selected
ROM and F8 captures a screenshot. Accepted settings, audio options and both
players' controller bindings are stored in settings.ini beside Launcher.exe.

What fully static recompilation means
-------------------------------------

Gundam Wing: Endless Duel executes through ahead-of-time native code generated
from the supported cartridge. Its W65C816/S-CPU instructions were analysed
before building and lowered into fixed C source. The current production index
contains 39,306 exact PBR:PC:E:M:X context records split across 511 exact
CPU-page groups and selects 303 ahead-of-time native semantic templates.

There is no general-purpose S-CPU interpreter, runtime opcode decoder, JIT,
dynamic recompiler, runtime learning system or emulator fallback. Finite
dynamic control-flow sites, interrupts, returns and re-entry routes are guarded
by the compiled authority. An unknown route stops and records the exact missing
state instead of guessing or silently interpreting it.

The generated S-CPU authority is losslessly compacted after authority closure.
Exact-key frozen parameter records factor 39,003 repeated instruction bodies
through 303 native C templates while retaining all 39,306 contexts, their
source-byte guards, diagnostic labels, finite successor sets, interrupt/return
routes and fail-closed behavior. It does not decode ROM opcodes at runtime.
The compact generated source is 6,887,777 bytes; in the certified Visual Studio
Release build the static library fell from 23,106,614 to 3,851,300 bytes and
Launcher.exe fell from 9,935,360 to 5,646,336 bytes. The deterministic
compaction tool and its reconstruction receipt are included in the source
package.

Graphics, audio, menus, fights and player actions are computed live from
machine state and input. Nothing is prerecorded. Fully static means that the
game and audio-driver instructions are compiled ahead of time.

Static machine coverage
-----------------------

The production core includes:

- Ahead-of-time W65C816/S-CPU game-code execution.
- LoROM mapping, 128 KiB WRAM, open bus and cartridge/machine bus behavior.
- CPU I/O, timers, NMI, IRQ, auto-joypad and two controller serial ports.
- Native DMA and HDMA with scanline scheduling.
- NTSC master-clock, scanline, H-clock, refresh and frame scheduling.
- PPU register state, VRAM, CGRAM, OAM, backgrounds, objects, source-reached
  Modes 0 and 1, windows, color math, forced blank and completed framebuffers.
- Exact-PC ahead-of-time SPC700/S-SMP audio-driver execution.
- Exact scheduled 32-phase S-DSP execution and deterministic stereo PCM.
- Five integrity-checked full-machine snapshot slots.
- Fail-closed diagnostics containing CPU, SMP, DSP, scheduler, PPU, input,
  timing and machine-state evidence.

Static audio core
-----------------

Audio is fully generated inside the static core. The game's own SPC700 program
runs as 1,663 ahead-of-time exact-PC instruction bodies in 16 deterministic
shards against project-owned 64 KiB audio RAM, timers, CPU/APU ports and DSP
registers. There is no runtime SPC700 interpreter and no emulator audio library
linked into the application.

The project-owned S-DSP advances the authentic 32 internal phases and eight
voices. It covers BRR decoding and filters, Gaussian interpolation, pitch and
pitch modulation, ADSR/GAIN envelopes, key timing, noise, voice/master volume,
ENDX, echo addressing, eight-tap FIR echo, feedback, echo writes, clamping,
mute and reset behavior. The core produces native 32,000 Hz signed 16-bit
stereo PCM under the same SNES master-clock scheduler as the S-CPU and PPU.

The Windows frontend drains completed DSP work into a bounded FIFO and sends
it to a DirectSound circular buffer. Native PCM is resampled to the selected
device rate with Hermite interpolation by default. Real play-cursor queue
measurement, bounded drift correction and underrun recovery keep host output
synchronized while machine time remains owned by the static core.

How Mesen was used
------------------

Mesen/MesenCE was used as an independent development oracle and source
reference for selected boot, gameplay, framebuffer, input, timing, S-SMP and
S-DSP comparisons. Its results helped locate disagreements that were then
repaired in the Gundam Wing static core and frontend.

Mesen is not included, linked or called by the release. It never executes a
production frame and does not provide a fallback core. Runtime authority comes
only from the ahead-of-time Gundam Wing implementation.

ROM requirements
----------------

Title: Shin Kidou Senki Gundam W - Endless Duel
Region: Japan NTSC
Format: unheadered .sfc
Size: 2,097,152 bytes
SHA-256: dd94308d822636c6ddf73c5e2644c84f2eb8fb4d9201150fc5f37d44d6f423f1

The ROM and original game assets are never included in source or release
archives.

Windows build
-------------

Requirements:

- CMake 3.20 or newer
- Visual Studio 2022 with the x64 C/C++ toolchain
- Internet access during first configuration so CMake can obtain SDL 3.4.10

From the source root:

  cmake -S frontend -B build -G "Visual Studio 17 2022" -A x64 -DGUNDAM_W_FRONTEND_REBUILD_CORE=ON
  cmake --build build --config Release --parallel
  ctest --test-dir build -C Release --output-on-failure

The application is build\release\Gundam Wing Endless Duel.exe. Release builds
statically link the Visual C++ runtime and SDL3 gamepad support. Video and
dialogs use Win32/GDI; speaker output uses DirectSound.

Verification
------------

ROM-free tests cover frontend settings persistence, both players' keyboard and
gamepad action order, reserved-shortcut rejection, audio settings persistence,
audio resampling, machine reset and deterministic snapshot state. The static
core's focused suites cover its S-CPU, S-SMP, S-DSP, PPU, DMA/HDMA, timing,
input and fail-closed owners.

Development validation reached live Story and Versus gameplay, exercised both
controller ports, characters, attacks and special-move paths, and compared
captured frames at title, selection and fight checkpoints. The final user test
confirmed stable audio and representative windowed/full-screen screenshots.

Frontend and release behavior
-----------------------------

See VERSION.txt for launcher, display, input, snapshot and audio features. The
first-run Welcome state is saved in settings.ini. Reopening Welcome with F1 is
modal, scales to the monitor work area, supports keyboard navigation and
returns keyboard focus to the previous valid launcher/game control when it
closes.

Failure logging
---------------

If the static core reaches an uncompiled execution or hardware state, the app
pauses and creates Logs\Static-Core-Failure-YYYYMMDD-HHMMSS-mmm.txt. A large
read-only error window shows the repair evidence and provides a Close button.
The logging path does not enable a fallback emulator.

Package contents
----------------

The Windows release contains Launcher.exe, README.txt, VERSION.txt,
THIRD-PARTY-NOTICES.txt, SDL-LICENSE.txt and SNES9X-LICENSE.txt, plus Rom and
Screenshots folders with short instruction files. Saves and Logs are created
only when needed. The archive excludes the ROM, settings.ini, snapshots,
captured screenshots, logs, test evidence and external controller databases.

Licensing and original game
---------------------------

SDL 3.4.10 is statically linked under its zlib license. Snes9x/byuu material
was retained as audio-semantic development reference within this family of
SNES static-recompilation work; its notice is supplied conservatively with the
source and binary packages. See THIRD-PARTY-NOTICES.txt, SDL-LICENSE.txt and
SNES9X-LICENSE.txt for the distributed notices and terms.

Gundam Wing: Endless Duel, its ROM, music, graphics and other original assets
are not distributed. The user must provide the exact legally obtained ROM
listed under ROM requirements.
