gminustwo/mgs-snakes
Sobre
Metal Gear Solid: The Twin Snakes (GameCube) as a native PC port, by static recompilation. Bring your own discs.
Outros projetosCrescimento medido de estrelas
- em 24 h
- +10
- em 7 dias
- Coletando histórico
- em 15 dias
- Coletando histórico
- 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
OriginalTwin Snakes Recomp
A static recompilation of Metal Gear Solid: The Twin Snakes (GameCube) for PC.
The game's own PowerPC code (main.dol and the game module mgso.rel it links at start) is
translated to C++ ahead of time and runs on a native runtime that stands in for the console's
hardware. No game data is included: you need your own disc images of the game, discs 1 and 2
of the same release - USA (GGSEA4), Europe (GGSPA4) or Japan (GGSJA4), revision 0; RVZ,
ISO/GCM (NKit ISOs too), WIA or GCZ - for the downloads as for your own build. Each release's code
is recompiled from its own discs, so all three run as they are, with their own saves.
Downloads: Windows (zip), Linux / Steam Deck (AppImage), macOS (Apple Silicon, zip) and
Android (APK, experimental) builds are on the Releases page. They contain the
game's code in recompiled form, none of its data: start the program and choose your disc images
on the launcher's disc page (type or paste a path, pick it in the file dialog, or find it in the
built-in browser). Disc 2 next to disc 1 is found by itself. Or build it yourself (below): the
build recompiles the game from your disc 1. The Windows zip is portable (everything of yours
stays in its user folder) and brings the Visual C++ runtime with it; it needs a CPU with AVX2
(Intel Haswell / AMD Ryzen or newer) and says so otherwise. For older processors there is a
compat download (-windows-x64-compat.zip, -x86_64-compat.AppImage), a little slower, which
updates itself from the compat downloads.
Status: playable on Windows, Linux (also as an AppImage for the Steam Deck) and macOS, with sound, widescreen and ultrawide, the port's menu, cheats, save states, texture packs, Discord Rich Presence and RetroAchievements; the Android build is experimental (see below). Played through disc 1 and into disc 2 (the change of discs works in play); disc 2 has had less testing.
What's in it
The port's menu opens with F1, or Back + Start on a controller in play (Back alone elsewhere).
- Both discs. The game changes to disc 2 by itself when the story gets there: no swapping, no menus. GAME > "Disc at start" boots straight from disc 2.
- Languages. GAME > "Language" shows the game's text and subtitles in English, French, German, Italian, Spanish or Japanese on any release (the discs all carry them; the USA release hides its others). The voices are English.
- Widescreen and ultrawide. 16:9, 16:10, 21:9, 32:9 and 48:9 (three screens side by side), with the game's view widened (not stretched; 16:10 shows what 16:9 does across and more above and below, as native widescreen games do) and the HUD moved to the screen edges: life and O2 bars, radar, item and weapon windows, the pause screen's map. The PSG1 scope and the Stinger's sight keep their shape. An option removes the cutscene letterbox.
- CRT gamma. The picture's gamma and colors moved toward how the game looked on a CRT TV (the filter MGSHDFix uses for the Master Collection), at full strength by default: DISPLAY > "CRT gamma correction" sets it from 0% (off) to 200%.
- HDR. With the display in HDR mode, DISPLAY > HDR lets lights and glows go above the picture's white: on Windows (Use HDR in Windows' display settings), the Steam Deck (an OLED Deck or an HDR TV, with HDR on in Steam's display settings) and Linux desktops that offer HDR to games. Highlights and paper white are set in nits (the defaults come from the display, with a reset button); the menus, the title and the codec stay at paper white. macOS stays SDR for now.
- Controls. The MGS2 Master Collection layout by default (the GameCube layout is an option), the Master Collection's keyboard and mouse layouts (A and B; every key and mouse button can be changed on the CONTROLS page with the keyboard shown, and "Aim with the right mouse button" plays as Metal Gear Solid V: hold it to aim, left click to fire), mouse and gyro aiming in first person (the mouse turns the view directly, with no top speed; "Raw mouse look" off steers the game's stick instead), Invert Y and rebinding. L3 puts a drawn weapon down without firing, as in the Master Collection (R3 or off in the menu; N or the right click on the keyboard), and LB held with the weapon up moves Snake with it aimed. A tap of LT / RT takes the item / weapon off or puts it back on and a hold opens the window, digital triggers and the keyboard included ("Quick change on taps"; off, a full pull clicks and opens the window at once, as on the GameCube). Snake runs at a diagonal too: the original walks when the stick is pushed fully to a diagonal (Run on diagonals in the menu turns that back on). Button prompts (pause screen, codec, incoming calls, the torture) show your controller's buttons or your keys.
- Psycho Mantis. Move the controller to port 2, 3 or 4 from the menu, and choose which games he finds on your memory card and how many saves he counts. The menu also has Meryl's codec frequency, for anyone without the case's back.
- Cheats. Invincibility, infinite ammo, O2 and grip, no reloading, the stealth suit and bandana, any item or weapon, the PAL key's form, passing Ocelot's torture, a radar that keeps its map during alerts, and the rank figures. Weapons that can start a fight early (the PSG1) ask first.
- Texture packs. Dolphin's packs work as they are (their
GGSEA4folder goes intexturesnext to the saves;GGSPA4,GGSJA4orGGStoo), and the menu can import the ones in Dolphin's folder. A pack made for one release also works on the others. - Mods. Gecko and Action Replay codes as Dolphin runs them (
codes.ininext to the saves, or imported from Dolphin; MODS switches them), including codes that change the game's code: the functions they change run in an interpreter, the rest stays recompiled. File mods replace the disc's files without patching your disc image: each mod is a folder inmodsnext to the saves, with its files laid out like the disc's (or underfiles, as Dolphin extracts a disc). Patched disc images work too. - Save states, fast loading and skipped intro logos. The game starts straight at its title screen.
- RetroAchievements (sign in through your browser, so a password manager can fill it in) and Discord Rich Presence.
- Steam Deck. Full CPU speed while the game runs, for 60 fps where SteamOS's default holds it at 30 (see Building (Linux)).
- Session logs. Every start writes one, for bug reports (see Reporting a problem).
RecompLauncher. The Windows zip, the Linux AppImages and the macOS zip carry a
recomplauncher.json, so RecompLauncher can set Twin Snakes Recomp
up: it asks for your disc 1 and disc 2 images, checks them (a disc of another region or revision,
or the discs the wrong way round or of two releases, is named as such), and Play goes straight
into the game. Its
page for the game has the port's settings (cheats under Show Advanced Options), backs up the
memory card and opens the log, mods and texture pack folders. Big Picture starts the game
fullscreen. Started from it, the game keeps everything of yours (settings, the memory card, save
states, logs, texture packs, mods) in the game's recompdata folder, which RecompLauncher moves
and keeps through updates, and leaves updates to it. A copy started without RecompLauncher uses
its own folder (user, or the ones under Reporting a problem): copy the memory card
(saves/GGSEA4_A.raw; Europe GGSPA4_A.raw, Japan GGSJA4_A.raw) over to bring your saves
along. For the launcher, or by hand:
mgs_snakes --prepare --disc1=<disc 1 image> --disc2=<disc 2 image> # check the discs and remember them
mgs_snakes --play [--disc1=<disc 1 image>] [--disc2=<disc 2 image>] # straight into the game
mgs_snakes --data=<folder> # everything of yours in that folder
Known limits:
- The game runs at 60 fps. Higher frame rates are not supported yet: the game's logic is tied to its frame rate.
- A save state loads only into the version that made it (on macOS and Android, only in the same session). The game's own saves on the memory card are not affected.
Building (Windows)
Requirements: Visual Studio 2022 Build Tools (C++), CMake 3.25+, Ninja, clang-cl (LLVM).
# 1. Build: recompiles the game straight from your disc 1 image (RVZ, WIA, GCZ, ISO or GCM)
powershell -ExecutionPolicy Bypass -File tools\build.ps1 -Disc "<your Twin Snakes disc 1.rvz>"
# 2. Run
build\windows\mgs_snakes.exe --disc "<your Twin Snakes disc 1.rvz>"
The code generated from your disc ends up in build/ and is yours alone: never share it.
tools\rvz.py (Python + libzstd) can extract a disc or convert it to ISO.
-Disc is the USA disc 1, which every build needs. The European and Japanese releases are built
in when CMake finds their disc 1 too: add -CMakeArgs "-DR2_DOL_GGSPA4=<Europe disc 1>", "-DR2_DOL_GGSJA4=<Japan disc 1>" (Linux and macOS: -DR2_DOL_GGSPA4=... on the build script's
command line), or put their main.dol and module in orig\GGSPA4 / orig\GGSJA4
(python tools\disc_extract.py <disc 1 ISO> orig\<ID>). A build without one of them refuses that
release's discs. Their function and data names (config/GGSPA4, config/GGSJA4) come from the
USA ones: python tools\region_match.py symbols <ID> build\windows\mgsrecomp.exe.
Building (Linux)
Requirements: clang, lld, CMake 3.25+, Ninja, git, and SDL3's build dependencies (X11, Wayland, xkbcommon, ALSA / PulseAudio / PipeWire, udev and D-Bus development packages).
tools/build_linux.sh --disc "<your Twin Snakes disc 1.rvz>" # -> build/linux/mgs_snakes
On a Steam Deck the game asks SteamOS for full CPU speed while it runs (F1, DISPLAY -> PERFORMANCE, "Full CPU speed", on by default) and puts the old setting back when it quits: SteamOS otherwise keeps the CPU near its base clock, and busy places run at 30 fps.
Building (macOS, Apple Silicon)
Requirements: the Xcode command line tools (xcode-select --install), CMake 3.25+ and Ninja
(brew install cmake ninja). Dawn (Metal), SDL3 and the other libraries are fetched and linked
in statically: the app needs nothing installed to run.
tools/build_macos.sh --disc "<your Twin Snakes disc 1.rvz>" # -> build/macos/Twin Snakes Recomp.app
Copy Twin Snakes Recomp.app anywhere; disc images in the same folder as the app are found by
themselves. Settings, saves, states and logs live in
~/Library/Application Support/Twin Snakes Recomp/. The arm64 loader allows only
position-independent programs, so (as on Android) a save state loads only into the session that
made it; the game's own saves on the memory card are not affected.
If the app or the discs are in Downloads, Desktop or Documents, macOS asks once whether the app
may use that folder: allow it (System Settings > Privacy & Security > Files and Folders changes it
later). The app is signed ad hoc. A downloaded copy is quarantined: open it once, then choose
Open Anyway in System Settings > Privacy & Security (or run
xattr -dr com.apple.quarantine "Twin Snakes Recomp.app"). Updates: the menu says when a new
version is out and opens its page.
Android (experimental)
The APK (TwinSnakesRecomp-v<version>-android-arm64.apk) is for 64-bit ARM phones and handhelds
with Vulkan 1.1 (Android 10 or newer). It is new and has had little testing on real devices:
reports are welcome. Install it, start it and choose your disc 1 image in the system's file
picker. For disc 2, open "Game discs" on the launcher's first page and use DISC 2's "Choose the
file" (the same picker; any folder, a memory card or a USB stick), or copy its image into
Android/data/io.github.gminustwo.mgssnakes/files over USB (that folder is also where settings,
the memory card, save states and logs are). Both are remembered for the next starts. A controller
works, and so does touch: the launcher and the menu take taps (drag a page to scroll it), and in
the game on-screen controls are named for what they do (WEAPON, PUNCH, CROUCH, ACTION, ITEMS,
WEAPONS, FIRST PERSON, CODEC, PAUSE), with SAVE and LOAD state buttons that take a short hold.
CONTROLS > TOUCH CONTROLS sets their size and opacity, and "Arrange controls" moves, sizes or hides
each one. The back button or gesture, or the menu button at the left, opens the menu. A save state
loads only in the session that made it. Updates: the menu says when a new version is out and
opens its page; install the new APK over the old one.
To build it (on Windows): powershell -ExecutionPolicy Bypass -File tools\build_android.ps1 -Disc "<your disc 1.rvz>" after tools\build.ps1 (it needs the Android SDK with an NDK, build-tools,
platforms;android-35 and a JDK 17+).
Reporting a problem
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: under the menu's title (F1, or the controller's Back / Select), e.g. "VERSION 1.1.0". Newer versions may already fix it: the menu offers updates at the top of its first page.
What happened and where: the area (or menu, cutscene, codec call) 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 writes a new one, named by the date and time it started, 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:
- Windows:
user\logsnext tomgs_snakes.exe - Steam Deck / Linux:
~/.local/share/Twin Snakes Recomp/logs - macOS:
~/Library/Application Support/Twin Snakes Recomp/logs - Android:
Android/data/io.github.gminustwo.mgssnakes/files/logs(over USB from a PC) - Started from RecompLauncher: the Log folder button on the game's page there
It lists your settings, the frame rate every 30 seconds, and what the game was doing in a freeze or a crash. It also shows folder paths, which can include your user name: edit those out if you like.
- Windows:
Your setup: the controller (and whether Steam starts the game), your display and aspect ratio, a texture pack if you use one, your CPU and graphics card.
A screenshot or a short video for anything you can see.
How it works
src/recompiler: finds the functions ofmain.doland of the module (shared/mgso.rel, linked here at the addresses the game gives it) without symbols, and writes one C++ function per PowerPC function.src/runtime: the console's hardware (CPU state, memory and the virtual memory the game pages from ARAM, video, disc drive, controllers, memory card, audio DSP), rendering through Aurora, the menu, save states, mods and the updater.
Built on Red Two, the Rogue Leader recompilation: its recompiler and runtime are this project's base, and the macOS port comes from Red Two's, by Matt Bousendorfer. Rendering is Aurora's.
Legal
Twin Snakes Recomp is not affiliated with or endorsed by Konami, Silicon Knights or Nintendo.
This repository contains no game code or data: you supply your own discs. Licensed under the MIT
license (see LICENSE), which covers this repository's own code only, not the game's code that a
build (and the prebuilt downloads) contain in recompiled form; third-party libraries keep their
own licenses.
Explore projetos relacionados
Carregando…