Snes9X v0.131 Released 16th August 1997 -------------------------------------- Main Authors ------------ Gary Henderson (gary@daniver.demon.co.uk) Jerremy Koot a.k.a. The Teacher (jkoot@euronet.nl) Platform Porters ---------------- Chad Kitching a.k.a. Trepalium (kitchingc@mail.techplus.com) John Stiles (jstiles@uclink4.berkeley.edu) Richard Bannister a.k.a. SlimyBeer (titan@indigo.ie) Brain Verre (wverre@execpc.com) Jeremy Shear (jeremy@netzone.com) Michael Bytnar (m-bytnar@uiuc.edu) Andre Horstmann (andre.horstmann@mail-com.net) Assembly Team ------------- MrGrim (do@not.ask) Paradox Productions (do@not.ask) Contents -------- Introduction Key Features What's New What's Missing What You Will Need Getting Started/Command Line Options Keyboard Controls Joystick Support Linux S-VGA Full-Screen Mode Problems With ROMs Sound Problems Converting ROM Images Speeding up the Emulation Credits Introduction ------------ This is a freeware Super Nintendo Entertainment System (SNES) emulator for Linux i386, MS-DOS, Win32 and Sun Solaris Sparc featuring work-in-progress 16-bit, digital stereo sound on all ports. It is written by Gary Henderson and Jerremy Koot. Snes9X is coded in C++ with an assembler CPU emulation core on the Linux and MS-DOS ports. Currently the graphics code and sound is being rewritten in assembler. It is a spare-time project being written primarily by Gary Henderson, and Jerremy Koot. Several other people on the Snes9x team are currently porting Snes9x to other platforms/operating systems. This port is now being managed by me, Chad Kitching. Previously this port was handled by Gary Henderson. I hope you enjoy this version, there have been some changes to it. The SNES is a much more complex beast to emulate than say the NES. It has a more complex main CPU, clocked twice as fast the NES, that can address more memory and larger ROM images. It has four background layers compared to the one on the NES, each of which can display up to 256 colours at once compared to 32 on the NES. It has twice as many sprites as the NES, each of which can be twice as large as those on the NES and interleaved between background layers. It has more DMA channels, raster H-DMA effects, another CPU purely for sound and almost twice as many sound channels - each of which plays compressed sound samples rather than simple square or triangle waves and each sound channel has hardware volume envelopes. The SNES also has transparency effects (not emulated yet) that pushes up the possible number of colours on the screen to 32768 and the chances of emulating all these features on a low-end Pentium to zero. Your choice of SNES emulators is improving: Snes9x (this emulator) has good compatibility, is fast (with sound disabled), and has several visual effects emulated that no other emulator implements but sound emulation currently requires a fast machine to run at acceptable frame skip rate, NLKSNES is the fastest emulator but has many missing features compared to Snes9x, is currently silent and ROM compatibility is not all that it could be, and finally ESNES, which supports sound and is quite fast, but currently lacks in ROM support because of the new assembly engine - its the one to watch in my opinion as the "rival" to Snes9x. In case you were worried, Gary's foot has healed somewhat, so he can continue developing snes9x. Key Features ------------ o 16-bit, digital stereo sound on all ports. A large number of ROMs work with sound enabled, but some suffer from problems ranging notes being played for longer than they should to almost random noise output or silence. Sound emulation work is continuing. o Two screen refresh methods, an accurate, but slower mode and a much faster tile-based mode but only works well with some ROMs. o Multiple screen mode supported on the Linux S-VGA and MS-DOS ports. o Simultaneous two SNES joy-pad emulation allowing two player games to be played. o Lots of ROMs work, the numbers are increasing with each release (slowly). o Support for one 2, 4 or 6 button joystick or two 2-button joysticks - Linux and MS-DOS ports only. o Speed, with a 100% assembler CPU emulation core on Linux and MS-DOS ports - it very fast without sound enabled - especially if the tile-based redraw code is used. o Snapshot a game in progress and restore the game to that exact point at a later time. Sound state is now also saved. o Complete, fast mode 7 emulation (screen rotation and scaling) - all except one rarely used feature. o Complete H-DMA emulation for those split screen and wavy background effects. o Background clip windows for those H-DMA zoom effects. o Variable CPU cycles length as on the real SNES, for fast and slow ROM emulation. o Partial mosaic effect. o Compressed and/or split ROM image support. o SNES image scaling. o 8-bit, 16-bit and 24-bit X11 server support. o An uncrackable binary - mainly because it has no protection to crack such as time limits, limited colours, etc., etc. and never will. What's New ---------- Snes9X v0.131 DOS ----------------- - Appologies to everyone who tried the last version out. I tried to reach a deadline I couldn't meet. And that was the result. Huge bugs in the documentation and the program. I guess I was a bit too excited about doing the dos port. =( - Fixed SRAM, 8-bit sound, and -m 3 bugs. - Recompiled it in PGCC 0628 instead of 0725, because 0628 compiles a faster version. (Stupid me, thinking the latest release would be better) - Added MrGrim's timer code to replace allegros. Very little difference, except MrGrim's is a bit more accurate, and less bulky. - Added scanlines mode to -m 3. - Palette is properly restored after return from F2/F3. Snes9X v0.13 DOS ---------------- - Bug fixes to the SPC and sound generation routines - Tweaked the timer routines to run slightly faster - Modified screen modes, and added a new faster screen mode (-m 3) - Supports scanlines (only one video mode right now) - Faster palette updating. - DOS port maintained by Chad Kitching, now. Snes9X v0.12 ------------ - Auto-frame rate adjust to keep a constant game and music speed - idea from Bloodlust (thanks). - Sound state now saved and restored in snapshot files. - Pro Action Reply, Game Genie(TM) and Gold Finger cheat code support. - Added long name forms of all the command line switches. - Added option to disable a few "internal" speed up hacks that caused problems for some games with sound enabled - e.g. Super Off Road Racing. - Sound code rewritten to help support a group of ROMs that spool sound data between the two the CPUs in real-time, although I'm still having timing problems with these ROMs. - Fixed memory locking problem on the MS-DOS port. It was effectively preventing virtual memory from working, causing problems for people with limited RAM. - A few more sound fixes. - Speed ups to the tile-based redraw code. Snes9X v0.1 ----------- - Sound support on all ports. - The name has changed! - Multiple SPC700 CPU emulation fixes and several sound DSP fixes - many more ROMs work with sound enabled. - Added fix for ROMs that re-use sprites during the same frame. - Fixed bug I accidentally added to Allegro keyboard scanning code - now no more lock ups when Caps-lock or Pause pressed on DOS port. - Documented some extra keys and command line options that have always been there. - Asm CPU core speed ups. - Minor bug fix that helps Final Fantasy 3. - Added code to help some games that use sub-screen addition/subtraction. The lack of sub-screen addition/subtraction shows itself as background 'priority' problems - now you don't have to toggle background layers on and off so often just to see hidden text, characters, or maps, etc. Use -L to enable. Toggle with '8' during a game to see if it makes a difference. Acts as a good intermediate solution until sub-screen addition/subtraction is actually implemented in a future release. - Made several bug fixes to the old, but faster tile-based drawing code (enabled by pressing '9') - now several more ROMs work with it enabled. - Modified sound skipper code - helps several ROMs that previously didn't work with the current selection of APU skippers. - Improved sound mixing code so volume is not attenuated so much, giving better results on 8bit sound cards. - Changed the frequency at which the joystick polling routine is called - now called every-other frame rather than every 3rd frame. - Recompiled Linux and DOS ports with the Pentium optimising version of gcc - gives a few percent speed increase (on a Pentium processor). - Fixed sprite priority bug with Mode 7 - apparently Final Fantasy 3 needs this. - Fixed a screen clipping problem with the Linux S-VGA mode. - Fixed bug that had crept in with -m 2 Linux S-VGA mode. - Fixed S-VGA Linux version with sound enabled. - Fixed #define problem that was stopping DOS snapshot saving from working. What's Missing -------------- Sub-screen addition and subtraction (used for transparency effects), offset change mode (no idea what its used for), sound pitch modulation and echo effects and pseudo 512 horizontal pixel mode. Also, colour palette changes during the frame are not emulated correctly. A couple of other odd features that no ROMs seem to use are also missing: direct colour output and interlaced display. Some ROM cartridges contained additional hardware such as the SuperFX chip (a 16MHz RISC processor) or DSP chip, neither of these chips are emulated at the moment so games that use them like Mario Kart, DOOM, Yoshi's Island, etc. don't work. What You Will Need ------------------ You will need a Pentium-class PC or higher running Linux, MS-DOS or Windows 95. Machines running MS-DOS will need at least 8Mb of RAM while machines running Linux or Windows 95 will need at least 16Mb of RAM. Access to SNES ROM images in *.smc, *.sfc, *.fig or *.1, *.2, or sf32xxxa, sf32xxxb, etc., format will also help otherwise you will have nothing to run! Several public domain images are available from: http://www.rollanet.org/~khigh/emulator.htm Some freeware ROM images are available via the Internet, try following links from: ftp://ftp.futureone.com/users/damftp/consoles/SNES/ http://evil.ml.org/~grits Please note, it is illegal in most countries to have commercial ROM images without also owning the actual SNES ROM cartridge. PLEASE DO NOT ASK JERREMY, GARY OR MYSELF FOR ROM IMAGES OR FOR INFORMATION ON WHERE TO GET MORE, WE DO NOT KNOW AND WILL IGNORE ALL SUCH E-MAILS OR, IF WE ARE HAVING A PARTICULARLY BAD DAY, FORWARD THE E-MAIL TO THE EMULATOR ABUSE DATABASE. Getting Started --------------- >From a shell or DOS session just type: snes9x -sound ROM images are normally loaded from the directory ./roms. This can be changed by specifying a pathname with the image name or setting the environment variable SNES96_ROM_DIR to point to a different directory. Snapshot files and S-RAM save files are normally read from and written to the ROM directory in the MS-DOS port. This can be changed by setting the environment variable SNES96_SNAPSHOT_DIR to point to a different drive/directory. Some command line flags are available: Sound options: -S or -sound (default: off) Enable sound CPU emulation and actual sound output. Also allows several ROMs to run that used to get stuck in sound down-load code. -stereo (default: mono) Enable stereo sound output (needs high-end Pentium-class machine) -r 0-7 or -soundquality 0-7 (default: 4) Sound playback rate/quality: 0 - disable sound, 1 - 8192, 2 - 11025, 3 - 16500, 4 - 22050 (default), 5 - 29300, 6 - 36600, 7 - 44000. Cheat options: -gg or -gamegenie Supply a Game Genie code for the current ROM. Up to 10 codes can be in affect at once. Game Genie codes for many SNES games are available from: http://game-genie.nvc.cc.ca.us/ -ar or -actionreplay Supply a Pro-Action Reply code for the current ROM. Up to 10 codes can be in affect at once. At the moment, codes which alter RAM do not work. -gf or -goldfinger Supply a Gold Finger code for the current ROM. Up to 10 codes can be in affect at once. Speed up/slow down options: (See "Speeding Up The Emulation") -f or -frameskip (default: auto-adjust) Set this value to deliberately fix the frame skip rate and disable auto- speed regulation. Use a larger value faster emulation but more jerky movement and a smaller value for smooth but slower screen updates. Use '+' and '-' keys to modify the value during a game if a value has been set and auto-speed regulation disabled. -h <0-200> or -cycles <0-200>(default: 100) Percentage of CPU cycles to execute per scan line, decrease value to increase emulation frame rate. Most ROMs work with a value of 85 or above. -O or -tileredraw Enable cached-tiled based screen redrawing method. Gives noticeable frame rate increase but many ROMs can exhibit slight to severer screen redisplay problems when using this method, which is why it is not the default. -j or -nojoy Turn off automatic joystick detection (joystick polling on the PC slows the emulator down). MS-DOS: -m <0-8> or -mode <0-8> (default: 0) Screen mode/resolution (try -m 2) 0 - 320x240 ModeX, 1 - 320x200 VGA, 2 - 256x256 Non-standard VGA, 3 - 272x240 Tweaked, 4 - 640x480 Auto-detect, 5 - 640x480 VESA1 6 - 640x480 VESA2 Linear, 7 - 640x400 Extended, 8 - 800x600 Auto-detect. -scale (default: no scale) Scale SNES image to fit screen resolution. -scanline Turns on a scanlines video mode (small black lines between scanlines, like on a real TV). Currently only works for -m 2 and 3. ROM image format options: -i or -interleaved (default: auto-detect 32Mbit ROM images) Inform emulator ROM image is in interleaved format. -FH or -F or -forcehirom (default: auto-detect) Force Hi-ROM memory map for ROMs where the Hi-ROM header test fails. -FL or -forcelorom (default: auto-detect) Force Lo-ROM memory map for ROMs where the Hi-ROM header test fails, e.g Micro Machines, Pacman. -o or -old (default: disabled) Enable old-style joy-pad emulation (required by a few ROMs, e.g. Super Bomber man 1, Star Wars trilogy) -p or -pal (default: auto-detect) Fool ROM into thinking this is a PAL SNES system. -n or -ntsc (default: auto-detect) Fool ROM into thinking this is a NTSC SNES system. -ss <0-3> or -soundskip <0-3> (default: 0) SPC-700 skip wait method - NOT USED IF SOUND IS ENABLED. Use 1 for Metroid 3 and Animatics, and 3 for NBA Live 96. -L or -layering (default: off) Swap background layer priorities from background involved in sub-screen addition/subtraction. Can improve some games playability - no need to constantly toggle background layers on and off to read text/see maps, etc. Toggle feature on and off during game by pressing '8'. -l or -loadsnapshot Load snapshot file and required ROM image and restart game from saved position. -H or -nohdma (default: H-DMA enabled) Turn off the H-DMA emulation. Pressing '0' during a game toggles H-DMA on and off. Only use if H-DMA causes a problem for a game (it shouldn't). -N or -nospeedhacks (default: speed hacks) Turn off a couple of speed hacks. The hacks boost the speed of many ROMs with sound enabled but cause problems a few ROMs, e.g. Super Off-Road Racer. Joystick options: -4 or -four (default: auto-detect two-button joystick) Joystick connected to computer has 4 buttons. -6 or -six (default: auto-detect two-button joystick) Joystick connected to computer has 6 buttons. -s or -swap Swap emulated joy-pad 1 and 2 around, pressing '6' during a game does the same thing. -j or -nojoy Turn off automatic joystick detection (joystick polling on the PC slows the emulator down). For example, to start a game called "mario", with sound, tile-based redrawing and 256x256 graphics mode, type: snes9x -sound -mode 2 -tileredraw mario.smc Keyboard Controls ----------------- While the emulator is running: 'Escape' Quit the emulator 'Pause' or 'Scroll Lock' Pause the emulator Joy-pad 1: 'up' or 'u' Up direction 'down', 'j' or 'n' Down direction 'left' or 'h' Left direction 'right' or 'k' Right direction 'a', 'v' or 'q' TL button 'z', 'b' or 'w' TR button 's', 'm' or 'e' X button 'x', ',' or 'r' Y button 'd', '.' or 't' A button 'c', '/' or 'y' B button 'Left Control' or 'Left Meta' Start button 'Left Shift' Select button Joy-pad 2: 'Keypad 8' Up direction 'Keypad 2' Down direction 'Keypad 6' Left direction 'Keypad 4' Right direction 'Insert' TL button 'Delete' TR button 'Home' X button 'End' Y button 'Page Up' A button 'Page Down' B button 'Right Control' or 'Right Meta' Start button 'Right Shift' Select button '0' Toggle H-DMA emulation on/off. '1' Toggle background 1 on/off (useful for speeding up the '2' Toggle background 2 on/off emulation and for ROMs '3' Toggle background 3 on/off that use colour addition in '4' Toggle background 4 on/off a certain way, e.g. Zelda) '5' Toggle sprites (OBJs) on/off '6' Toggle swapping of joy-pad one and two around '8' Toggle background layer priorities for backgrounds involved in sub-screen addition/subtraction. '9' Toggle old, cached-tiled based screen redrawing method on/off. Gives noticeable speed increase but many ROMs can exhibit slight to severer screen redisplay problems. '-' Decrease frame redraw skip rate '+' Increase frame redraw skip rate (The above two options only operate if auto-speed regulation has been disabled by setting the frame skip on the command line). 'F2' Load a game's saved position 'F3' Save a game's position 'F4' -> 'F11' Toggle sound channels on/off 'F12' Turn on all sound channels. Joystick Support ---------------- The Linux and MS-DOS ports of Snes9X supports one or two 2-button joysticks, or one 4-button or 6-button joystick - this limitation is imposed by PC hardware. Gravis GRIP devices are not currently supported by the MS-DOS port. If someone has information on how to access these devices, I would appreciate it if you could e-mail to me. On a 2-button joystick only the A and B SNES buttons are available, the remaining 4 can still be accessed via the keyboard. The following diagram showing you the button layout for 6-button PC joy-pads that look similar to real SNES joy-pads: ---TL--- ---TR--- ^ X | <- -> Y A | / / v B Make sure the joystick is centred or no buttons pressed for joy-pads when the emulator is first started to enable auto-calibration to work. For DOS users who want to use GRIP keyboard emulation support, use the -j command line option to disable automatic joystick detection. Problems With ROMs ------------------ If the emulator just displays a black screen for over 10 seconds then one of the following could be true: 1) The ROM image is corrupt. More likely is the ROM image is in interleaved format; use the -i command line flag to tell the emulator it is in this format. 2) Some ROMs have a bad ROM header, mostly home-brewed SNES games or hacked commercial games. Snes9X cannot then detect if it is a Lo-ROM or Hi-ROM game and just guesses. You might have to use the -F to force Hi-ROM or -FL to force Lo-ROM to help it out. 3) The ROM is in a loop waiting for the Sound CPU to respond with a particular value and the sound wait skip code in the emulator hasn't spotted the fact. Try using a different -ss command line option value in the range 0 to 3. You could also try the -S command line flag which enables the SPC700 emulation. This allows several ROMs to continue that previously were stuck in sound down-load code. 4) The ROMs FAST ROM protection check has failed and the ROM has deliberately crashed itself. The only thing you could try is one of the utilities on the 'net that remove such protection. 5) You have set the -h command line value too low. 6) The original SNES ROM cartridge had additional hardware inside that is not emulated yet - this is true for all SuperFX games (DOOM, etc.) and DSP games (Mario Kart, Yoshi's Island, etc.). Some of the later ROMs (1994+) had additional hardware as a form of protection (Williams Arcade Classics, Clay Fighters II, etc.). There is nothing you can do about these games except patching the ROM or wait until I emulate the missing hardware, but this must be done individually, for each game. (Williams Arcade Classics is already supported). 7) The ROM image has found a CPU emulator instruction or memory map bug - please e-mail with name of ROM images that do this. Unfortunately, it is difficult to tell this problem from the protection failure problem described above without disassembling the ROM. If the game starts normally but refuses to go beyond the title screen try using the -o command line flag to enable old-style SNES joy-pad emulation or try pressing '6' in the emulator to swap joy-pads around; Mario All Stars swaps joy-pads around with old-style SNES joy-pad emulation enabled. If the ROM says "This game is not for your system" or something similar, try using the -p flag to force PAL mode or -n to force NTSC mode. Also, some ROMs use background colour addition (which isn't emulated yet) in such a way that is hides the character you are trying to control or important scenery; try toggling the background layers on and off with the keys 1 to 4 to see if you can find the background layer causing the problem and leave it switched off or try pressing '8' which changes the background priority levels for backgrounds involved in sub-screen addition/subtraction. Sound Problems -------------- If you are using the DOS port and you get no sound, check the following: - You have specified the -S or -sound command line option as sound output is not enabled by default and you will get no sound without it! - The ROM you are using is actually know to work with Snes9x with sound enabled - many hundreds of ROMs work with sound enabled but there is also a smaller number that hang or produce no sound. Try Super Mario World, Aladdin, The Donkey Kong County series or Chrono Trigger - they all work well with sound enabled. - Your sound card is a true Sound Blaster card or a 100% register level compatible card - if its not try using the Windows 95 port (if DirectX supports your card at 16bit, that is). - Your C:\autoexec.bat file sets up your BLASTER variable correctly - check the Snes9x home-page FAQ section for details. - If your card is plug and play, try running the emulator under a Windows 95 DOS session - the Windows 95 drivers will make sure the sound card hardware is correctly initialised. Converting ROM Images --------------------- If you have a ROM image in several pieces, simply rename them so their filename extensions are numbered: e.g. game.1, game.2, etc. Then, when loading the ROM image, just specify the name of the first part; the remaining parts will be loaded automatically. If they are already in the form sf32xxxa, sf32xxxb, etc., you don't even have to rename them; just specify the name of the first part, as above. Speeding up the Emulation ------------------------- Try the following command line flags: -f or -frameskip (default auto-adjust) Set this value to deliberately fix the frame skip rate and disable auto- speed regulation. Use a larger value for faster emulation but more jerky movement and a smaller value for smooth but slower screen updates. Use '+' and '-' keys to modify the value during a game if a value has been set and auto-adjust disabled. -ft or -frametime (default: 20) If auto-speed regulation is in effect, this value is used as the time, in milliseconds, that an emulated frame should take. The frame skip rate is automatically adjusted or the CPU paused to try and maintain this target. 486 and low-end Pentium machines might never be able to hit the default 20ms target with sound enabled, so you might want to increase this value to maintain a constant, but slower game speed. Under Linux and Solaris this value is limited to next greater 10ms value, under a DOS session on Windows 95 the value is limited to the nearest 5ms and under pure DOS the value is the actual millisecond value specified. -O or -tileredraw (default: line-by-line drawing) Enable cached-tile based screen redraw code. Pressing '9' during a game also toggles this redraw method on and off. It gives a very noticeable frame rate increase but can cause severer screen redisplay problems on some ROMs, which was why isn't not the default. However, it might make all the difference for people with slower machines. On the DOS port, use this option to play Zombies Ate my Neighbours without graphics corruption. -h or -cycles (default: 100) Lowering this value will increase the frame rate but setting the value too low can cause problems from some ROMs because not enough CPU instructions are being executed per frame as the ROM expects and can actually slow down a game! Most games work with a value of 85 or above. -m or -mode (default: 0) Some screen modes allow faster screen update than others, try -m 2 or -m 3 to see if the faster, non-mode X VGA mode is compatible with your system. MS-DOS users could try -m 4 or higher to try one of the VESA screen modes. -j or -nojoy (default: auto-detect) Disable automatic joystick detection. Reading joystick values on a PC takes a relatively long time. If you have a joystick attached to your computer that you are not using, use this option to stop the joystick from being polled. DOS users should make sure they have a good DOS graphics card. For example, Snes9X runs almost as fast on my P100 desktop machine as it does on my P166 laptop; the reason being CPU write access speed to the graphics memory on my laptop is a lot slower than on my desktop machine. If you are suffering from a slow write-access graphics card, use the Windows 95 port if possible as that will use hardware accelerated bit-blt, where available, to copy screen data into memory on the graphics card. Not enabling sound also speeds up the emulator because to get sound on an SNES another 2.5MHz CPU must be emulated together with the eight channel sound DSP and real-time sample decompression. If you must have sound, don't enable stereo output and also consider lowering the playback rate. Turning off some of the background layers by pressing '1' to '4' also speeds up the emulator. As always, you could try running the emulator on a faster machine/graphics card! Credits ------- Game Genie(TM), Gold Finger and Pro Action Replay cheat system information was obtained from DiskDude's SNES Kart v1.6 document. A great big thank you to Steve Snake for his insights into SNES sound sample decompression. Many thanks must go to Jerremy Koot (jkoot@euronet.nl) because without all his hard work on the original Snes96 and Snes97 Windows 95 versions, Snes9X would not exist in its current form. Thanks to Lee Hyde (lee@jlp1.demon.co.uk) for his quest for sound information and the Windows 95 icon. Thanks also to a person who shall remain nameless for his continuing quest for SNES information on my behalf (thanks to him, SuperFX emulation might be a reality one day). Also thanks to Jared Hoag for the graphics that will be used in the upcoming snes9x dos gui system. Get well soon, buddy. I would also like to thank Shawn Hargreaves (shawn@talula.demon.co.uk) for the Allegro library which made porting Snes9X relatively easy and my many beta testers - both official and unofficial! SNES is a trademark of Nintendo. Sun, Solaris and Sparc are trademarks of Sun Microsystems, Inc. MS-DOS and Windows 95 are trademarks of the MicroSoft Corporation. Game Genie is a trademark of Lewis Galoob Toys, Inc. All other trademarks are trademarks of their respective companies. ------------------------------------------------------------------------------ Chad Kitching (kitchingc@mail.techplus.com)