Skip to content
Projetos

Sobre

Metroid: Samus Returns without an emulator: the game's code recompiled from your own dump into native code, for Windows, Linux / Steam Deck and Android. Bring your own dump.

Jogos e emulação

Como estes números são medidos

O que você pode fazer

  • All play occurs on a single 16:9 screen, with full controller or keyboard support
  • 3DS mode (off by default): both screens, the top one above the touch screen, with your video and texture settings
  • Unlock amiibo galleries
  • All difficulty modes available from start (Hard, Fusion)

Crescimento medido de estrelas

em 24 h
+1
em 7 dias
+23
em 15 dias
+46
em 1 mês
Coletando histórico

Variações líquidas em períodos sobrepostos, não totais diários. Medições ausentes ficam em branco. Estrelas indicam interesse, não qualidade.

README.md

Original

msr2ds (Metroid Samus Returns 2DS)

release downloads Discord Buy Me a Coffee

[!IMPORTANT] Bug reports:

Use the Bug report form on Issues and attach the log of the play session where the problem happened. Each play session writes its own, in user/logs/, named by the date and time it started (the newest 10 are kept). Reporting a problem says where to find it on each platform.

Android users:

Android support is difficult. We don't have an Android device to physically test on. Building an Android image is easy, but testing it on real hardware is a different story. Android support can only continue with a back and forth from the community unless someone wants to put in a pull request to fix whatever is the performance issues being seen there.

No game files are included.

Metroid: Samus Returns as a native, single-screen PC game. This is a full PC Port. It is no longer built on emulation. You need your own decrypted dump of the game (USA, Europe or Japan): none is included, and nothing from the game is in this repository. Windows, macOS, Linux (x86-64 and ARM64) and Android downloads are on the releases page.

Chat and news: the project's Discord server, https://discord.gg/u5SzfU66ZJ (bug reports and feature requests go on Issues).

One 16:9 screen in the style of Metroid Dread. Energy and missiles sit at the upper left with the Aeion gauge and the beam slots (the usual beam, Ice and Grapple) under them, and the map is at the upper right with the DNA and Metroid counts below it. Start brings up the game's own bottom screen (map, inventory, options); the right trigger switches between the usual, Ice and Grapple Beams, and with missiles held (RB) between Missiles and Super Missiles. It renders in widescreen up to 4K internal resolution, at 30 (the original), 60, 90, 120 or 144 frames per second, and loads texture packs. A launcher picks the game dump and holds the settings, which are also in an in-game overlay (F1 or Select).

