#genesis #cli #sgdk #megadrive

app sgdkx

Unofficial command-line toolkit for SGDK

3 releases

Uses new Rust 2024

0.2.3 Jul 22, 2025
0.2.2 Jul 22, 2025
0.2.1 Jul 22, 2025

#1022 in Command line utilities

MIT license

105KB
2K SLoC

sgdkx

๐Ÿ‡ฏ๐Ÿ‡ต ๆ—ฅๆœฌ่ชž็‰ˆ README ใฏใ“ใกใ‚‰ใ‚’ใ”่ฆงใใ ใ•ใ„ใ€‚

sgdkx is a CLI tool to support development with SGDK (Sega Genesis Development Kit).

Installation

Install sgdkx (via cargo)

cargo install sgdkx

Required Tools (macOS)

The following tools are required. You can install them with Homebrew:

brew install make openjdk compiledb

brew tap gcenx/wine
brew install --cask --no-quarantine wine-crossover

brew install doxygen # options
  • git is usually pre-installed, but if not, install it with brew install git.
  • Running sgdkx with no command will perform an environment check and show if all required tools are installed.

Usage

Main commands:

  • sgdkx
    Show environment check, SGDK/emulator configuration, and help message.

  • sgdkx setup [--version <version>]
    Download and install SGDK (Sega Genesis Development Kit).
    You can specify the version with --version (default: master).
    The --version option accepts a branch name, tag, or commit ID.
    Examples:

    • --version V2.11 for tag V2.11
    • --version ef9292c0 for commit ID ef9292c0 The SGDK path and version are saved in config.toml.
      Additionally, if doxygen is installed and SGDK documentation does not exist, documentation will be generated automatically.
  • sgdkx setup-emu [gens|blastem]
    Download and install an emulator (Gens or BlastEm).
    The path to the emulator is saved in config.toml.

  • sgdkx new <project_name>
    Create a new project from the SGDK sample.

  • sgdkx run [--emulator <gens|blastem>] [--rom <path>]
    Run the ROM file with the specified emulator (default: gens or installed emulator).
    You can specify the emulator with --emulator and the ROM file path with --rom (default: out/rom.bin).

  • sgdkx uninstall
    Uninstall SGDK, remove configuration, and also delete any emulators (Gens/BlastEm) installed via setup-emu at the paths recorded in config.toml.

  • sgdkx doc
    If SGDK documentation exists, it will be opened in your browser.

Experimental Features

  • sgdkx setup-web Download a web emulator template for playing your ROM in a browser.

  • sgdkx web-export [--rom <path>] [--dir <parent-dir>] Export your ROM and a web emulator template for browser-based play. This command copies a web emulator template (HTML/JS/WASM) and your ROM into a new web-export directory under the specified parent directory (default: current directory).

  • sgdkx web-server [--dir <directory>] [--port <port>] Serve the web-export directory using a built-in HTTP server (with COOP/COEP headers for WASM compatibility). By default, it serves the web-export directory at localhost:8080. You can change the directory and port using the options. Example: sgdkx web-server --dir web-export --port 9000

Simple Example

sgdkx setup --version v2.11 # stable
sgdkx setup-emu
sgdkx new your_project
cd your_project
make
sgdkx run

Reference: Output when run without any command

Unofficial tools for SGDK workflow

Usage: sgdkx [COMMAND]

Commands:
  setup       Setup SGDK for development
  doc         Show SGDK documentation status
  setup-emu   Setup emulator for running ROM files
  new         Create a new SGDK project
  run         Run ROM file with emulator
  uninstall   Uninstall SGDK installation and configuration
  web-export  Export ROM and web emulator template for web deployment
  web-server  Serve web-export directory with HTTP server (with COOP/COEP headers)
  open        Open SGDK installation directory
  setup-web   Setup web export template
  help        Print this message or the help of the given subcommand(s)

Options:
  -h, --help     Print help
  -V, --version  Print version

๐Ÿฉบ sgdkx Environment Check
โœ… git: /opt/homebrew/bin/git
โœ… make: /usr/bin/make
โœ… java: /opt/homebrew/opt/openjdk/bin/java
โœ… compiledb: /opt/homebrew/bin/compiledb
โœ… doxygen: /opt/homebrew/bin/doxygen
โœ… wine: /opt/homebrew/bin/wine

๐Ÿ“ sgdkx Configuration: /Users/[user]/.sgdkx/data/config.toml
SGDK Path   : /Users/[user]/.sgdkx/data/SGDK
Version     : v2.11
Commit ID   : ef9292c03fe33a2f8af3a2589ab856a53dcef35c
Gens Path   : /Users/[user]/.sgdkx/data/gens/gens.exe
blastem Path: Not installed

๐Ÿ“„ SGDK documentation: /Users/[user]/.sgdkx/data/SGDK/doc/html/index.html

Acknowledgements / Dependencies

Special thanks to these excellent projects.

Notes

  • This tool is under active development.
  • This tool has not been thoroughly tested on Linux platforms. Linux users should proceed with caution.

Dependencies

~26โ€“45MB
~693K SLoC