{"id":15394205,"url":"https://github.com/xyproto/zsnes","last_synced_at":"2025-04-04T16:14:21.371Z","repository":{"id":37974072,"uuid":"397711845","full_name":"xyproto/zsnes","owner":"xyproto","description":"A maintained fork of ZSNES, a Super Nintendo emulator. The original project needs patches to build and is not maintained anymore: https://sourceforge.net/projects/zsnes/","archived":false,"fork":false,"pushed_at":"2025-01-24T13:10:03.000Z","size":8630,"stargazers_count":143,"open_issues_count":9,"forks_count":16,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-03-28T15:09:57.727Z","etag":null,"topics":["emulator","linux","lts","patched","snes","supernintendo","zsnes"],"latest_commit_sha":null,"homepage":"https://zsnes.com","language":"Assembly","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xyproto.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-08-18T19:20:08.000Z","updated_at":"2025-03-23T23:05:28.000Z","dependencies_parsed_at":"2024-08-21T20:59:15.658Z","dependency_job_id":"fb928532-6a60-4b97-bd3b-3f024cf33db4","html_url":"https://github.com/xyproto/zsnes","commit_stats":{"total_commits":5713,"total_committers":30,"mean_commits":"190.43333333333334","dds":0.7628216348678453,"last_synced_commit":"1ded2541325f38a71da7b18477d937ade7ba632f"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xyproto%2Fzsnes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xyproto%2Fzsnes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xyproto%2Fzsnes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xyproto%2Fzsnes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xyproto","download_url":"https://codeload.github.com/xyproto/zsnes/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247208145,"owners_count":20901570,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["emulator","linux","lts","patched","snes","supernintendo","zsnes"],"created_at":"2024-10-01T15:22:20.955Z","updated_at":"2025-04-04T16:14:21.337Z","avatar_url":"https://github.com/xyproto.png","language":"Assembly","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ZSNES 2\n\n\u003cimg align=\"right\" width=\"128\" height=\"128\" alt=\"logo\" src=\"icons/128x128x32.png\"\u003e\n\nThe last release of [ZSNES](http://zsnes.sourceforge.net/) was around 18 years ago (2007-10-31). It requires heavy patching and tweaking of compilation flags to build and run on a modern Linux distro.\n\nThis is a fork of ZSNES that aims to solve this.\n\nRunning `make` produces a 32-bit x86 ELF executable with MMX support, that can be run on a 64-bit x86 system. Large parts of ZSNES is written in 32-bit x86 Assembly, which is not easily ported to other platforms or systems. SSE support is disabled.\n\nGoals and non-goals:\n\n* Compiling ZSNES so that it works on 64-bit x86 is a goal (that has been reached).\n* Supporting 32-bit platforms is not a goal, but pull requests are welcome.\n* Supporting Windows is not a goal, but pull requests are welcome.\n* Supporting modern Linux distros (and FreeBSD, if possible) is a goal.\n* To be like an LTS release of ZSNES is a goal.\n* Porting ZSNES to SDL3 is a long term goal.\n* Adding back a more secure version of the net-play code is a long term goal.\n\nPull requests that fixes inaccuracies with the emulation are welcome, as well as pull requests for regular bugs.\n\n* Currently, `sdl1` (or better: `sdl12-compat`) is a required dependency.\n* The `sdl2` branch is a work-in-progress branch where ZSNES can be compiled with SDL2 but it does not yet run correctly.\n\nTested on Arch Linux, Fedora and Debian 12 on x86_64.\n\n### Build\n\n    make\n\nFor other platforms than Linux, adjust the first 70 lines of the `Makefile` as needed.\n\n### Debug build\n\nMake sure that `gdb` is installed. Then:\n\n    make clean debug\n\nThen type `r` in gdb to run zsnes with the example ROM (`~/roms/snes/example.sfc` must exist). Use ie. `bt full` to see the backtrace if ZSNES crashes.\n\n### Install\n\n    make install\n\nInstalling a desktop shortcut is possible. A `zsnes.desktop` file is included in `linux/zsnes.desktop`. It could also be generated with [gendesk](https://github.com/xyproto/gendesk). If you have a suitable icon named `zsnes.png` then they can both be installed with:\n\n    install -Dm644 zsnes.png /usr/share/pixmaps/zsnes.png\n    install -Dm644 zsnes.desktop /usr/share/applications/zsnes.desktop\n\nFor other platforms than Linux, different flags may apply. ZSNES 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).\n\n### Debian and Ubuntu\n\nTry installing ZSNES from [this flatpak](https://flathub.org/apps/io.github.xyproto.zsnes), or see if the following commands works for you, on **x86_64**. Please create a PR if they don't:\n\n```sh\ndpkg --add-architecture i386\napt update\napt install -y git make nasm pkg-config zlib1g-dev build-essential\ngit clone https://github.com/xyproto/zsnes\ncd zsnes\nmake\napt install -y g++-multilib gcc-multilib libgl-dev libgl-dev:i386 libpng-dev libpng-dev:i386 libsdl1.2-compat-dev libsdl1.2-compat-dev:i386 libsdl2-dev zlib1g-dev zlib1g-dev:i386\nmake\n```\n\n### Pull requests\n\n* Pull requests are welcome.\n* A port to SDL2 is extra warmly welcome!\n* Being able to build and run ZSNES on Linux is a priority.\n* Please have `clang-format` installed and run `./fmt.sh` before submitting a pull request.\n\n### Windows users\n\n* Compiled executables for ZSNES 1.51 for Windows are available at https://sourceforge.net/projects/zsnes/files/zsnes/ZSNES%20v1.51/\n* Pull requests for supporting Windows are welcome, but it's not a goal for this project.\n\n### General info\n\nThanks to Christoph Mallon for the commits that this fork is based on.\n\n* License: GPL2\n* Version: 2.0.12\n* Fork author: Alexander F. Rødseth \u0026lt;xyproto@archlinux.org\u0026gt;\n\n# Old documentation\n\n* Some of the information in the old text files in `docs/readme.txt/*.txt` has not yet been ported over to the `linux/zsnes.1` man page, or to a Markdown document.\n* The plan is to do this. Pull requests are welcome.\n\nThis is a summary based on the other text files that were not in `docs/readme.txt/*.txt`:\n\n## List of contributors\n\nThese are the contributors listed in the text files that are included with the 1.51 release of ZSNES, and on the zsnes.com webpage:\n\n* zsKnight\n* `_Demo_`\n* pagefault\n* Nach\n* grinvader\n* Deathlike2\n* Jonas Quinn\n* blargg\n* Pharos\n* teuf\n* relnev\n* prometheus\n* theoddone33\n* EvilTypeGuy\n* stainless\n* aaronl\n* MKendora\n* kode54\n* zinx\n* amit\n* Khan Artist\n* hpsolo\n* Kreed\n* Neviksti\n* ipher\n* relnev\n* StatMat\n* MKendora\n* hpsolo\n* aaronl\n* Diablo-D3\n* Wilbern Cobb\n* Thorsten \"mirabile\" Glaser\n* Mitchell \"The Khan Artist/Noxious Ninja\" Mebane\n\n## Additional info from the text files that came with ZSNES 1.51:\n\n### How OpenGL renders the SNES video buffer\n\nThe SNES video buffer has dimensions 288x224 (sometimes 288x239 for\ncertain games; however I have not come across any). The first 16 and last\n16 column of pixels are not displayed (perhaps used as a scrolling\nbuffer?), so the only important part of the video buffer is the middle\n256x224 pixels. The SNES video buffer pointer is vidbuffer. With OpenGL,\nonly the visible 256x224 pixels are needed and they are cropped into\nglvidbuffer. glvidbuffer is then turned into a texture that gets bound to\na QUAD whose size depends on whether ZSNES uses aspect ratio to display\neach frame.\n\n### Hi-res filters with OpenGL\n\nThe video mode selection is taken care of by SDL, including full\nscreen mode. The current code does not allow for many hi-res filter\noptions. While it is not difficult to implement the hi-res features using\nthe current filtering code (in `copyvwin.asm`), it appears that the code for\n`copy640x480x16bwin()` causes memory corruption and sometimes segfaults when\nyou exit ZSNES. For this reason, the filters have been left out. You can,\nhowever, add it in yourself by:\n\n1. Allocating enough memory space for `glvidbuffer` (use `realloc`)\n2. Assign `glvidbuffer` to the destination pointer SurfBufD (instead of `surface-\u003epixels`)\n3. Setting `Temp1` to `surface-\u003epitch`, i.e. `Temp1 = 2*SurfaceX`\n4. Calling `copy640x480x16bwin()`\n5. Correctly binding the glvidbuffer as a texture to a QUAD\n\n### Known issues and some work-arounds\n\n* After many video mode switches (all windowed), switching to full screen then back to window mode cases an SDL parachute exit; try not to use too many video mode changes, and restart ZSNES every once in a while if you are just testing out video modes.\n\n* Segfault after having compiled the source -- this might be due to an old `zguicfg.dat` file; delete this and see if the problem gets fixed.\n\n### File list\n\n```\n; Porting Routine Files\n\n-DOS-\nZLOADER.C       ; Start-up C routines for DOS (Commandline parser, etc.)\nDOSINTRF.ASM    ; DOS Interface routines (File,video,timers,etc.)\n\n-WINDOWS-\nZLOADERW.C      ; Start-up C routines for Windows (Commandline parser, etc.)\nWinintrf.asm    ; Windows Interface routines (File,video,timers,etc.)\nwinlink.cpp     ; Win32 routines (DirectX, Win32 functions)\ncopyvwin.asm    ; Video Blitter for D modes\n\n-LINUX-\ncopyvwin.asm    ; Video Blitter for D modes\ngl_draw.c       ; OpenGL routines for drawing the video buffer\ngl_draw.h       ;\nprotect.c       ;\nsdllink.c       ; SDL routines (video, input, sound init)\nsdlintrf.asm    ; Interface routines\nsw_draw.c       ; Software (via SDL) drawing routines\nsw_draw.h       ;\nzfilew.c        ;\nzipxw.c         ;\nzloaderw.c      ;\n\n-MAN-\nzsnes.1         ; man page for zsnes\n\n; ----------------------------------------------------------------\n; The following are generally compiled for both ports, but they\n; are not necessarily used by both\n; ----------------------------------------------------------------\n\n; General Stuff\nMACROS.MAC      ; Global Macro file (NEWSYM/EXTSYM global var control macros)\nUI.ASM          ; Start-up/initialization routines (env variables, cfg\n                ; loader, memory allocation, etc.)\nINIT.ASM        ; Emulation initialization routines (eg. memory map, emu\n                ; variables, etc.)\nCFGLOAD.ASM     ; ZSNES.CFG/ZSNESW.CFG file loading/parsing routines\nPROCVID.ASM     ; In-game video initialization/text displays/mouse routines/\n                ; 8-bit palette/F3 menu routines\nTABLE.ASM       ; Generates the SNES CPU tables (but in an inefficient way)\nTABLEB.ASM\nTABLEC.ASM\nSTABLE.ASM\nVCACHE.ASM      ; Performs tile caching and also vframe initialization stuff\nMENU.ASM        ; F1 Menu routines\nENDMEM.ASM      ; Where those large arrays go\nZFILE.C         ; File Access Routines\nGBLHDR.H        ; Global Header Stuff\n\n; ZSNES GUI Stuff\nGUI.ASM         ; Main GUI file\nGUITOOLS.INC    ; Simple tools for the GUI\nGUIWINDP.INC    ; GUI Window Display Routines\nGUINETPL INC    ; GUI Netplay Routines\nGUILOAD  INC    ; GUI File Load Routines\nGUIKEYS  INC    ; GUI Keyboard Input Routines\nGUIMOUSE INC    ; GUI Mouse Input Routines\nGUICHEAT INC    ; GUI Cheat Code Routines (search + regular codes)\nGUICOMBO INC    ; GUI Key Combo Routines\nGUIMISC  INC    ; Misc GUI Stuff (Movie, Joystick setting (display) routines,\n                ; SNES Reset Function\n\n; DOS Specific stuff\nVESA2.ASM       ; VESA2 DOS Routines\nVESA12.ASM      ; VESA1.2 DOS Routines\nZSIPX.ASM       ; IPX routines (DOS)\nJOY.ASM         ; DOS Joystick Drivers\nCOPYVID.INC     ; Graphics blitter routines for DOS (copys screen to display)\nINITVID.ASM     ; Video Initialization routines (DOS)\nDEBUG.ASM       ; SNES Debugger routines\nSW.ASM          ; Sidewinder routines\nSW32.ASM        ; More Sidewinder routines (not sure which file is the real\n                ;   one)\nGPPRO.ASM       ; Gamepad Pro routines (non-USB)\nMODEMRTN.ASM    ; DOS Modem routines\n\n; Graphics Enhancers\n2XSAIMMX.INC    ; Kreed's 2xSaI routines\n2xSaI.cpp       ; Kreed's Super 2xSaI routines\n2xsaiw.asm      ; 2xSaI for windows (without selector usage)\nwater.c         ; Water Effect\n\n; SNES CPU Emulation routines\nexecute.asm     ; Main emulation execution loop routines (includes save\n                ;   states and in-game netplay routines)\nSPC700.ASM      ; SNES SPC700 Sound CPU emulation routine files\nSPCADDR.INC\nSPCDEF.INC\nDSPPROC.ASM     ; SNES Digital Sound Processor main emulation routines\nDSP.ASM         ; SNES Digital Sound Processor register routines\nDMA.ASM         ; SNES PPU DMA/HDMA routines\nIRQ.ASM         ; SNES 65816 IRQ routines (VIRQ/NMI)\nMEMORY.ASM      ; SNES Memory access routines + C4 routines (Sorry that I\n                ;   didn't have these in a separate file since a small memory\n                ;   hack of the C4 originated on this file and just grew and\n                ;   grew)\nE65816.INC      ; 65816 emulation routines (w/o SPC700)\n65816D.INC\nE65816B.INC     ; 65816 emulation routines (Debugger I think)\n65816DB.INC\nE65816C.INC     ; 65816 emulation routines (w/ SPC700) - Sorry about these\n                ;   3 files.  They used to be just 1 until I removed the\n                ;   self-modifying code routines\n65816DC.INC\nSE65816.INC     ; 65816 emulation routines (SA-1)\nS65816D.INC\nADDRNI.ASM      ; 65816 Non-incrementing addressing modes\nADDRNI.INC\nSADDRNI.INC\nADDRESS.INC     ; 65816 Incrementing addressing modes\nADDRESS2.INC\nSADDRESS.INC\nREGS.INC        ; SNES I/O register emulation\nREGS.MAC\nREGSW.INC\nREGSW.MAC\n\n; SNES PPU Emulation Routines\nMAKEVID.ASM     ; 8-bit old graphics engine\nMAKEV16B.ASM    ; 16-bit old graphics engine\nMAKEV16T.ASM    ; 16-bit old graphics engine (transparencies)\nMV16TMS.ASM     ; 16-bit old graphics engine (transp w/ Main+Sub enabled)\nMODE7.ASM       ; 8-bit mode 7 routines\nMODE7.MAC\nMODE7EXT.ASM    ; 8-bit mode 7 EXTBG routines\nMODE716B.ASM    ; 16-bit mode 7 routines\nMODE716T.ASM    ; 16-bit mode 7 routines (transparencies)\nMODE716E.ASM    ; 16-bit mode 7 EXTBG routines\nM716TEXT.ASM    ; 16-bit mode 7 EXTBG routines (transparencies)\nMODE716D.ASM    ; 16-bit mode 7 Direct routines\nmode716.asm     ; Mode 7 16-bit new graphics engine routines\nmode716.mac\nNEWGFX.ASM      ; 8-bit new graphics engine files\nNEWGFX.MAC\nNEWGFX2.ASM\nNEWGFX2.MAC\nNEWGFXB.MAC\nNEWGFXWN.MAC\nnewgfx16.asm    ; 16-bit new graphics engine files\nnewgfx16.mac\nNEWG162.ASM\nnewg162.mac\nNEWG163.MAC\nNEWG16WN.MAC\nVIDMACRO.MAC    ; Generic Video Macros File\nVIDMACRB.MAC\n\n; Special Chip Emulation Routines\nFXEMU2.ASM      ; Super FX emulation files\nFXEMU2.MAC\nFXEMU2B.ASM\nFXEMU2B.MAC\nFXEMU2C.ASM\nFXEMU2C.MAC\nFXTABLE.ASM\nSFXPROC.ASM\nDSP1PROC.ASM    ; DSP1 communication routines\nDSP1EMU.C       ; DSP1 C routines (also includes some C4 C routines)\nSA1PROC.ASM     ; SA-1 processing routinest\nSA1REGS.ASM     ; SA-1 registers, also includes S-DD1 and SPC7110 routines\n```\n\n### Issues\n\n#### All ports\n\n- Recode netplay feature, once core is not random anymore.\n\n#### SDL Port\n\n- Low performance due to differences in surface sizes (internal and SDL), make both the same size.\n- OpenGL code is awful, incomprehensible, stupid and awful again. We must fix it.\n- Support overscan in games like *Dragon Quest 5*\n\n#### Windows port\n\n- OpenGL, or Direct3D support would be nice (we have the source for OpenGL but it needs to be integrated into the main tree, any takers?)\n- Windows port should be converted to Direct3D from DirectDraw 7.0.\n- Windows sound code needs to be rewritten to reflect the SDL port.\n\n#### Compatibility\n\n- Games not working:\n  - *Guikuden 1*\n  - *Cu-On-Pa*\n  - Loads more\n- Graphics Glitches:\n  - *Killer Instinct* (black background)\n  - *Final Fantasy III* (known as *Final Fantasy VI* in Japan; Range Time Over and other sprite trouble)\n  - *Tactic Ogre* (Menus)\n  - Lots of others\n- Special Chips:\n  - DSP1 (99% done)\n  - DSP3 (50% done)\n  - DSP4 (99% done)\n  - SA-1 (95% done)\n  - SPC7110 (Needs decompression)\n  - SFX1/2 (95% done)\n  - Seta 11 (25% done)\n  - Seta 18 (1% done)\n  - BS-X (50% done)\n\n#### Timing engine\n\n- Convert counter to 32-bit. (assigned to pagefault).\n- Fix 65816 timing and take into consideration cycle differences in 8/16-bit mode, branches etc.\n\n#### Graphics Engine\n\n- Fix some windowing/sub-screen sprite problems that are still present in the new graphics engine. Probably pagefault will have to do this.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxyproto%2Fzsnes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxyproto%2Fzsnes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxyproto%2Fzsnes/lists"}