Skip to content

Sega Genesis / Sega CD / SNES / Master System / Game Gear emulator

License

Notifications You must be signed in to change notification settings

jsgroth/jgenesis

Repository files navigation

jgenesis

Cross-platform multi-console emulator supporting a number of 8-bit and 16-bit gaming consoles.

Linux, Windows, and web (WASM) are officially supported. Other platforms may work but have not been tested.

Features

  • Emulation for the following consoles:
    • Sega Genesis / Mega Drive
    • Sega CD / Mega CD
    • Sega 32X / Mega 32X
      • This core is currently not well-optimized - full-speed 32X emulation requires a CPU with decent single-core performance
    • Sega Master System / Mark III
    • Game Gear
    • Nintendo Entertainment System (NES) / Famicom
    • Super Nintendo Entertainment System (SNES) / Super Famicom
    • Game Boy / Game Boy Color
  • GPU-based renderer with integer prescaling and optional linear interpolation
  • Configurable pixel aspect ratio for each console with several different options: accurate to original hardware/TVs, square pixels, and stretched to fill the window
  • Support for the Sega Master System FM sound unit expansion
  • Support for the Sega Genesis SVP chip, used in Virtua Racing
  • Support for the most common NES mappers, plus a number of less common mappers
  • Support for most SNES coprocessors (e.g. Super FX, SA-1, DSP-1, CX4, S-DD1, SPC7110)
  • Support for both 3-button and 6-button Genesis controllers
  • Support for keyboard controls and DirectInput gamepad controls
  • Save states, fast forward, and rewind
  • Some simple horizontal blur and naive anti-dither shaders for blending dithered pixel patterns, which were extremely common on these consoles due to limited color palettes and lack of hardware-supported transparency
  • Optional 2x CPU overclocking for Sega Master System and Game Gear emulation
  • Optional 2-4x GSU overclocking for SNES Super FX games
  • Can run the Titan Overdrive and Titan Overdrive 2 demos for the Mega Drive

TODOs:

  • Support multiple Sega CD BIOS versions in GUI and automatically use the correct one based on disc region
  • Support 24C64 EEPROM chips (used only in Frank Thomas Big Hurt Baseball and College Slam)

Dev Builds

The GitHub Actions workflow compiles release builds on every commit, which will stay available for 90 days afterwards: https://github.com/jsgroth/jgenesis/actions

Note that these builds are not always well-tested and may have bugs.

Dependencies

Rust

This project requires the latest stable version of the Rust toolchain to build.

SDL2

This project requires SDL2 core headers to build. SDL2 is used for windowing, audio playback, and reading keyboard/gamepad/mouse inputs.

Linux (Debian-based):

sudo apt install libsdl2-dev

Windows:

Build & Run

GUI:

cargo run --release --bin jgenesis-gui

CLI:

cargo run --release --bin jgenesis-cli -- -f <path_to_rom_file>

To view all CLI args:

cargo run --release --bin jgenesis-cli -- -h

To build with maximum optimizations (better runtime performance + smaller binary size at the cost of longer compile time):

cargo build --profile release-lto

...After which the executables will be in target/release-lto/.

If you are building solely for your own personal usage, you can additionally set the flag -C target_cpu=native to tell the Rust compiler that it can use any CPU instruction that your computer's CPU supports, which may slightly improve performance:

RUSTFLAGS="-C target-cpu=native" cargo build --profile release-lto

Screenshots

Screenshot from 2023-08-27 22-47-13

Screenshot from 2023-08-27 22-53-09

Screenshot from 2023-09-27 19-36-19

Screenshot from 2023-09-29 17-12-35

Screenshot from 2023-11-06 21-42-49

Screenshot from 2023-08-27 22-45-06

Screenshot from 2023-08-27 22-45-32

Screenshot from 2023-09-18 15-44-28

Sources

Sega Master System / Game Gear

Sega Genesis / Mega Drive

Sega CD / Mega CD

32X

NES

SNES

Game Boy / Game Boy Color