Features

  • All play occurs on a single 16:9 screen, with full controller or keyboard support
  • 3DS mode (off by default): both screens, the top one above the touch screen, with your video and texture settings
  • Unlock amiibo galleries
  • All difficulty modes available from start (Hard, Fusion)
  • Fusion suit on any difficulty (and able to swap between on the fly)
  • 4K+ resolution
  • 30 (original), 60, 120, 144 FPS support
  • Vsync
  • HDR support
  • Stereoscopic 3D, side by side, for 3D TVs, Acer SpatialLabs displays and VR headsets
  • Ultrawide 32:9 support
  • 4:3 mode (off by default): the 3DS's width with more of the level above and below, for 4:3 screens
  • HUD controls (turn off/on each element & change their size)
  • Texture Pack support
  • Cheats: Infinite energy, infinite missiles and bombs, unlimited Aeion, damage taken and dealt multipliers
  • Save states (experimental)
  • Bloom toggle
  • Camera zoom (try this out. It's fun)
  • Nintendo controller layout is off by default. A is accept, B is back in menus but A is jump in gameplay. This is configurable
  • Mod support, music mods included: drop in your own .ogg, .wav, .mp3 or .flac tracks
  • Steamdeck preset mode to get 60fps performance
  • Skip the launcher (off by default): straight into the game, with Quit to the launcher in the game's menu
  • Dual-screen handhelds such as the AYN Thor: the bottom screen on the second display (off by default; Android, and Linux in gamescope)
  • Discord Rich Presence: your Discord profile shows the area you're in and the Metroids left (on by default; a switch on the Game tab turns it off)
  • Bug reports from the REPORT tab (in the launcher and in the game's menu), sent to Issues with the log of the session you choose

Extra controls

  • Left trigger auto-morphballs like Metroid Dread
  • Right trigger cycles between beams; hold RB (missiles) and it switches to Super Missiles and back
  • Start pulls up map and lower screen options
  • Select pulls up program options
  • Aeion abilities mapped to the right-stick, D-pad moves

Title screen

Opening story Opening story

Samus on her gunship Exploring a cave A Metroid, with the late-game HUD

Known issues

  • Occasionally the bottom screen elements glitch/flicker on the screen. This is known and being working on.
  • On Steamdeck (or slower systems) it may take awhile to do the initial install (30+ min).
  • If the exe closes randomly when installing, re-open and it should work. This is a known bug.

Play

You need

  • A decrypted dump of Metroid: Samus Returns, the USA, European or Japanese release: .3ds, .cci or .cxi, or one compressed by Azahar (.zcci, .zcxi). A dump decrypted by a tool that left its header's encryption flag set is fine too. Encrypted dumps are refused. The European release has all six of its languages (English, French, German, Spanish, Italian, Dutch) under Settings, Language; the Japanese release plays in Japanese. Saves work with every release; the native code is built for the release you choose (changing the game file asks for a rebuild).
  • A graphics card with Vulkan 1.3. On a Mac: Apple Silicon (M1 or newer) and macOS 13 or newer.
  • About 1 GB of free space, and an internet connection for the first build (it downloads its build tools, about 105 MB).

Install and start

  1. Download your system's file from the releases page:
    • Windows (x64): msr2ds-<version>-windows-x64.zip. Unzip it anywhere you can write to and start msr-native.exe.
    • Linux / Steam Deck (x86_64): msr2ds-<version>-x86_64.AppImage. Make it executable (chmod +x) and start it.
    • Linux (ARM64): msr2ds-<version>-aarch64.AppImage, the same way. The native code is built on the device itself.
    • macOS (Apple Silicon): msr2ds-<version>-macos-arm64.zip. Unzip it, move msr-native.app to Applications (or anywhere) and open it from there. The app is not notarized: the first time, macOS refuses to open it; choose Open Anyway in System Settings > Privacy & Security (or run xattr -dr com.apple.quarantine msr-native.app).
  2. On the launcher's Game tab, under Game file, choose your dump with Browse... (or type its path).
  3. Click Build the native code. This recompiles the game's code from your dump, on your own computer. It takes a few minutes, once.
  4. Click Play.

The launcher comes back when the game closes. In the game, F1 or the controller's Select / View / Back button opens the same menu. The internal resolution starts at 4x (960p): raise it on the Display tab (9x is 4K) if your GPU has room, or lower it if it struggles.

Without the launcher: turn on Skip the launcher (Game tab, under Play) and msr-native goes straight into the game with your settings from its next start. msr-native-direct.exe, beside msr-native.exe in the Windows zip, always does: use it for a desktop shortcut, Steam or a frontend. On Linux and macOS the launcher makes it once the native code is built: msr-native-direct.sh beside the AppImage, msr-native-direct.app beside msr-native.app. Started either way, the game's menu has Quit to the launcher, and the launcher opens by itself when the game can't start yet (no game file, or the native code needs building), when the game crashed, or when an update is ready to install. msr-native --launcher always opens the launcher. (Not in the Android app.)

Updates: when a newer release is out, the Game tab says so when the launcher starts. Started without the launcher, the game looks while you play, and the next start opens the launcher to offer it. Update now downloads it and puts it in place of this one (the same folder, AppImage or app), then starts it. Your saves, settings, mods and native code are kept; an update only asks you to rebuild the native code in the rare case it needs it. What's new opens the release's page. On a Mac, an app opened from the folder it was unzipped in runs from a read-only copy, so it can't update itself or make msr-native-direct.app: move it first.

Steam Deck: on a Deck, the Display tab starts with Steam Deck: 60 FPS with texture packs: 3x internal resolution (the Deck's 720p), 60 FPS and V-Sync. 4x (960p) also holds 60, with less to spare. For even frames, set the Deck's refresh rate to 60 Hz (Quick Access menu, Performance). To play from Game Mode, add msr-native-direct.sh to Steam as a non-Steam game. In play the view fills the Deck's 16:10 screen, with more of the level above and below (Fill 16:10 screens on the Display tab; off, 16:9 with bars above and below).

Dual-screen handhelds: on a handheld with a second screen, such as the AYN Thor, the Display tab has Bottom screen on the second display (off by default): the 3DS's bottom screen on the lower screen, which is its touch screen too, and the top screen alone on the main one. The Android app shows the row when the handheld has a second display, and it applies at once. On Linux (the AppImage in gamescope, such as Armada's Game Mode on the Thor) the row shows where gamescope offers the lower screen, and it applies from the game's next start. The Steam Deck has one screen, so it never shows there.

Mac: Macs have no Vulkan of their own, so the app includes MoltenVK, which runs the renderer on Metal. The first time an effect appears, its shaders compile in the background; they are kept for later sessions. HDR is Windows only.

Coming from 1.x

2.0 is a separate program with its own user folder (see Your files). The emulator-based 1.x is still on the releases page, and its code is on the emu_ver branch.

  • Saves: Import saves... on the Game tab brings them over: choose your 1.x folder (see Saves).
  • Texture packs go in mods/textures and game mods (Citra/Azahar format, Randovania seeds) in mods/game, one folder each.

Android

The app is msr2ds-<version>-android-arm64.apk on the releases page (its source is in native/android, see Android app). It needs Android 10 or newer on a 64-bit ARM device with Vulkan 1.1 or newer, and a controller or keyboard: there are no touch controls. The app can't build the native code itself, so a PC builds it for the app:

  1. In the launcher on a PC, with your game file chosen: Game tab, Build for Android (a few minutes). It goes into the PC's user/msr/recomp-android.
  2. Install the APK (allow your browser or file manager to install apps when Android asks) and start it once, so it makes its folder.
  3. Connect the device to the PC over USB and open its storage. In Android/data/io.github.gminustwo.msrnative/files/user, put your game file, and copy the PC's user/msr/recomp-android folder into user/msr there.
  4. Start the app: the launcher finds both. Play.

The Back button opens the game's menu. Saves and settings are in the same user folder on the device, and so are game mods (mods/game) and texture packs (mods/textures, see Your files). For saves from a 3DS (a Checkpoint or JKSM backup) or another emulator (Azahar, Citra, Lime3DS), copy its save folder anywhere into the user folder, then press Find saves on the launcher's Game tab. The app has no in-app update: install a newer APK over it, and the user folder stays.

On the SD card. The launcher's Game tab has a User folder row: Move to the SD card moves the whole user folder (game file, native code, saves, settings, texture packs) to the app's folder on the SD card, Android/data/io.github.gminustwo.msrnative/files/user there, with a progress bar, and the launcher starts again. Move to the phone's storage moves it back. If the card is full or the copy fails, everything stays where it was. If the card is taken out, the app uses the phone's storage until it's back. Uninstalling the app deletes the user folder on the SD card too, so keep a copy of your saves.

GPU driver (Snapdragon). On an Adreno GPU, the launcher's Game tab has a GPU driver row. The game can use a Vulkan driver you install in place of the phone's own, such as Mesa's Turnip: a driver package (.zip) made for emulators like Azahar and Eden. Install a driver... opens the file picker, and the game uses it from its next start. The launcher itself always uses the phone's driver. If the game closes while starting with a driver, the launcher goes back to System driver; if it closes later or draws wrongly, choose System driver yourself.

Your files

Everything goes in the user folder (Open the user folder on the Game tab):

  • Windows: user\ beside msr-native.exe (or %LOCALAPPDATA%\msr-native\user if that folder can't be written)
  • Linux: ~/.local/share/msr-native/user, or a user/ folder beside the AppImage if you make one
  • macOS: ~/Library/Application Support/msr-native/user, or a user/ folder beside msr-native.app if you make one
  • Android: Android/data/io.github.gminustwo.msrnative/files/user, on the phone's storage or the SD card, reached from a PC over USB
What Where, in the user folder
Saves native-save/savedata/profile0, profile1, profile2
Quick save states/native-quick.state
Settings msr/settings.ini
Where your game file is msr/game-path.txt
Native code msr/recomp/ (the Android app's: msr/recomp-android/)
Build tools msr/recomp-kit/
Saves an import replaced msr/save-backups/
Game mods mods/game/
Texture packs mods/textures/
Logs logs/msr-native_<date>_<time>.log (the game: one for each play session, the newest 10 kept), launcher.log, msr/recomp-build.log, msr/update.log

The native code is made from your dump: keep it for your own use.

Controls

These are the defaults; change them on the Controls tab. Controllers are read by button position (the names below are Xbox's). The button icons in the game follow the device you used last: Xbox, PlayStation, Nintendo or the keyboard's keys.

Action Keyboard and mouse Controller
Move WASD or arrows Left stick
Jump Space A
Shoot Left mouse button or V X
Free Aim Q, or hold the right mouse button to aim at the pointer LB
Missiles E RB
Melee counter R Y
Use the Aeion ability F B
Choose an Aeion ability 1, 2, 3, 4 D-pad
Morph Ball in and out, as in Dread Left Shift LT
Next beam: usual, Ice, Grapple C, or the mouse wheel RT
Super Missiles or Missiles Hold E, then C or the mouse wheel Hold RB, then RT
Pause menu and map Tab Start
Settings menu F1 Select / View / Back
Touch navigation T
Quick save, quick load F5, F8
Fullscreen F11
  • Menus: an Xbox or PlayStation controller chooses with its bottom button (A, Cross) and goes back with its right one (B, Circle), while in play the bottom button jumps. Nintendo menu layout on the Controls tab makes menus use the game's own A and B instead.
  • Aeion abilities on the right stick (Controls tab): the right stick chooses the abilities and the D-pad moves.
  • Copy and Delete on the file select: open a file, and Down goes through its choices on to Copy, then round to Continue again (Up the other way, holding either keeps going). Right from Copy is Delete, Left goes back; the one chosen lights up and A chooses it. The game makes them touch-only.
  • The pause map's buttons on the D-pad: Left and Right go along its toolbar (map pins, information, settings; amiibo is shown darkened and passed over) and A chooses; the stick moves the map. D-pad icons beside the toolbar and the pins' bar show it, and a pin chosen on the map shows its remove button (a bin and X / Square) above the bottom-right corner. On the map pins tool, the D-pad or the stick chooses a pin; Up goes to the pins already on the map (chosen by where they lie; Down past the lowest comes back to the bar). A picks the chosen pin up: move it with the stick (pushed against the map's edge, it scrolls the map there, as the stick does on the map) and press A again to place it, or B to put it back where it was. X (Square on PlayStation) removes the map pin chosen, and holding LT still drags a pin with the stick. The bar ends with the tool's Delete all button: A on it removes every pin in the area, once you confirm. The world map keeps the game's own controls: the D-pad or the stick chooses an area, A shows its map.
  • Touch navigation (T on the keyboard; a controller's D-pad reaches the touch screen's buttons itself) puts a cursor on the touch screen's buttons: the D-pad or stick moves it, the choose button taps (hold to drag) and the back button leaves. On the map pins tool, Up from its buttons frees the cursor over the map, to pick up a pin already there: drop it on the bin to remove it, and move down to the buttons to go back to them. The mouse also touches the bottom-screen panel when it shows.
  • The mouse stays in the window while you play with it, so a shot beside a windowed game doesn't switch away. The settings menu (F1), the title and file menus, a controller or Alt+Tab let it go.
  • The triggers are buttons like the others: pull one while rebinding a control to bind it (Free Aim on LT and Morph Ball on LB, for example). Trigger press point on the Controls tab sets how far a trigger is pulled before it counts (50% by default; it lets go under 60% of that).
  • Gamepad layout and Keyboard layout on the Controls tab put the defaults back.

Settings

The launcher and the in-game menu (F1 or Select) have the same tabs, saved to the same settings.ini; LB and RB switch tabs.

  • Game: in the launcher, Play, Skip the launcher (off by default; see Play), the game file, the native code, saves and the language (English, French, Spanish, German, Italian or Dutch: the last three set the 3DS region to Europe, which the game needs for them); volume; Unlock amiibo galleries, Unlock Fusion Mode and Hard Mode from the start (all on by default) and Fusion suit, any difficulty (off); Discord Rich Presence (on: with the Discord app open on the same computer, your Discord profile shows that you're playing, the area you're in and the Metroids left; not in the Android app); Join the msr2ds Discord; in the game, Resume, Quick save, Quick load, Restart, Quit to the launcher (when the launcher was skipped) and Quit.

    3DS mode (off by default; in the launcher under Play, and on the game's Game tab, from the next start): the game laid out as the 3DS shows it. Both screens, the top one above the touch screen, in the 3DS's 5:3 view, with the game's own HUD, map and menus on the touch screen. The mouse (or a touch screen) is the stylus, and the D-pad is the game's in the menus, as on the console. Your video and texture settings still apply: internal resolution, upscaling, frame rate, HDR and the rest of the Display tab, and texture packs. Widescreen, ultrawide, Fill 16:10, 4:3 mode, the camera zoom and the HUD tab wait while it's on, and come back as you set them when you turn it off.

  • Report: a bug report for Issues, sent with the log of the play session you choose; in the game's menu, the session you're playing comes first (see Reporting a problem).

  • Display: a video preset (below); fullscreen; Widescreen (16:9), Ultrawide (up to 32:9) and Fill 16:10 screens (the Steam Deck, most laptops, a Mac in fullscreen: more of the level above and below instead of bars), all on by default; 4:3 mode (off by default: in play a 4:3 view, the 3DS's width with a quarter more of the level above and below; it fills a 4:3 screen, with bars at the sides of a wider one, and the pause screen keeps to it; the title and file menus keep the game's own shape; Widescreen, Ultrawide and Fill 16:10 wait while it's on); camera zoom (0.70-1.50); bloom (0-100%, default 75%); HDR (Windows, once Use HDR is on in Windows' display settings) with its highlights and paper white (by default the display's peak, up to 1000 nits, and Windows' SDR content brightness; Reset HDR to the defaults brings those back); Stereoscopic 3D (below), with its 3D depth and Swap eyes; Anti-aliasing (FXAA); Smooth texture packs (a pack's textures filtered smoothly, also where the game shows its own with sharp pixels); brightness, contrast and saturation (50-150%); internal resolution (Match window, or 1x-10x: 9x is 2160p, 4K); anisotropic filtering (off, 2x-16x); upscaling (FSR 1, or Linear: lighter for older graphics on a large screen); frame rate (30, the original, 60, 90, 120 or 144; default 60); V-Sync; Show FPS; menu size; Bottom screen on the second display (dual-screen handhelds only, see Play); and, for slower computers, Power-saving waits, Draw only the 3DS's view and Texture pack size (below).

    Video preset sets the internal resolution, anisotropic filtering, upscaling and frame rate together, and Minimum also checks both options for slower computers:

    Preset Internal resolution Anisotropic filtering Upscaling Frame rate For slower computers
    Minimum 2x (480p) Off Linear 30 (the original) Both on
    Medium (the default) 4x (960p) Off FSR 1 60 The wider view drawn
    High 6x (1440p) 8x FSR 1 60 The wider view drawn
    Ultra 9x (2160p, 4K) 16x FSR 1 60 The wider view drawn

    Medium, High and Ultra keep a faster frame rate you chose (90-144, for a faster display), and leave Power-saving waits as they are (it follows the processor). Changing any of these yourself makes it Custom: choosing a preset afterward keeps your values, and choosing Custom brings them back. Bloom, V-Sync, HDR, stereoscopic 3D, anti-aliasing and the colors stay as you set them. On a Steam Deck, the Steam Deck: 60 FPS with texture packs button above the presets is still there.

    Power-saving waits: while the game waits (for the next frame, for the graphics), it sleeps instead of checking in a loop. That leaves more of a slow processor to the game and, on a handheld or laptop, more power to the graphics. It is on by default on a processor with 4 threads or fewer. Measured on a desktop at the title screen, it used 20-38% less processor time with the same frame rate.

    Stereoscopic 3D (Off by default; Side by side at half width or at full width): the game's own 3D, as a 3DS shows it with its 3D slider up. The game draws a picture for each eye, and both show side by side. Half width squeezes each eye's picture into half the screen, which is what 3D TVs (in their side-by-side 3D mode) and Acer SpatialLabs displays take: play in fullscreen. Full width gives each eye half the window at its own shape, for VR players that show a window or the desktop in side-by-side 3D (Virtual Desktop, Bigscreen and the like) and for a window twice as wide as one eye's picture (a 32:9 window shows two 16:9 eyes). 3D depth is the 3DS's 3D slider (10-100%, default 100%); Swap eyes puts the right eye's picture on the left, for cross-eyed viewing or a display that takes the eyes the other way round. The HUD and the menus show in both eyes, at the screen's depth. It needs Vulkan (Graphics API: Automatic or Vulkan); with OpenGL the game stays in 2D.

    Draw only the 3DS's view (off by default, on in Minimum): normally, with widescreen, ultrawide or a camera zoom below 1, the game draws everything the wider view shows. Checked, it works as in 1.x, whose zoom and 16:9 only scaled the picture: the game draws only what the 3DS's own screen would show, so enemies and items at the edges appear as they come within it. That means fewer draws: in play, about 12% fewer at 16:9, 30% fewer at zoom 0.70 and 40% fewer in ultrawide (32:9). It switches at once, in the launcher or in the game.

    Texture pack size (Full, Half or Quarter): texture pack images are shrunk as they load, never below the game's own size. Half takes a quarter of the graphics memory and Quarter a sixteenth: a 4x pack's 1024x1024 texture (5.3 MB with its mipmaps) becomes 512x512 (1.3 MB) or 256x256. For graphics with 2 GB or less, or that share the computer's memory. Applies when the game starts.

  • HUD: size and opacity; the map, its size and opacity; DNA and Metroid counters; Aeion abilities; HUD within 16:9 (on an ultrawide screen); menu panel size; Fit the pause screen to the window (on by default: the pause screen fills the window; its bars and background reach the edges, its buttons, text and columns keep their shape, and the map fills its width, showing more of the area); title menu background.

  • Controls: every 3DS control with its key and controller button: select one and press the new key or button (Esc cancels). See Controls.

  • Mods: game mods (see Game mods and Randovania).

  • Textures: texture packs (see Texture packs).

  • Cheats: infinite energy, unlimited missiles (Super Missiles and Power Bombs too) and unlimited Aeion, kept full every frame. A save keeps what you have when you save. Damage taken (25% to 200%) scales the hits Samus takes, the ones Hard and Fusion make harder. Damage dealt (50% to 400%) scales what her hits take from enemies, bosses and Metroids; doors and blocks are left as they are.

Saves

The game's three files (A, B, C) are the profile0-profile2 folders in native-save/savedata in the user folder, each with samus.bmssv, common.bmssv and pkprfl.bmssv.

Import saves... on the launcher's Game tab brings saves from a 3DS or an emulator. Choose any folder that holds them: a Checkpoint or JKSM backup (or the game's folder of backups), the folder of Citra, Lime3DS, Azahar or msr2ds 1.x (its user folder, sdmc, or anything down to data/00000001), or another msr-native's user folder. It searches up to 12 folders deep for profileN folders with .bmssv files, preferring this game's title folder, then saves in use over backups, then the newest. After a confirmation that shows what it found, the import replaces all three files: the current ones are copied to msr/save-backups/<date-time>/ first, and a failed import changes nothing. The Android app has no folder picker: its Find saves searches the whole user folder the same way (leaving out msr/save-backups), so copy the saves anywhere into it first. Open saves folder shows where they are; you can also copy the three profile folders in yourself. Raw cartridge save dumps (.sav from GodMode9) are encrypted images, not these files: use Checkpoint or JKSM to back up saves from a 3DS.

Quick save and quick load (F5 and F8, or the in-game Game tab) keep one state in states/native-quick.state. A state made with another game file or other game mods is refused.

Extras

Switches on the Game tab, applied at once by rewriting a few instructions in memory; nothing is written to the saves.

  • Hard Mode from the start (on by default): a new file's Play and every New Game offer the difficulty list: Normal, Hard and Fusion. Otherwise the game offers Hard only once it has been beaten, and starts new files on Normal.
  • Unlock amiibo galleries (on by default): Options > Gallery on any save lists Metroid II Art, Concept Art and Music (the sound test) beside Chozo Memories.
  • Unlock Fusion Mode (on by default): Fusion is in the difficulty list without the amiibo.
  • Fusion suit, any difficulty (off by default): Samus wears the Fusion suit at Normal and Hard, which keep their damage. It switches at once, also in the middle of play. It stays off with a Randovania seed.

Texture packs

Quick start

  1. Get a pack, like the HD Texture Pack linked at the top.
  2. In the launcher's Textures tab, click Open the texture packs folder.
  3. Extract the pack there, keeping its folders as they are (no need to flatten them).
  4. Start the game. New packs are turned on; the Textures tab (or the in-game menu, F1 or Select) turns each one off or on and moves it up or down.

For the HD Texture Pack the folder should look like this, and each add-on then shows up as its own pack:

textures/
├── 00040000001BB200/          the main pack
└── Optional Addons/
    ├── Cleaned Up Suits/      an add-on
    ├── Updated UI/
    └── …
  • Keep the pack's folders separate. Don't merge everything into one folder or bury it two folders deep: the main pack and its add-ons then load as one pack, and some add-on textures won't apply.
  • Higher in the list wins when two packs change the same texture. Add-ons go above the main pack on their own.
  • Changes apply when the game starts. Changed packs in game? Pick Restart now.
  • A pack copied in while the Textures tab is open shows up in a second or so.
  • Readmes and preview images inside a pack are ignored.

The folder is mods/textures/ in the user folder (see Your files).

How packs load

Each folder in mods/textures/ is a pack: textures named the way Azahar dumps them (tex1_WxH_HASH_FMT.png, .dds or .ktx, in any subfolders), with an optional pack.json, so existing Azahar and Citra packs work as they are. Where two packs replace the same texture, the one listed first wins. A folder that holds only folders, like a pack's "Optional Addons", lists each add-on as its own pack. New packs join the top of the list, smallest first, so add-ons override the pack they extend. Packs found in a textures folder beside the program are listed the same way, marked as included with the game.

The prologue's nine pictures have different names in 2.0 than in the packs (the game leaves part of each picture's memory unwritten, and the emulator held other bytes there), so 2.0 also looks for them under the names the HD Texture Pack and its Higher Res Intro add-on use. Whichever name a pack uses, the pack higher in the list wins.

Making a pack

Turn on Dump game textures on the Textures tab, then play through the places whose textures you want: each texture the game draws with is saved once, as a PNG named the way Azahar names it, in dump/textures/00040000001BB200/ in the user folder (00040000001BFB00/ for the European release, 00040000001BFC00/ for the Japanese one) (Open the dumped textures folder while it's on). The tab counts them as they come. It stays on until you turn it off, also after a restart.

Edit the ones you want, and put them with the dump's pack.json in a new folder under mods/textures/. Edited textures can be larger than the originals. Packs made this way also work in Azahar, except for the prologue's nine pictures, which have other names there (see above).

Game mods and Randovania

Game mods go in mods/game/ in the user folder (Open the mods folder on the Mods tab), one folder each, as Citra and Azahar take them:

  • romfs/: files that replace or add to the game's
  • romfs_ext/: .stub files remove a file; .ips or .bps files patch one
  • exheader.bin, code.bin, and code.ips or code.bps (also inside exefs/): the game's code

The Mods tab turns each one on or off and orders them: the first one listed wins where mods overlap. Mods load when the game starts. A mod that changes the game's code needs no rebuild: the functions it touches run on a built-in interpreter. On Windows, Azahar's own mods folder for the game is listed too, off until you turn it on.

Randovania

A Randovania seed for Samus Returns is a game mod. Export it from Randovania (USA or European game file):

  • Windows: choose Azahar, then turn on Azahar's mods folder on the Mods tab. Or choose a custom folder inside mods/game.
  • Linux, macOS, Steam Deck: choose a custom folder inside mods/game.
  • Android: export on a PC, then copy the folder into mods/game in the app's user folder over USB.

A seed plays from a new file. Turn it off on the Mods tab to play the game as it is again.

Randovania's tracker and multiworld connect to the game while it runs. In Randovania's Game Connection, add Samus Returns and choose:

  • Azahar when msr2ds runs on the same computer.
  • Luma3DS, with the device's IP address, when msr2ds runs on another device (a Steam Deck, another PC, a phone). On a PC or Steam Deck, first turn on Randovania from other devices on the Game tab (it shows with a seed on) and start the game again; Windows may then ask whether msr2ds may use the network. The Android app always takes connections.

The game takes the connection about 10 seconds after it starts (port 42069), and again after a quick load.

Music mods

A game mod can replace the game's music with your own tracks, as .ogg, .wav, .mp3 or .flac files. Name each one after the game's track it replaces and put it where the game has that track, under the mod's romfs/:

mods/game/My Soundtrack/romfs/sounds/streams/music/
├── m_title99.ogg         the title screen
├── m_select99.ogg        the file select
└── ...                   the game's other tracks there, by their names

The game's own tracks are .bcwav files in sounds/streams/music (and sounds/streams/maps) of its RomFS: a track named like one of them plays in its place, whatever its own format. When the game starts, msr-native converts each new track once to the game's format (a few seconds for a whole soundtrack the first time) and keeps the result in user/msr/music-cache; the log says what it made of each track (msr: music: lines).

Loops: a track with LOOPSTART and LOOPLENGTH (or LOOPEND) tags in samples, as many games' music mods have them (.ogg, .flac), or a .wav with a sampler (smpl) loop, loops there. Any other track loops from its start where the game's track loops, and plays once where the game's track plays once (the ending's music, the jingles). Mono tracks play in both speakers; tracks above 48 kHz are brought down to 48 kHz.

Reporting a problem

The quickest way is the REPORT tab, in the launcher or in the game's menu (F1): choose the play session where the problem happened (by the date and time it started; in the game, the one you're playing comes first), say what happened and where, and send it. You sign in to GitHub with a code shown there (on github.com/login/device, in your browser or on your phone; a free account is enough), and the report goes up under your name, so you see the replies: the log first (as a gist), then the issue that links it. Nothing is sent without the log. You can add screenshots or a clip on the issue's page afterwards.

You can also open an issue on the Issues page and pick Bug report (or Feature request for an idea): the form asks for what helps. Please check the open issues first, and report one problem per issue. What to have at hand:

  • The version: at the bottom of the launcher's Game tab, e.g. "msr-native 2.2.0". Newer versions may already fix it: the Game tab offers updates.

  • What happened and where: the area (or menu, cutscene, the launcher) and the moment, whether it happens every time, and how to get there.

  • The session log (required): a bug report needs the log of the play session where the problem happened. Every start of the game writes a new one, named by the date and time it started (the newest 10 are kept), so if you started the game again afterwards, the newest log is from that later start: pick the right one by its date and time, and drag it into the issue. It's in the logs folder of the user folder (Open the user folder on the Game tab):

    • Windows: user\logs next to msr-native.exe (or %LOCALAPPDATA%\msr-native\user\logs if that folder can't be written)
    • Steam Deck / Linux: ~/.local/share/msr-native/user/logs, or user/logs beside the AppImage if you made a user folder there
    • macOS: ~/Library/Application Support/msr-native/user/logs
    • Android: Android/data/io.github.gminustwo.msrnative/files/user/logs (if the game didn't start at all, launcher.log in the user folder too)

    It lists your settings, your PC, the frame rate every 30 seconds, the areas loaded, and what the game was doing in a freeze or a crash. Your home folder is written as %USERPROFILE% or ~, so you can attach it as it is.

  • Your setup: the controller (and whether Steam starts the game), your display, aspect ratio and frame rate, a texture pack or game mods if you use them.

  • A screenshot or a short video for anything you can see.

A quick save (F5) from just before the problem can help too. It only loads with the same game file and game mods: mention that you have one, and we'll ask for it if needed.

How it works

The game's ARM code is recompiled ahead of time into a native library, built on the player's computer from their own dump (tools/msr/recomp/, into user/msr/recomp/). Everything around it (the 3DS kernel, the system services, the PICA200 GPU on Vulkan, the DSP) is a small runtime of its own (native/runtime/), adapted from Woohoo! Flight School's. Code the library lacks (reached only through pointers computed at run time) runs on an interpreter and is logged to user/msr/recomp-jit-entries-core-native.txt; the next build of the native code includes it. Samus Returns' own features (the single screen, the HUD, the menus and settings, mods) are in native/runtime/msr/ and src/msr/. More in native/README.md and tools/msr/recomp/README.md.

Widescreen follows DekUI's renderer approach. Depth-tested draws in the top screen (the 3D world) are squeezed on the horizontal axis in clip space (15/16 at 16:9), which reveals more of the level, and presentation stretches it back. Ultrawide squeezes further for the window's shape (15/32 at 32:9) and widens the camera's field of view to match, so the game draws and culls the whole width. 2D layers keep their full width; the title menus, the gallery and the prologue stay 16:9.

Build

No dump is needed to build: the program holds nothing from the game. It needs CMake, Ninja, GCC or Clang, SDL2, the Vulkan headers and loader, glslc (or glslangValidator), zstd, and libpng with zlib (without libpng, texture packs are left out). At run time it loads libshaderc if it can find it, to translate the game's vertex shaders; without it they run on a generic interpreter shader. The version is MSR_NATIVE_VERSION in native/CMakeLists.txt.

A build started from its build folder finds the recompiler in the source tree, so its launcher builds the native code as a release's does.

Windows (MSYS2 UCRT64)

pacman -S --needed mingw-w64-ucrt-x86_64-{gcc,cmake,ninja,SDL2,zstd,libpng,vulkan-headers,vulkan-loader,shaderc}
cmake -S native -B build -G Ninja && cmake --build build -j 8
build/msr-native.exe                 # from the UCRT64 shell (MSYS2's DLLs); its user folder is build/user
python tools/package/windows.py build   # -> dist/msr-native-<version>-windows-x64.zip

Linux

sudo apt install cmake ninja-build g++ libsdl2-dev libvulkan-dev glslc libzstd-dev libpng-dev
cmake -S native -B build -G Ninja && cmake --build build
LINUXDEPLOY=<linuxdeploy AppImage> bash tools/package/appimage.sh build   # -> dist/msr-native-<version>-<x86_64|aarch64>.AppImage (this system's)

appimage.sh [build folder] [SDL2 source] [zstd source] builds SDL2 and zstd statically from source folders when given. The release is built on Ubuntu 24.04 (in WSL).

macOS (Apple Silicon)

brew install cmake ninja shaderc
MSR_SDL2_SOURCE=<SDL 2 source> MSR_ZSTD_SOURCE=<zstd source> MSR_PNG_SOURCE=<libpng source> \
MOLTENVK=<MoltenVK release folder> SHADERC=<libshaderc_shared.1.dylib> SHADERC_LICENSE=<shaderc's LICENSE> \
  bash tools/package/macos.sh   # -> dist/msr-native-<version>-macos-arm64.zip (msr-native.app)

The app runs on macOS 13 and newer, so its libraries must be built for macOS 13: Homebrew's target the Mac they are installed on. The script builds SDL 2, zstd and libpng from their sources; shaderc must be built with CMAKE_OSX_DEPLOYMENT_TARGET=13.0. MoltenVK is KhronosGroup's release (MoltenVK-macos.tar, unpacked). The app is ad-hoc signed, not notarized.

Android app

The Android SDK with NDK 27.3.13750724, and JDK 17 or newer:

cd native/android
./gradlew assembleRelease -Pmsr.sdl2=<SDL 2 source> -Pmsr.zstd=<zstd source> -Pmsr.png=<libpng source>
# -> app/build/outputs/apk/release/msr-native-<version>-android-arm64.apk

MSR_ANDROID_KEYSTORE, MSR_ANDROID_KEYSTORE_PASS and MSR_ANDROID_KEY_ALIAS sign it with your key; without them it is signed with the debug key.

The native code by hand

The launcher runs tools/msr/recomp/build_module.py, which also runs on its own:

python tools/msr/recomp/build_module.py --dump <dump.cci> --user <user folder> [--cxx clang++] [--keep-work]

It needs Python 3 with capstone, and a C++ compiler: --cxx (or MSR_CXX), else g++ or clang++, or the launcher's Zig with --kit <user>/msr/recomp-kit. --target android-arm64 (with the kit's Zig) builds the Android app's. The library goes into <user>/msr/recomp/. It is code translated from the game: keep it for your own use.

Releases

tools/package/ makes each package (above) in dist/. The launcher's updater reads the GitHub releases of MSR_UPDATE_REPO (gminustwo/msr2ds, in native/CMakeLists.txt) and takes the file ending in -windows-x64.zip, -x86_64.AppImage, -aarch64.AppImage or -macos-arm64.zip, so a package can be uploaded under another name (msr2ds-<version>-...) as long as the ending stays. The packages hold no user folder and nothing from the game.

License

native/ (from Woohoo! Flight School) is GPL-3.0-or-later (native/LICENSE); src/ and tools/, from the emulator-based port, stay GPL-2.0-or-later (license.txt). Dear ImGui and AMD FidelityFX FSR 1 are MIT. The macOS app also holds MoltenVK and shaderc (Apache 2.0), SDL 2 (zlib) and libpng; the Android app holds volk (MIT) and libadrenotools (BSD 2-Clause) too. Metroid: Samus Returns belongs to Nintendo; this project contains none of it and is not affiliated with Nintendo.

Explore projetos relacionados

Carregando…