Super Mario Sunshine - PC port (built from the decompilation)
============================================================

This folder contains only the program. It does NOT contain the game: you need your own
copy of Super Mario Sunshine, US version (game ID GMSE01), Japanese version (GMSJ01) or
European version (GMSP01, experimental), as a disc image (.iso, .gcm, .ciso, or Dolphin's
compressed .rvz, .wia and .gcz), or a folder extracted with Dolphin (right-click the game >
Properties > Filesystem > Extract Entire Disc). Every RVZ/WIA compression Dolphin offers
works (Zstandard, LZMA, LZMA2, bzip2, none).

Regions and game behaviour (w13)
--------------------------------
Always start sms_port.exe: it runs the US disc, and hands a Japanese disc to
sms_port_jp.exe and a European one to sms_port_eu.exe automatically. The European disc
is experimental: it plays from the 60 Hz question through the file select, option screen
and stages, but parts of the European game code are not reconstructed yet (see below).
With it, Esc > Game also offers "PAL video" (60 Hz, 50 Hz, or ask at boot as the GameCube
does) and "PAL language" (the console language: English, German, French, Spanish,
Italian; the game's option screen changes it too).
Esc > Game > "Game behaviour" (or "behaviour =" in port_settings.ini) picks the game-code
differences of the US, Japanese or European release (sound effects, fixes, small gameplay
changes) on whichever disc you use; text, menus and other disc data always stay the disc's.
"Match disc" (the default) plays exactly like the release the disc belongs to. "Europe" is
experimental: a few of the European release's differences are not verified yet. A change
applies when the game restarts (the menu offers a "Restart now" button).

Starting
--------
Run sms_port.exe. The game data is looked for in this order:
  1. a path given on the command line:   sms_port.exe "D:\Games\Super Mario Sunshine.iso"
  2. "disc =" in port_settings.ini (created next to sms_port.exe on the first start)
  3. a disc image or a files\ folder next to sms_port.exe
If nothing is found, the game asks for the disc image (drag and drop it onto the game window, or click OK to browse) and remembers your choice.

Requirements: Windows 10 or 11, 64-bit, a Direct3D 12 capable GPU.

Controls
--------
Controller (DualSense, DualShock, Xbox, Switch Pro, GameCube adapter, ...): the buttons
sit where a GameCube pad has them. PlayStation: Cross = A, Square = B, Circle = X,
Triangle = Y, R1 = Z, L2/R2 = L/R (analog; a full press clicks), Options = Start.
Keyboard: WASD = stick (hold Left Shift to walk), arrow keys = C-stick, Space = A, E = B,
Q = X, F = Y, Z = Z, C = L, R = R (Shift+R = light press), Return = Start, I/J/K/L = D-pad.

  Esc or F1 (or the controller's Create/Back/View)  settings menu
  Tab (in multiplayer)                               player list (hold)
  F11 or Alt+Enter                                     fullscreen
  F3                                                   frame-rate overlay
  F9                                                   save a bug report (see below)

Settings are saved in port_settings.ini next to sms_port.exe (window size and position,
fullscreen, aspect, internal resolution, frame rate, dead zones, rumble, key bindings,
disc path, game behaviour).
Sound (Esc > Audio, or "output =" under [audio] in port_settings.ini):
  Pro Logic II matrix (original)  default: the game's own Sound option decides (mono,
                                  stereo, or surround matrix-encoded into stereo, for a
                                  Pro Logic II decoder), exactly as on the GameCube.
  Stereo                          plain stereo, never the surround matrix (the game's Mono
                                  option still gives mono).
  5.1 / 7.1                       discrete channels for a surround sound card or receiver:
                                  front left/right, rear (5.1) or rear + side (7.1), LFE;
                                  the centre carries the game's centre bus. The game is
                                  switched to its surround mixing for this (your saved Sound
                                  option is not changed). If Windows reports fewer speakers
                                  the menu says so and the sound stays stereo. Movie sound
                                  plays on the front speakers.
Save files (memory card) and the shader cache are kept in your user profile
(%APPDATA%\Super Mario Sunshine). If the game crashes, sms_port_crash.log next to
sms_port.exe has the details.

Frame rate
----------
The game itself always runs at its original 30 frames per second (and 59.94 Hz video
timing), so it plays exactly like the original. Esc > Display > Frame rate (or
"frame_rate =" in port_settings.ini) can show more frames than that: 30 (original,
default), 60, 120, 144, Match display (your monitor's refresh rate) or Unlimited. Above 30,
extra pictures are drawn between two game frames with the camera and the characters'
and objects' movement interpolated, which makes motion smoother; the game's own pictures
are still shown when they are due. The extra pictures are drawn only during gameplay
(menus, movies and loading screens stay at their original rate), and they never change
the game: a replay plays back identically at every setting. Some effects (particles,
water, shadows, the 2D display) still move in 30 Hz steps. Higher rates need a faster
CPU: each extra picture costs about as much as drawing a game frame. The F3 overlay
shows the pictures per second ("fps") and the game's own rate ("logic").

Controller extras
-----------------
Esc > Controller (and [input] in port_settings.ini):
- Analog L/R rise evenly up to the click; a full press (through the click) is the GameCube's
  digital L/R. FLUDD: a light press sprays while you walk, a full press plants Mario to aim.
- Adaptive triggers (DualSense): GameCube click (light resistance, a firm wall at the click),
  or Full FLUDD feedback (R also goes slack when the tank is empty, pulses while spraying, and
  has its own feel for the hover, rocket and turbo nozzles). Strength slider.
- Lightbar (DualSense, DualShock 4): Fluid level (default) shows FLUDD's water in light blue
  (#00C9FF), or the colour of Yoshi's juice while riding him, and gets darker as it drains; dim white
  without FLUDD and in menus. Or a static colour, or off. Brightness slider.
- Rumble: Original (the game's own motor pulses, default), HD or Off. HD plays designed
  waveforms for the game's rumble and adds FLUDD (spray, hover, rocket, turbo), footsteps by
  ground type, landings, wall kicks, dives, coins, 1-ups and Shines; each group can be
  switched off. DualSense: HD haptics over USB or Bluetooth. Xbox: FLUDD on the impulse
  triggers. A GameCube pad on the adapter keeps the original pulses.
Esc > Audio: Controller speaker (DualSense): FLUDD's sounds (and optionally pickups) on the
controller's speaker, over USB or Bluetooth; the same sounds can be kept, ducked or removed
on the PC speakers.

GameCube controller adapter (Nintendo WUP-028 or compatible, in "Wii U" / PC mode): Windows
needs a one-time driver change before the adapter can be used:
  1. Download Zadig from https://zadig.akeo.ie and start it.
  2. Options > List All Devices; pick "WUP-028" (USB ID 057E 0337).
  3. Choose WinUSB as the driver and press Replace Driver (or Install Driver).
Then plug the adapter in before starting the game; each port is a controller. This is the
same step Dolphin needs, and the adapter keeps working in Dolphin afterwards.

Quality of life
---------------
Esc > Quality of life (and [qol] in port_settings.ini). Everything here is OFF by default,
so the game plays exactly like the original until you turn something on.
- Skip boot logos and intro movie: straight to the title screen.
- Start skips any cutscene or movie: also movies you have not seen yet, the Delfino Plaza
  intros, and in-engine cutscenes (Start fast-forwards the cutscene camera to its end).
- Dialogue text speed: Normal, Fast (as if A were held) or Instant (whole lines at once).
- Auto-save after each Shine: the game is saved to the file you loaded without the save
  prompt ("Game saved" appears); if that is not possible (no file, another file on the
  card, card error) the usual prompt comes up.
- Continue in the level after collecting a Shine: the Shine is counted and saved as usual,
  but you stay in the level and keep playing (it cannot be collected twice). Secret
  courses, the airstrip, Delfino Plaza, Corona Mountain and Shines handed out by scripts
  still end the level as in the original.
- Fast-forward while holding a key (Tab by default, rebindable in the menu): 2x or 4x
  game speed while it is held; a ">> 2x" badge shows it. Off in multiplayer.
- Pause when the window loses focus: game and sound stop until you click back in.
- Camera: invert the C-stick's X and/or Y axis, and a camera speed multiplier (50-200%).
- Volume: separate sliders for music, sound effects and voices.
- Trackers: blue coins per level and the current level's Shine checklist (episode names,
  collected or not) next to the pause screen; F4 shows both at any time.
- Cheats: infinite lives, infinite FLUDD water. Off in multiplayer.
Replays record these settings, so a replay plays back the same whatever your own settings
are. Cheats, auto-save, continue-after-Shine, fast-forward and focus pause are off in a
multiplayer session.

Playing online with friends
---------------------------
Everyone needs this folder and their own copy of the game disc (the same region is best).
No downloads, accounts or IP addresses: the game comes with a lobby server.
  Host:  on the file select screen walk left to the Online block and hit it from below,
         pick Host, give the lobby a name (and a password if you like), Create.
  Join:  the same Online block, pick Join, type the lobby's name, Join.
In a session: T chat, G emote wheel, D-pad quick emotes, hold Tab for the player list,
F2 the lobby panel (the host picks game modes: Free, Hide and Seek, ...).
The Customize block (left of Online) sets your name, name-tag colour, Mario's colours
and the emote wheel.
If joining fails, the host's Windows firewall may have asked to allow sms_port.exe:
allow it (private and public networks).

Reporting a bug
---------------
The game keeps the last 20 seconds of picture and sound in memory, together with its log,
and records your controller input from the moment it starts (a few KB per hour).
When something goes wrong, press F9 (or use "Save a bug report" on the Game tab of the
settings menu (Esc)): it writes a folder bug_reports\<date>_<time>_f9\ next to
sms_port.exe with video.mp4 (the last 20 seconds, with sound), log.txt (your Windows and
GPU, the settings, where you were in the game, the frame rate, the last 20 seconds of the
log) and sms_replay_<date>_<time>.bin (your inputs, a copy of your memory card as it was
at start-up and which disc image you used; no game data). After a crash the same folder
(..._crash, with the crash backtrace in log.txt) is written automatically. Send the whole
folder with a short description. Developers play the replay back with
SMS_PORT_REPLAY=<file> to see exactly what happened. The capture costs about nothing;
"enabled = 0" under [bugreport] in port_settings.ini turns it off (seconds, video size and
frame rate can be changed there too), "record = 0" under [debug] turns off the input
recording.

Discord (Esc > Game > Discord, and [discord] in port_settings.ini): Rich Presence and
invites, with no Discord SDK. The game talks to the Discord desktop app running on the same PC.
It needs an Application ID, which you create yourself: discord.com/developers/applications >
New Application > copy the Application ID into "client_id =" (digits) under [discord]. Under
Rich Presence > Art Assets upload one large image named "logo" and, optionally, small images
named delfino, bianco, ricco, gelato, pinna, sirena, monte, noki and corona (missing ones are
simply not shown). Shows the level, episode, Shine and Blue Coin count and the time played;
in an online lobby (lobby server, no password) friends get a Join button, and "Ask to join"
shows a prompt in the game (F7 accept, F8 ignore). Direct (IP) sessions are never advertised.
"enabled = 0" or an empty client_id turns it off completely; allow_join = 0 and show_stage = 0
limit what is shared.

Included libraries: Aurora (MIT), Dawn (BSD-3-Clause), DirectX Shader Compiler
(dxcompiler/dxil, University of Illinois/NCSA), SDL 3 (zlib), libpng (libpng license),
zlib (zlib), Dear ImGui (MIT), libopus (BSD-3-Clause), Microsoft Visual C++ runtime
(redistributable).
