Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
## 1.0.6 (17/11/2026)

OpenGP can now be installed and played from [RecompLauncher](https://recomplauncher.com/game/opengp): pick your GP 2 disc image there, and it builds the game and starts it, with OpenGP's settings on the game's page. No gameplay changes.

- The package carries a `recomplauncher.json`. RecompLauncher asks for your Mario Kart Arcade GP 2 disc image (GGPE02), builds the game from it, and starts it with Play. Each new version of OpenGP builds the game again there. GP 1 is built and played from OpenGP's own launcher, as before
- OpenGP's settings show on the game's page in RecompLauncher: window, window size, aspect ratio, resolution, V-Sync, even frame pacing, volume, free play, brake goes back, pausing, camera, Discord status and linked cabinets. RecompLauncher's save backups pick up your Mario Cards, the game's records, settings and controls
- `opengp-cli --only ID` builds just that game; an image of the other game is refused, with a message naming it. `opengp-cli --prepare` prints its progress as `progress <0..1> <text>` lines for other launchers, and doesn't wait for a key at the end
- The README has a "Get it on RecompLauncher" badge

## 1.0.5 (17/11/2026)

This release pulls in the latest changes from [mkgp2-decomp](https://github.com/naari3/mkgp2-decomp), the GP 2 decompilation. Thank you to naari3 and everyone working on it! Thousands more of the games' functions and data now have names, which makes hang reports easier to read and the code easier to work on. No gameplay changes.
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.25)
project(OpenGP VERSION 1.0.5 LANGUAGES C CXX)
project(OpenGP VERSION 1.0.6 LANGUAGES C CXX)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# OpenGP

<a href="https://recomplauncher.com/game/opengp"><picture><source media="(prefers-color-scheme: dark)" srcset="https://recomplauncher.com/assets/press/launcher/badge-light.svg"><img alt="Get it on RecompLauncher" src="https://recomplauncher.com/assets/press/launcher/badge-dark.svg" height="48"></picture></a>

OpenGP is a **native PC port of Mario Kart Arcade GP and Mario Kart Arcade GP 2**
(Namco, 2005 and 2007, Triforce arcade hardware). It is built by **static recompilation**, the
same approach as [Zelda64Recomp](https://github.com/Zelda64Recomp/Zelda64Recomp) and
Expand Down Expand Up @@ -63,6 +65,10 @@ unpack it and open `OpenGP`, the launcher. Add your disc image of each game: Ope
on your machine from your images, then plays them (see [docs/packaging.md](docs/packaging.md) and
[docs/playing.md](docs/playing.md)). On the command line, `opengp-cli` builds them the same way.

[RecompLauncher](https://recomplauncher.com/game/opengp) can also install and update OpenGP,
build GP 2 from your disc image and start it, with OpenGP's settings on the game's page. GP 1 is
built and played from OpenGP's own launcher in the same folder.

## Building

You need CMake 3.25+, Ninja, Python 3.9+, and GCC 12+ or Clang 16+. On Windows, use clang-cl: the
Expand Down
7 changes: 7 additions & 0 deletions cmake/package.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -156,3 +156,10 @@ install(FILES ${PROJECT_SOURCE_DIR}/thirdparty/qt/third-party.txt DESTINATION li
# All of them: the player's pages link to the others.
install(DIRECTORY ${PROJECT_SOURCE_DIR}/docs/ DESTINATION docs FILES_MATCHING PATTERN "*.md")
install(FILES ${PROJECT_SOURCE_DIR}/tools/installer/ISO-README.txt DESTINATION ISO RENAME README.txt)

# How RecompLauncher (recomplauncher.com) sets the package up, next to the
# launcher. Its setup step is versioned with the package: each version builds
# the game again.
configure_file(${PROJECT_SOURCE_DIR}/tools/installer/recomplauncher.json.in
${CMAKE_BINARY_DIR}/package/recomplauncher.json @ONLY)
install(FILES ${CMAKE_BINARY_DIR}/package/recomplauncher.json DESTINATION .)
11 changes: 11 additions & 0 deletions docs/packaging.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,17 @@ opengp-cli [IMAGE...] [--force] [--jobs N] [--cxx COMPILER] [--keep-build]
- `--cxx COMPILER` uses this C++ compiler instead of the package's.
- `--keep-build` keeps the generated C++ and the object files in `build/<game ID>/`. The installer
deletes them once the game is built otherwise.
- `--only ID` builds only that game (`GGPE02` or `GGPE01`). An image of the other game is an error.
- `--prepare` is for other launchers: it prints its progress as `progress <0 to 1> <text>` lines
and never waits for a key at the end.

### RecompLauncher

The package carries a `recomplauncher.json`, which tells [RecompLauncher](https://recomplauncher.com)
how to set OpenGP up: the player picks their GP 2 disc image, RecompLauncher runs
`opengp-cli --prepare --only GGPE02 <image>` to build the game, and Play starts `opengp-mkgp2`
with `--iso <image>`. OpenGP's settings show on the game's page there, and RecompLauncher edits
`user/settings.toml` before each start. Each new version of OpenGP builds the game again.

## The compiler

Expand Down
107 changes: 89 additions & 18 deletions tools/installer/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,19 @@
// from the player's disc images, as the launcher (the package's OpenGP) does.
//
// opengp-cli [IMAGE...] [--force] [--jobs N] [--cxx COMPILER] [--keep-build]
// [--only ID] [--prepare]
//
// Without images it uses the images each game was built from before, then
// those in ISO/ and private/ next to it. Each game is built on its own: a
// missing image only skips that game. Games already built by this version
// are skipped unless --force is given. On Windows an image can be dropped on
// opengp-cli.exe.
//
// For other launchers (RecompLauncher's recomplauncher.json): --only ID builds
// that game alone, and an image of another game is an error; --prepare prints
// the progress as "progress <0..1> <text>" lines and never waits for a key.

#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <filesystem>
Expand All @@ -32,11 +38,16 @@ namespace {

constexpr const char* kUsage =
"usage: opengp-cli [IMAGE...] [--force] [--jobs N] [--cxx COMPILER]\n"
" [--keep-build]\n"
" [--keep-build] [--only ID] [--prepare]\n"
"\n"
"Builds the games from your disc images (.iso / .gcm). Without images, it uses\n"
"the ones the games were built from before, then those in ISO/ and private/.\n"
"OpenGP, the launcher next to it, does the same in a window.\n";
"OpenGP, the launcher next to it, does the same in a window.\n"
"\n"
" --only ID build only this game (GGPE02 or GGPE01); an image of another\n"
" game is an error\n"
" --prepare for other launchers: the progress as \"progress <0..1> <text>\"\n"
" lines, and no waiting for a key at the end\n";

// When opengp-cli.exe was started from Explorer (a double click, or an
// image dropped on it), its console closes when it exits: wait for a key first.
Expand All @@ -51,9 +62,9 @@ void pause_if_own_console() {
#endif
}

int run(const std::vector<std::string>& args) {
int run(const std::vector<std::string>& args, bool* prepare) {
std::vector<std::string> images;
std::string cxx;
std::string cxx, only;
bool force = false;
installer::BuildOptions options;
const std::size_t argc = args.size();
Expand All @@ -70,6 +81,8 @@ int run(const std::vector<std::string>& args) {
}
options.jobs = static_cast<unsigned>(n);
} else if (a == "--cxx" && i + 1 < argc) cxx = args[++i];
else if (a == "--only" && i + 1 < argc) only = args[++i];
else if (a == "--prepare") *prepare = true;
else if (a == "-h" || a == "--help") {
std::printf("%s", kUsage);
return 0;
Expand All @@ -87,6 +100,25 @@ int run(const std::vector<std::string>& args) {
std::fprintf(stderr, "%s\n", installer::not_a_package_message(error).c_str());
return 1;
}
if (!only.empty()) {
// This game alone: the package's others are left out of this run.
const auto it = std::find_if(package.games.begin(), package.games.end(),
[&](const installer::GameInfo& g) { return g.id == only; });
if (it == package.games.end()) {
std::fprintf(stderr, "--only %s: not one of this package's games\n", only.c_str());
return 2;
}
for (const std::string& image : images) {
const installer::GameInfo* g = installer::identify_image(package, image);
if (g && g->id != only) {
std::fprintf(stderr, "%s is %s (%s), not %s (%s). Pick your disc image of %s.\n", image.c_str(),
g->title.c_str(), g->id.c_str(), it->title.c_str(), it->id.c_str(), it->title.c_str());
return 1;
}
}
installer::GameInfo game = *it;
package.games = {std::move(game)};
}
std::printf("OpenGP %s installer\n\n", package.version.c_str());
// Everything it makes goes in the package folder: say so at once if it
// cannot write there.
Expand All @@ -96,14 +128,37 @@ int run(const std::vector<std::string>& args) {
}

installer::Reporter report;
report.line = [](const std::string& s) {
std::printf("\r%s\n", s.c_str());
std::fflush(stdout);
};
report.progress = [](double f) {
std::printf("\r %3d%%", static_cast<int>(f * 100 + 0.5));
std::fflush(stdout);
};
// --prepare: the whole run as one fraction. Each game's share is mostly its
// compile step, the only one that reports its own progress.
std::size_t game_index = 0, game_count = 1;
double game_done = 0;
std::string last_line;
int last_percent = -1;
auto overall = [&] { return (static_cast<double>(game_index) + game_done) / static_cast<double>(game_count); };
if (*prepare) {
report.line = [&](const std::string& s) {
last_line = s;
std::printf("progress %.3f %s\n", overall(), s.c_str());
std::fflush(stdout);
};
report.progress = [&](double f) {
game_done = 0.1 + 0.85 * f;
const int percent = static_cast<int>(overall() * 100);
if (percent == last_percent) return;
last_percent = percent;
std::printf("progress %.3f %s\n", overall(), last_line.c_str());
std::fflush(stdout);
};
} else {
report.line = [](const std::string& s) {
std::printf("\r%s\n", s.c_str());
std::fflush(stdout);
};
report.progress = [](double f) {
std::printf("\r %3d%%", static_cast<int>(f * 100 + 0.5));
std::fflush(stdout);
};
}

const auto found = installer::find_images(package, images, report);
for (const installer::GameInfo& g : package.games) {
Expand All @@ -112,15 +167,21 @@ int run(const std::vector<std::string>& args) {
if (!have) std::printf("%s: no disc image found; skipped.\n", g.title.c_str());
}
if (found.empty()) {
std::printf(
"\nPut your disc images in the ISO folder next to opengp-cli, or drop one on it (see ISO/README.txt).\n");
if (*prepare)
std::fprintf(stderr, "No disc image of %s found.\n", package.games.front().title.c_str());
else
std::printf(
"\nPut your disc images in the ISO folder next to opengp-cli, or drop one on it (see ISO/README.txt).\n");
return 1;
}

int failures = 0;
std::string compiler;
game_count = found.size();
for (const auto& [game, image] : found) {
std::printf("\n%s (%s)\n", game->title.c_str(), game->id.c_str());
game_done = 0;
if (*prepare) report.line(game->title + " (" + game->id + ")");
else std::printf("\n%s (%s)\n", game->title.c_str(), game->id.c_str());
if (!force && installer::is_installed(package, *game)) {
std::printf("Already built by this version (--force rebuilds it).\n");
// The image may have moved: the game uses this one from now on.
Expand All @@ -130,6 +191,7 @@ int run(const std::vector<std::string>& args) {
else
std::fprintf(stderr, "%s\n", error.c_str());
}
++game_index;
continue;
}
if (compiler.empty() && !installer::find_compiler(package, cxx, report, &compiler, &error)) {
Expand All @@ -140,15 +202,24 @@ int run(const std::vector<std::string>& args) {
std::fprintf(stderr, "\n%s\n", error.c_str());
++failures;
}
++game_index;
}
if (*prepare) {
if (failures == 0) {
game_done = 0;
report.line("Ready to play");
}
} else if (failures == 0) {
std::printf("\nDone. Start a game with OpenGP, or with opengp-mkgp2 or opengp-mkgp1.\n");
}
if (failures == 0) std::printf("\nDone. Start a game with OpenGP, or with opengp-mkgp2 or opengp-mkgp1.\n");
return failures ? 1 : 0;
}

} // namespace

int main(int argc, char** argv) {
const int code = run(os::utf8_args(argc, argv));
pause_if_own_console();
bool prepare = false;
const int code = run(os::utf8_args(argc, argv), &prepare);
if (!prepare) pause_if_own_console();
return code;
}
Loading
Loading