gminustwo/red_two
关于
A static recompilation of Star Wars: Rogue Squadron II – Rogue Leader (GameCube) for PC.
其他项目实测星标增长
- 24小时
- +7
- 7天
- 正在收集历史
- 15天
- 正在收集历史
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文Red Two
A static recompilation of Star Wars: Rogue Squadron II – Rogue Leader (GameCube) for PC.
The game's own PowerPC code 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
image of the game, for the downloads as for your own build: the USA release (GSWE64), the
European one (GSWP64) or the Japanese one (GSWJ13), revision 0. The disc you start decides which
one runs; each keeps its own memory card and save states.
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 it and choose your disc image (.iso, .gcm, .ciso, .rvz or .wia, wherever it is) on the
launcher's disc page: type or paste its path, pick it in the file dialog, or find it in the
built-in browser (controller-friendly). Red Two remembers it; one next to the program is also
found by itself.
Or build Red Two yourself (below): the build recompiles the game from your disc. 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), a little slower,
which updates itself from the compat downloads.
RecompLauncher. The Windows zip and the Linux AppImage carry a recomplauncher.json, so
RecompLauncher can set Red Two up: it asks for your disc image (USA,
Europe or Japan), checks it (another game or revision is named as such), and Play goes straight
into the game. Its page for the game has Red Two's settings (cheats under Show Advanced Options),
backs up the memory card and opens the log and texture pack folders. Big Picture starts the game
fullscreen. Started from it, Red Two keeps everything of yours (settings, the memory card, save
states, logs, texture packs, the shader cache) in the game's recompdata folder, which
RecompLauncher keeps through updates, and leaves updates to it. A copy started without
RecompLauncher uses its own user folder: copy the memory card (saves/GSWE64_A.raw, or
GSWP64_A.raw / GSWJ13_A.raw) over to bring your saves along.
Status: playable on Windows, Linux (also packaged as an AppImage for the Steam Deck) and macOS; the Android build is experimental (see below): menus, cutscenes and missions at full speed with graphics (Aurora), sound (an emulation of the MusyX audio DSP), controls, saving, save states, widescreen, mods, cheats and RetroAchievements.
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 image (RVZ, WIA, ISO, GCM or CISO)
powershell -ExecutionPolicy Bypass -File tools\build.ps1 -Disc "<your Rogue Leader.rvz>"
# 2. Run
build\windows\red_two.exe --disc "<your Rogue Leader.rvz>"
Without --disc the game takes the disc chosen in the launcher before (F1 > GAME > Game disc),
else looks for orig\GSWE64.iso, orig\GSWE64.rvz, GSWE64.rvz, GSWE64.iso and any Rogue
Leader image next to the program or in the user folder (the USA one first), else the launcher asks
for it.
The build recompiles the USA disc (required: -Disc, or orig\GSWE64.iso / .rvz, or
orig\GSWE64\sys\main.dol) and, when it finds them, the European and Japanese ones too:
orig\GSWP64.iso / .rvz or orig\GSWP64\sys\main.dol, the same for GSWJ13, or CMake's
R2_DOL_GSWP64 / R2_DOL_GSWJ13. A disc that was not built in is refused with a message.
config/GSWE64 names the game's functions; config/GSWP64 and config/GSWJ13 translate those
addresses to the other releases (tools/region_match.py update <ID> ... writes their
addrmap.txt).
tools\rvz.py (Python + libzstd) can still extract a disc or convert it to ISO.
The code generated from your disc ends up in build/ and is yours alone: never share it.
tools\make_release_win.ps1 packs a build into build\RedTwo-windows-x64.zip (the program, its
symbols, DLLs, a readme) for your own use on another PC.
Building (Linux) and the Steam Deck AppImage
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) and libusb's
(libusb-1.0-0-dev, for the GameCube controller adapter). Ubuntu 24.04 (also
under WSL2) works; the result needs glibc 2.38 or later (SteamOS 3.6+).
tools/build_linux.sh --disc "<your Rogue Leader.rvz>" # -> build/linux/red_two
# an AppImage: the AppImage type 2 runtime (github.com/AppImage/type2-runtime, runtime-x86_64),
# mksquashfs and patchelf
tools/make_appimage.sh --runtime runtime-x86_64 --icon <256x256 png> # -> build/linux/RedTwo-x86_64.AppImage
On the Steam Deck: copy the AppImage and your disc image (.rvz, .iso or .ciso, any name) into the
same folder (or the disc into ~/Emulation/roms/gc), make the AppImage executable, and add it
to Steam as a non-Steam game. The first start on a Deck is fullscreen with the picture as wide
as the screen. Settings, saves, states and logs live in ~/.local/share/Red Two/.
SteamOS keeps the CPU near its base clock unless a game asks for more, so Red Two asks for full
speed while it runs (F1, DISPLAY -> PERFORMANCE, "Full CPU speed", on by default) and puts the old
setting back when it quits; off, the busiest missions drop below 60 fps on a Deck.
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 Rogue Leader.rvz>" # -> build/macos/Red Two.app
Copy Red Two.app anywhere; a disc image in the same folder as the app is found by itself.
Settings, saves, states and logs live in ~/Library/Application Support/Red Two/. 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 disc is in Downloads, Desktop or Documents, macOS asks once whether Red Two
may use that folder, before the window opens: allow it (System Settings > Privacy & Security >
Files and Folders changes it later). The app is signed ad hoc, which is enough on the Mac that
built it. A copy downloaded or AirDropped to another Mac is quarantined: open it once, then
choose Open Anyway in System Settings > Privacy & Security (or run
xattr -dr com.apple.quarantine "Red Two.app").
Android (experimental)
The APK (RedTwo-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 (your phone asks to allow installs from that app), start Red Two and
choose your disc image in the system's file picker, or copy it into
Android/data/io.github.gminustwo.redtwo/files over USB first. A controller works, and so does
touch: the launcher and the menu take taps (drag to scroll), touch controls are on screen in
game, and the back button or gesture opens the menu. Settings, the memory card,
save states and logs are in that same folder. A save state loads only in the session that made
it (the game's own saves on the memory card are not affected). Updates: the menu says when a new
version is out and opens its page; install the new APK over the old one.
Playing
- Launcher: Red Two opens on its settings (the same pages as the in-game menu) before the
game starts. Start game (the first row) or the controller's START launches it. Turn off
"Show launcher at start" there to go straight into the game from then on; the in-game menu
(F1 or Back) has the same switch and "Back to launcher".
--launcher/--no-launcheroverride the setting for one start. A reset from the menu goes straight back into the game. - European and Japanese discs: the European disc asks at start whether to play at 60 Hz, as on a PAL console set to 60 Hz; Yes (the default, taken after 10 seconds, or at once with "Skip intro logos") is the mode Red Two is made for. Both discs carry the game's text in seven languages: F1 > GAME > Text language picks another than the disc's own (British English on the UK disc, Japanese on the Japanese one); speech stays as recorded.
- Gamepads work through SDL (with rumble), also while the window is in the background. On an Xbox-style pad the face buttons follow the GameCube positions: A = A (fire), X (left) = B, B (right) = X, Y = Y; LT/RT = L/R (throttle and brake), LB and RB = Z (hold with the stick to roll), right stick = C-stick, Menu = Start (a PlayStation controller: cross = A, circle = B, square = X, triangle = Y). Keyboard: WASD or arrows steer, Space = A (fire), Left Shift = B, E = X, Q = Y, R = Z, 1/2 = L/R, Enter = Start, IJKL = C-stick, TFGH = D-pad.
- The game's button prompts show your controller's buttons (the one each GameCube button is bound to, e.g. "PRESS (Y)" and SELECT CRAFT's "(B) > pilot"): the PlayStation symbols on a PS3 / PS4 / PS5 controller, the Switch letters on a Switch Pro Controller or Joy-Cons, the Xbox buttons on any other, and SELECT CRAFT's C-stick becomes the right stick. F1 > Controls > Button prompts picks Automatic, Xbox, PlayStation, Switch or the original GameCube ones.
- Sticks (F1 > Controls): the control stick and the C-stick each have a sensitivity (25-200%) and a round deadzone (0-50%; the output grows from zero at its edge), and the stick's whole travel past the deadzone is the game's range. Response sets how the craft's turning follows the control stick: the game's own GameCube curve (default), Smooth (gentle near the center, building up evenly to full speed) or Linear. A meter for each stick shows where it is and what the game gets (the turn and pitch speed for the control stick). Invert Y axis makes the stick climb when pushed up and dive when pulled down, in flight only (the menus keep up = up).
- Triggers: L and R are analog, as on a GameCube controller: throttle and brake build up over the whole pull, and the click at the end gives full boost or full brake. Move trigger clicks to LB / RB (Controls) puts the clicks on the bumpers instead, so the triggers only throttle and brake (roll, Z, then moves to the right stick click). Bars on the Controls page show both triggers and what the game gets.
- GameCube controllers through Nintendo's official USB adapter (WUP-028, or an adapter in its
mode, such as a Mayflash switched to "Wii U"): each of the adapter's four ports is its own
controller, with its own settings, the GameCube's real analog triggers and rumble (plug in the
adapter's second, gray USB cable for rumble). The pad has no Back button: Start + Z opens
and closes the menu (hold Z, then press Start: Start first may also pause the game), and in
the menu the L / R clicks switch tabs. In the menu A selects and, as on other controllers, the
right button (X) goes back; B goes back in menus (Controls, shown while a GameCube controller
is connected) moves back to B and clearing to X. With Button prompts on Automatic the game keeps
its own GameCube prompts. The adapter needs a one-time setup:
- Windows: give it the WinUSB driver with Zadig (Options > List All Devices, pick "WUP-028", WinUSB, Replace Driver), as Dolphin asks.
- Linux: Red Two's user needs access to the USB device. SteamOS and systems with Steam's udev
rules (
steam-devices) have it; otherwise install 60-gamecube-adapter.rules (the file says how) and plug the adapter in again. - macOS: as for Dolphin, install GCAdapterDriver (its driver keeps macOS's own off the adapter); Red Two then uses the adapter alongside it.
- Gyro aiming (Controls): turn and tilt the controller to steer in flight, on top of the stick, with the Steam Deck, a DualSense, DualShock 4 or Switch Pro Controller (Xbox controllers have no gyro): always on, while a button is held, toggled, or off while held - the Deck's left stick touch or a finger on the touchpad keeps it on while it rests there. Steam Input hides the gyro: turn it off for Red Two (Properties > Controller).
- Mouse aiming (Controls, off by default): in flight the pointer is locked to the window and moving the mouse turns the craft, as far as the mouse moved (up to the craft's own limit); the left button fires, the right one the secondary weapon. Mouse speed and Invert mouse Y are next to it. Menus, the pause screen and cutscenes keep the pointer.
- Flight sticks and other joysticks SDL has no gamepad layout for (a SideWinder, for example) get a generic one: the first two axes steer, the next two are the C-stick and the next two the triggers, the buttons are A, B, X, Y, the bumpers, Back, Start and the stick clicks in that order, the hat is the D-pad. Rebind any of it in F1 > Controls (bind R and L to a throttle lever).
- F11 or Alt+Enter toggles fullscreen;
--fullscreenstarts that way. - Graphics (F1, DISPLAY): internal resolution up to 4K, 4x MSAA anti-aliasing (from the next start; WebGPU offers no other sample count) and anisotropic filtering up to 16x. Widescreen (16:9, 16:10, 21:9, 32:9, 48:9 or the window's shape, up to 52:9 for three screens side by side) widens the 3D view, puts the flight HUD at the screen edges and fills the screen in cutscenes (Cinematic bars keeps them in their 2.1:1 cinema frame with black bars instead); wider windows get bars at the sides. Frame rate: 60, 90, 120 or 144 frames a second, the game at its normal speed. V-Sync (off by default) shows each frame in step with the display's refresh: no tearing, a little more input lag. With it on, a frame rate at or above the display's refresh runs at the refresh (144 on a 120 Hz display: 120), and cutscene skips still run at full speed.
- Cutscenes (F1, GAMEPLAY): with Skippable cutscenes on, hold B for 2 seconds in the opening crawl or a cutscene to skip it (a ring in the corner fills while you hold); holding B also skips the intro at start. Skip intro logos reaches the title in about 10 seconds by itself. The game's own mission clock keeps running through cutscenes (on the GameCube too); Mission time without cutscenes (Gameplay, off) leaves their time out of the results screen's time and the medal.
- Special Features: the documentary and the teaser play at their own speed at any frame rate; left / right jumps 5 seconds, and A, B or START pauses them (CONTINUE / BACK). While the audio commentary plays in a mission, L3 (keyboard C; F1 > Controls > Hotkeys) pauses it.
- The mouse works in the game's own menus: point at an item to select it, click for A, right click for B, and the wheel moves up and down (also on the pause screen and in the art gallery).
- Loading: Fast loading (Gameplay, on) reads the disc at SSD speed instead of the GameCube drive's 3 MB/s. The disc image is read ahead of the game on a thread of its own, so it can sit on a hard disk or a network drive without the game stuttering while it streams music and voices.
- Where your files are: on Windows a
userfolder next tored_two.exe(the zip has one) holds settings, the memory card, save states, logs, texture packs, codes and the shader cache, so the folder can live anywhere (another drive, a NAS). An install that has nouserfolder but an older%APPDATA%\Red Twokeeps using that one; createuserto make it portable (its first start copies the settings, controls and memory card over). Linux:~/.local/share/Red Two/; macOS:~/Library/Application Support/Red Two/; Android:Android/data/io.github.gminustwo.redtwo/files. - Cheats (F1 > Cheats): invincibility, infinite lives, infinite bombs, perfect mission stats (the results screen says 0:01, every enemy destroyed, 100% accuracy, no friendlies or lives lost and 100% targeting computer efficiency, and the medal is awarded for those), and all craft (every craft a mission allows waits in its hangar). Passcodes: the game's own unlocks without typing codes - all missions, all tech upgrades, ace mode, art gallery, music hall, documentary, audio commentary, credits, black and white - kept in the game's save as if the codes had been entered. Refund bonus missions (in the menus): the bonus missions you bought with points go back on sale, with their cost returned and the medals won there erased (with the points those medals earned), so you can buy them in another order.
- RetroAchievements (F1 > Achievements): log in with your retroachievements.org account (only the login token is stored), on a sign-in page Red Two opens in your browser, or take Dolphin's login; softcore only, so save states and cheats stay usable. Unlocks pop up in the top right corner.
- Reset game, Back to launcher and Quit to desktop are on the menu's first tab, GAME.
- Retry mission (GAME tab, during a mission): starts the mission over, as the game's own REPLAY MISSION does after a failure: 3 lives, nothing recorded for the attempt. From the game's pause screen too (it resumes first).
- Save states: Back + RB saves, Back + LB loads, Back + D-pad right / left picks the slot
(8 slots; keyboard F5 / F8, F7 / F6). F1 > Controls has the slot, save / load buttons and the
hotkeys, each any combination of buttons (or keys) held together: pick the row, press A, hold
the buttons, let go. On a controller Back alone (released with nothing else pressed) still
opens the menu. States live in the user folder's
statesand also load after a restart, but only into the same build of Red Two (a rebuild makes them "OLD"). The memory card is not part of a state: loading one does not undo the game's own saves. - Saves go to the user folder's
saves/GSWE64_A.raw(slot A;GSWP64_A.rawfor the European disc,GSWJ13_A.rawfor the Japanese one; a new card comes formatted and the game makes its save at the first start without asking). A.rawcard from Dolphin or Nintendont can be copied there as it is, whatever its size (59 to 2043 blocks).R2_CARD_A=<path>uses another card image. - Mods (F1, MODS tab): texture packs in Dolphin's format go in the user folder's
textures\(aGSWE64folder inside, exactly as in Dolphin'sLoad\Textures;GSWP64,GSWJ13andGSWfolders load too, whichever disc runs, since packs match the game's textures by their contents;.ddsand.png, mip files and wildcards work), or stay wherever you unpacked them: MODS -> Texture pack folder opens a folder browser (d-pad / stick, A opens, X goes up, B back) - pick the pack's folder (the one holdingGSWE64, orGSWE64itself), e.g. in Downloads or on an SD card. The Texture pack folder row shows how many textures loaded from it, and says why when there are none (an archive still to unpack, images not namedtex1_...). The IMPORT FROM DOLPHIN rows are only about copying things from Dolphin. Back + D-pad up (F9) turns the texture packs off and on again at once, to compare (rebindable in Controls). Gecko / Action Replay codes and patches go in the user folder'scodes.ini(Dolphin's GameSettings format;codes_GSWP64.iniandcodes_GSWJ13.inifor the European and Japanese discs, whose memory differs) and can be switched in the menu. The game is recompiled ahead of time, so codes that change its code (Gecko C2 "insert ASM", writes into code) cannot work; the menu marks them as not supported. - Importing from Dolphin: MODS -> IMPORT FROM DOLPHIN, or
red_two.exe --import-dolphin[=saves,textures,codes] --console. Red Two finds Dolphin's user folder (AppData, Documents, a portable install, the registry, a custom Load folder inDolphin.ini) and brings over this game's newest save (from GCI folders or.rawcards; the previous card is kept insaves\backup, and the game restarts), its texture packs (copied) and its codes (with their on/off states).R2_DOLPHIN_DIR=<User folder>points it elsewhere. - Shaders (F1, DISPLAY -> PERFORMANCE): "Prepare shaders at start" (on) compiles every shader the game has used on this device before it starts; off, the game starts at once and objects may pop in while their shaders compile. The downloads bring a starter list of the game's shaders, so a new install's first start compiles them before the game begins (about 20 seconds on a desktop, once; later starts take about a second). "Ubershaders" (on; off on a Steam Deck's first start) draws not-yet-compiled objects with a generic shader instead of skipping them.
- Sound (F1, AUDIO): the game mixes for Dolby Pro Logic II. Speakers: Automatic follows
the system's speaker setup; Stereo sends the encoded mix for a receiver's Pro Logic II decoder;
5.1 and 7.1 give the rear its own speakers (7.1 splits it into side and back pairs). Keep the
game's own sound setting (Options > Sound Settings) on STEREO.
R2_NO_AUDIO=1runs without sound. - Updates: at start Red Two asks GitHub whether a newer version is out and offers it at the top of the menu's GAME tab: download and install, then a restart into it, with your settings, saves, states and texture packs kept (the download is checked against the release's checksums). The AppImage replaces itself under the same name, so a Steam shortcut keeps working. GAME > Check for updates turns the check off; the version is under the menu's title.
- Discord: with the Discord app open on the same PC, your Discord profile shows that you're playing Red Two, the mission you're in (flying, paused or in a cutscene; the hangar, the menus, the launcher) and for how long. Only the Discord app on your PC is told, nothing else is sent; GAME > Discord Rich Presence turns it off. GAME > Red Two's Discord (in the launcher and in game) opens the invite to Red Two's Discord server for chat and news; bug reports go on GitHub Issues (see below).
- Every session writes a log to the user folder's
logs(Linux:~/.local/share/Red Two/logs), also when another program starts Red Two (RecompLauncher, a terminal): that program gets a copy of it as well.--consoleshows it in a console window on Windows.
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:
Red Two's version: under the menu's title (F1, or the controller's Back / Select), e.g. "VERSION 1.3". Newer versions may already fix it: the menu offers updates at the top of its GAME tab.
What happened and where: the mission (or menu, cutscene) 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 Red Two writes a new one, named by the date and time it started, so if you started Red Two 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 tored_two.exe(an older install without auserfolder:%APPDATA%\Red Two\logs) - Steam Deck / Linux:
~/.local/share/Red Two/logs - macOS:
~/Library/Application Support/Red Two/logs - Android:
Android/data/io.github.gminustwo.redtwo/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 Red Two), your display and aspect ratio, a texture pack if you use one, your PC's CPU and graphics card.
A screenshot or a short video for anything you can see.
A save state from just before the problem can help too, but states only load into the build that made them: mention that you have one, and we'll ask for it if needed.
How it works
tools/rvz.py and src/common/disc_image.cpp read the disc; the recompiler (src/recompiler)
finds the game's functions in main.dol without symbols and writes them out as C++ - including the
second executable the game hides inside main.dol and runs from its own demand-paged virtual
memory. The runtime (src/runtime) stands in for the console: the CPU state and MMU, threads on
host fibers, the GameCube's hardware at the register level (video, disc, audio DSP, ARAM, memory
card, controllers), and a bridge that hands the GPU command stream to
Aurora for rendering. Names we gave the game's functions are
in config/GSWE64/symbols.txt.
Credits
Some features come from ZeDctr's Red Two Plus fork: hold-to-skip cutscenes, the documentary's speed fix, seeking and pause menu, Switch button prompts, the memory card's first save, pausing the audio commentary, the mouse in the game's menus, cinematic bars and faster audio catch-up. Rendering is Aurora's.
Legal
Red Two is released under the MIT License. It covers this repository's own code only, not the game's code that a build (and the prebuilt downloads) contain in recompiled form.
This repository contains no code or assets from the game. Star Wars and Rogue Leader are trademarks of Lucasfilm Ltd.; GameCube is a trademark of Nintendo. This project is not affiliated with or endorsed by them.
探索相关项目
加载中…