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.
python3,sdl3,pipewire(orlibao), and a C compiler likegccorclang.nasmis only needed for testing.
Tested on Arch Linux, Fedora and Debian 12 on x86_64, and on macOS on aarch64.
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_aarch64Cross targets require a suitable target compiler and target libraries. Run
make help for the complete target list.
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.sfcReplace example.sfc with the path to your own ROM; ROM files are not included.
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.sfcThen enter run, followed by bt all after a crash.
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).
Install the dependencies with Homebrew, then build:
brew install libao libpng pkgconf python3 sdl3
git clone https://github.com/xyproto/zsnes
cd zsnes
makeTry 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
makeTry 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-windresUse 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
makeUse make win_i686 or make win_x86_64 when selecting an architecture explicitly.
- Pull requests are welcome.
- Being able to build and run ZSNES on Linux is a priority.
- Please have
clang-formatinstalled and runmake fmtbefore submitting a pull request.
- Compiled executables for ZSNES 1.51 for Windows are available at https://sourceforge.net/projects/zsnes/files/zsnes/ZSNES%20v1.51/
- Pull requests for supporting Windows are welcome, but it's not a goal for this project.
Thanks to Christoph Mallon for the commits that this fork is based on.
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_pagefaultNachgrinvaderDeathlike2Jonas QuinnblarggPharosteufrelnevprometheustheoddone33EvilTypeGuystainlessaaronlMKendorakode54zinxamithpsoloKreedNevikstiipherrelnevStatMatMKendorahpsoloaaronlDiablo-D3Wilbern CobbThorsten "mirabile" GlaserMitchell "The Khan Artist/Noxious Ninja" Mebane
- Some of the information in the old text files in
docs/readme.txt/*.txthas not yet been ported over to theman/zsnes.1man page or to a Markdown document. - The plan is to do this. Pull requests are welcome.
Additional documentation:
- License: GPL2
- Version: 2.3.0
- Fork author: Alexander F. Rødseth <xyproto@archlinux.org>
