Skip to content

Latest commit

 

History

6,375 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ZSNES 2

CI

logo

The last release of ZSNES was over 18 years ago (2007-10-31). It requires heavy patching and tweaking of compilation flags to build and run on a modern Linux distro. Most of it was written in 32-bit x86 Assembly, with MMX instructions.

This is a fork that aims to solve this.

Goals and non-goals:

  • Compiling ZSNES so that it works on 64-bit x86 is a goal (that has been reached).
  • Porting the Assembly to C11 is a goal (that has been reached).
  • Supporting modern Linux distros (and FreeBSD and macOS, if possible) is a goal.
  • Supporting multiple CPUs and platforms is a goal (that has been reached).
  • Supporting DOS is not a goal.
  • Supporting Windows is not a goal, but a "nice to have".
  • Improving the netplay feature is a long term goal.
  • To be like an LTS release of ZSNES is a goal.

Pull requests that fixes inaccuracies with the emulation are welcome, as well as pull requests for regular bugs.

Requirements

  • python3, sdl3, pipewire (or libao), and a C compiler like gcc or clang.
  • nasm is only needed for testing.

Tested on Arch Linux, Fedora and Debian 12 on x86_64, and on macOS on aarch64.

Build

make

Plain make builds for the current operating system and CPU on Windows/MSYS2, Linux, macOS, FreeBSD, OpenBSD, and NetBSD. Architecture-specific targets are also available:

make win_i686
make win_x86_64
make linux_i686
make linux_x86_64
make linux_aarch64
make macos_x86_64
make macos_aarch64
make freebsd_x86_64
make freebsd_aarch64

Cross targets require a suitable target compiler and target libraries. Run make help for the complete target list.

Run a ROM

Point ZSNES at a ROM after building it:

# Linux, macOS, or BSD
./zsnes ~/roms/snes/example.sfc

# Windows from MSYS2 or Git Bash
./zsnes.exe ~/roms/snes/example.sfc

Replace example.sfc with the path to your own ROM; ROM files are not included.

Debug build

Build zsnes with debug symbols and debugger-friendly optimization:

make debug

The build-mode stamp automatically replaces incompatible release objects. To run the same ROM under GDB:

gdb --args ./zsnes ~/roms/snes/example.sfc
# Use ./zsnes.exe instead on Windows.

At the GDB prompt, enter run. If ZSNES crashes, enter bt full to print a detailed backtrace. With LLDB, use:

lldb -- ./zsnes ~/roms/snes/example.sfc

Then enter run, followed by bt all after a crash.

Install

make install

Installing a desktop shortcut is possible. A zsnes.desktop file is included in linux/zsnes.desktop. It could also be generated with gendesk. If you have a suitable icon named zsnes.png then they can both be installed with:

install -Dm644 zsnes.png /usr/share/pixmaps/zsnes.png
install -Dm644 zsnes.desktop /usr/share/applications/zsnes.desktop

For other platforms than Linux, different flags may apply. ZSNES 2 is primarily one executable, but for UNIX-inspired operating systems, the man page (man/zsnes.1) can be installed as ie. /usr/share/man/man1/zsnes.1 (this is handled by make install, though).

macOS

Install the dependencies with Homebrew, then build:

brew install libao libpng pkgconf python3 sdl3
git clone https://github.com/xyproto/zsnes
cd zsnes
make

Debian and Ubuntu

Try installing ZSNES from this flatpak, or see if the following commands works for you, on x86_64. Please create a PR if they don't:

For a 32-bit x86 build while on x86_64:

dpkg --add-architecture i386
apt update
apt install -y git make pkg-config python3 zlib1g-dev build-essential
git clone https://github.com/xyproto/zsnes
cd zsnes
make
apt install -y gcc-multilib libglvnd-dev libglvnd-dev:i386 libpng-dev libpng-dev:i386 libsdl3-dev libsdl3-dev:i386 zlib1g-dev zlib1g-dev:i386
make

Cross-Compiling for Windows on Debian/Ubuntu

Try the following commands in ie. Ubuntu 24 running under WSL:

apt update
apt install -y git make mingw-w64 libz-mingw-w64-dev python3 pkg-config build-essential
git clone https://github.com/xyproto/zsnes
cd zsnes
make ARCH=win WITH_PNG= CC_TARGET=i686-w64-mingw32-gcc CC=i686-w64-mingw32-gcc WINDRES=i686-w64-mingw32-windres

Compiling for Windows with MSYS2

Use an MSYS2 MinGW shell matching the desired target architecture.

Run the following commands. Please create a PR if you have issues.

Tested on MSYS2 x86_64 version 20260322.

pacman -Syu
pacman -Sy git make pkg-config python3 mingw-w64-x86_64-gcc mingw-w64-x86_64-libpng mingw-w64-x86_64-zlib
make

Use make win_i686 or make win_x86_64 when selecting an architecture explicitly.

Pull requests

  • Pull requests are welcome.
  • Being able to build and run ZSNES on Linux is a priority.
  • Please have clang-format installed and run make fmt before submitting a pull request.

Windows users

General info

Thanks to Christoph Mallon for the commits that this fork is based on.

List of contributors

These are the contributors listed in the text files that are included with the 1.51 release of ZSNES, and on the zsnes.com webpage:

  • zsKnight
  • _Demo_
  • pagefault
  • Nach
  • grinvader
  • Deathlike2
  • Jonas Quinn
  • blargg
  • Pharos
  • teuf
  • relnev
  • prometheus
  • theoddone33
  • EvilTypeGuy
  • stainless
  • aaronl
  • MKendora
  • kode54
  • zinx
  • amit
  • hpsolo
  • Kreed
  • Neviksti
  • ipher
  • relnev
  • StatMat
  • MKendora
  • hpsolo
  • aaronl
  • Diablo-D3
  • Wilbern Cobb
  • Thorsten "mirabile" Glaser
  • Mitchell "The Khan Artist/Noxious Ninja" Mebane

Previous documentation

  • Some of the information in the old text files in docs/readme.txt/*.txt has not yet been ported over to the man/zsnes.1 man page or to a Markdown document.
  • The plan is to do this. Pull requests are welcome.

Additional documentation:

General info

About

Classic Super Nintendo emulator

Topics

Resources

Stars

258 stars

Watchers

14 watching

Forks

Releases

Packages

Used by

Contributors

Languages