o add avrusb

o add zsnes
This commit is contained in:
optixx
2009-04-06 21:19:15 +02:00
parent c9a23df103
commit bcb4a055e9
449 changed files with 280735 additions and 0 deletions

11
zsnes/docs/README.LINUX Normal file
View File

@@ -0,0 +1,11 @@
This is the first release of the linux zsnes version, so don't expect it to be
perfect. Anyway, most of the feature of the windows version are already
implemented including windowed and fullscreen rendering, sound, joystick
support, zip support, ...
To use this version, you need to install SDL 1.2.0 (www.libsdl.org).
If you find any bug/missing feature in this version, please report it on the
zsnes-devel mailing list or on sourceforge bugtracker. Check
http://www.sourceforge.net/projects/zsnes for more information.
If you are using debian or ubuntu be sure to install libsdl-dev

9
zsnes/docs/README.SVN Normal file
View File

@@ -0,0 +1,9 @@
If you are using the SVN version of ZSNES, you will need to run the following
command directly after checkout out the repository:
sh autogen.sh
This will create the ./configure file that you need to run before compiling
ZSNES.
If you are not sure if you are using the SVN version, you are probably not.

41
zsnes/docs/authors.txt Normal file
View File

@@ -0,0 +1,41 @@
--------------
The ZSNES Team
--------------
zsKnight
_Demo_
pagefault
Nach
------------------
Assistant Coders
------------------
pharos
stainless
grinvader
Jonas Quinn
ipher
------------------
Additional Authors
------------------
teuf
relnev
prometheus
theoddone33
EvilTypeGuy
StatMat
MKendora
hpsolo
aaronl
Diablo-D3
-------------
Miscellaneous
-------------
Wilbern Cobb - initial OpenBSD work
Thorsten "mirabile" Glaser - more OpenBSD integration
Mitchell "The Khan Artist/Noxious Ninja" Mebane - manpage

183
zsnes/docs/install.txt Normal file
View File

@@ -0,0 +1,183 @@
Compiling the Source Code:
--------------------------
Well, for the moment, zsnes source may be a little hard to compile. Here
is a quick guide (based on my own experience and on a doc written by zsKnight)
explaining how to compile zsnes. With these tools, I can build both dos and
win version, I hope it will also work for you
Note to see the bottom of this document if you are compiling releases for
distribution as opposed to CVS/SVN/WIP for personal use.
First, you need the following software:
DOS port:
- NASM v0.98.39 or higher : http://nasm.sourceforge.net
- DJGPP v2.03 or higher, (GCC also installed) : http://www.delorie.com/djgpp/
using the zip picker, the default choices are ok if you
check C and C++ in the programming languages.
- zlib v1.2.3 or higher : http://www.zlib.net
- libpng : http://www.libpng.org/
Build the static versions of both of these libraries using
DJGPP and do a 'make install' to put them where DJGPP
can find them. Afterwards you can go ahead and delete
the source for them from your hard drive.
- PDCurses : http://pdcurses.sourceforge.net
Only needed if you compile with the debugger.
Then to build the executable, go to the src directory and type:
make -f makefile.ms PLATFORM=dos
You may also want to compress zsnes.exe with upx (http://upx.sourceforge.net),
it will divide its size by 10.
DOS port cross compiling:
-You need to get the DJGPP cross compiler and everything else mentioned above.
-You might need to edit makefile.ms and change
i386-pc-msdosdjgpp-gcc and i386-pc-msdosdjgpp-g++ to something else.
Then to build the executable, go to the src directory and type:
make -f makefile.ms PLATFORM=dos-cross
If you have any problems we will probably not help you as cross compiling
is an advanced feature only for people who know what they are doing.
Windows port with MSVC:
- GNU Make : http://unxutils.sourceforge.net/
- NASM v0.98.39 : http://nasm.sf.net/
- MSVC++ 6.0 or higher : not freely available, you'll have to buy it
You need to run VCVARS32.BAT. If you get an
out of environment space error, type 'command /e:32768'
(to create a new command.com entity with more
environment space)
I have been able to successfully build ZSNES using the
Intel C++ drop-in replacement for Microsoft's C++ compiler
that comes with MSVC++ 5 and above. Since ZSNES contains
relatively small amounts of C, I don't see how Intel's
compiler could provide any useful optimizations (maybe
for winlink.cpp?).
- DX8.0 SDK or higher : you can get it at microsoft.com. It is quite big.
Also, edit makefile.ms to set the correct path to your
SDK. I also had some problems with vc++ using its own
(old) directx headers instead of the sdk headers. I replaced
these old headers (in the include directory of vc++ dir)
with the newer ones.
- zlib v1.2.3 or higher : http://www.zlib.net
you need the Win9x/WinNT static library (the dll version
doesn't seem to work with zsnes). Rename the static version
to zlib.lib and put it somewhere where vc++ will find it
(for example, the lib directory in vc++ dir).
- libpng : http://www.libpng.org/
I'm not sure if the dynamically linked version of libpng
will work with ZSNES. To be safe I would recommend to just
go ahead and build the static version. Rename it to libpng.lib
and put it somewhere where MSVC++ will find it (usually the
lib subdirectory of your main MSVC++ directory).
- PDCurses : http://pdcurses.sourceforge.net
Then to build the executable, go to the src directory and type:
make -f makefile.ms PLATFORM=msvc
You may also want to compress zsnesw.exe with upx (http://upx.sourceforge.net),
it will divide its size by 10.
Windows port with MinGW:
- GNU Make (don't use included in mingw): http://unxutils.sourceforge.net/
- NASM v0.98.39 : http://nasm.sf.net/
- MinGW : http://www.mingw.org
- Latest Win32API : http://www.mingw.org
- DirectX 8+ for MinGW : Parts of it are included with Win32API, parts aren't.
Check http://www.talula.demon.co.uk/allegro/wip.html
and http://www.talula.demon.co.uk/allegro/wip.html
for the rest of DirectX for MinGW.
- zlib v1.2.3 or higher : http://www.zlib.net
- libpng : http://www.libpng.org/
- PDCurses : http://pdcurses.sourceforge.net
Only needed if you compile with the debugger.
Then to build the executable, go to the src directory and type:
make -f makefile.ms PLATFORM=win32
You may also want to compress zsnesw.exe with upx (http://upx.sourceforge.net),
it will divide its size by 10.
Windows port cross compiling:
-You need to get the MinGW cross compiler and everything else mentioned above.
-You might need to edit makefile.ms and change
i586-mingw32-gcc, i586-mingw32-g++, and i586-mingw32-windres
to something else.
Then to build the executable, go to the src directory and type:
make -f makefile.ms PLATFORM=win32-cross
If you have any problems we will probably not help you as cross compiling
is an advanced feature only for people who know what they are doing.
Linux/SDL/POSIX port:
I assume the standard development tools are installed (gcc, make, ...)
You'll also need :
- SDL (Simple DirectMedia Layer) : check www.libsdl.org to grab SDL 1.2.0 or
later. If you are using rpm packages, don't
forget the -devel package.
- NASM v0.98.39 : http://nasm.sf.net/
- zlib v1.2.3 or higher : http://www.zlib.net
it is probably already installed on your
system, maybe you are just missing the
development headers. Check in the
packages available with your distribution
or go to the page above
- libpng : http://www.libpng.org/
You might also need libpng, ZSNES will compile without
PNG support but I have found doing so to make ZSNES
unstable for some weird reason. If you don't have
libpng, either get it and install it or pass the
--without-png option to the 'configure' script.
- Curses/NCurses
Check your distro. One of these is needed if you compile with
the debugger enabled. You may also have to symlink ncurses.h
to curses.h in your include directory.
Then to build the executable, go to the src directory and type:
sh ./autogen.sh && gmake && gmake install
Note: This only covers SVN/WIP builds, for releases see instructions below.
Note: autogen.sh requires automake and autoconf installed. Any parse errors
you recieve about configure.in are due to those not being installed.
Note: you require root to install zsnes to the the default (/usr/local/*)
directory
Also Note: libpng (optional) needs to be recent, or zsnes will not use it
You may also want to compress the zsnes executable with upx
(http://upx.sourceforge.net), it will divide its size by 10.
Compiling for official builds:
Windows - MSVC: make -f makefile.ms PLATFORM=msvc RELEASE=yes
Windows - MinGW: make -f makefile.ms PLATFORM=win32 RELEASE=yes
DOS: make -f makefile.ms PLATFORM=dos RELEASE=yes
SDL - Package Maintainers: ./configure --enable-release --disable-cpucheck force_arch=i586
SDL - Personal: ./configure --enable-release
Note this is important to remove certain debug messages, as well
as provide heavy optimization (which could take up to an hour
to compile). It also ensures the builds will work with CPUs
matching i586 or higher.
If compiling for personal use, on DOS and Windows-MinGW, add
CPU=your_cpu, where your_cpu matches a GCC -march option.
You can use the archopt utility in tools/ to tell you what is
best. For SDL, remove --disable-cpucheck force_arch=i586.
If you are providing an SDL package for a particular arch
greater than i586, replace force_arch=i586 with the proper
one.

342
zsnes/docs/license.txt Normal file
View File

@@ -0,0 +1,342 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.

100
zsnes/docs/opengl.txt Normal file
View File

@@ -0,0 +1,100 @@
This document is no longer up-to-date, but is a good start to
understanding how the OpenGL code works for non-filtered modes.
-------------------------------------------------------------------------
OpenGL is currently only available on Linux and via CVS. For the most
part, it works and fairly stable. Please send all comments, suggestions,
and bug fixes to hpsolo@my-deja.com. DO NOT EMAIL THE OTHER DEVELOPERS
SINCE THEY ARE not INVOLVED WITH THIS CODE. And please make sure you've
read through the list of known issues before sending your bug report.
HOW OPENGL RENDERS THE SNES VIDEO BUFFER
The SNES video buffer has dimensions 288x224 (sometimes 288x239 for
certain games; however I have not come across any). The first 16 and last
16 column of pixels are not displayed (perhaps used as a scrolling
buffer?), so the only important part of the video buffer is the middle
256x224 pixels. The SNES video buffer pointer is vidbuffer. With OpenGL,
only the visible 256x224 pixels are needed and they are cropped into
glvidbuffer. glvidbuffer is then turned into a texture that gets bound to
a QUAD whose size depends on whether ZSNES uses aspect ratio to display
each frame.
HI-RES FILTERS WITH OPENGL
The video mode selection is taken care of by SDL, including full
screen mode. The current code does not allow for many hi-res filter
options. While it is not difficult to implement the hi-res features using
the current filtering code (in copyvwin.asm), it appears that the code for
copy640x480x16bwin() causes memory corruption and sometimes segfaults when
you exit ZSNES. For this reason, the filters have been left out. You can,
however, add it in yourself by:
1. allocating enough memory space for glvidbuffer (use realloc)
2. assign glvidbuffer to the destination pointer SurfBufD (instead of
surface->pixels)
3. setting Temp1 to surface->pitch, i.e. Temp1 = 2*SurfaceX
4. calling copy640x480x16bwin()
5. correctly binding the glvidbuffer as a texture to a QUAD
There is a old patch that enables these filters and it is located at:
http://www.students.uiuc.edu/~handuong/opengl.patch2
3DFX USERS (VOODOO2 AND OLDER HARDWARE)
Lord_Nightmare managed to get OpenGL to work on a Voodoo2. Some
things you'll need to do in order to get ZSNES OpenGL to work on your
Voodoo:
1. Make sure to have the latest Mesa drivers and compile it with
the following option:
make -f Makefile.X11 linux-386-glide
Voodoo2 users might want to use:
make -f Makefile.X11 linux-386-opt-glide
since that is optimized for Voodoo2 cards. According the the
XFree86 website, Voodoo3 users (and later) should have DRI
support via the tdfx driver so this might not be needed.
2. When you run ZSNES, make sure to set the environment variable
MESA_GLX_FX to either w or f (window/full screen). E.g. use
export MESA_GLX_FX=f
if you use a bash shell. Theoretically using the w option
should work, but it not only is slow (5fps) but seems
broken. Voodoo Rush users might be able to get by.
Note that only the 640x480 full screen mode works on the Voodoo2 cards
so please do not email me about the other video modes. Files which
might be useful to have before compiling anything:
Device3Dfx, Glide_SDK, Glide_V2 (or Glide_XXXX depending on your card)
I believe Glide 2 is what you want, as Glide 3 doesn't work for older
hardware. Also Device3Dfx may not be implemented the same way for 2.4.x
kernels.
KNOWN ISSUES (AND SOME WORK-AROUNDS)
- 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
- 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
TODO
- use something like SDL_GL_UpdateRects with hi-res filters
-- hpsolo --

4
zsnes/docs/readme.1st Normal file
View File

@@ -0,0 +1,4 @@
If you need help to compile ZSNES, read install.txt, or if you want a directory
to the sources, read srcinfo.txt. The offical website is at http://www.zsnes.com
and the sourceforge mirror is at http://zsnes.sourceforge.net/. The development chat is on
#zsnes on irc.freenode.net.

View File

@@ -0,0 +1,265 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>About - ZSNES Documentation</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="styles/print.css" media="print" type="text/css" />
<link rel="stylesheet" href="styles/radio.css" title="Radio's style" media="screen" type="text/css" />
<link rel="alternate stylesheet" href="styles/jipcy.css" title="Jipcy's style" media="screen" type="text/css" />
<link rel="alternate stylesheet" href="styles/plaintxt.css" title="Plain Text" media="screen" type="text/css" />
<link rel="contents" href="index.htm" title="Index" />
<link rel="start" href="readme.htm" title="Readme" />
<link rel="previous" href="history.htm" title="History" />
<link rel="next" href="license.htm" title="License" />
<link rel="help" href="support.htm" title="Getting Support" />
<link rel="copyright" href="license.htm" title="GNU General Public License" />
</head>
<body>
<div id="header">
<a href="readme.htm" title="ZSNES Documentation Home"><img id="logo" src="images/zsneslogo.png" alt="The ZSNES Logo" /></a>
<h1>ZSNES v1.51 Documentation</h1>
</div>
<div id="nav_column">
<div id="navigation">
<h2>Navigation</h2>
<ul class="navigation_list">
<li><a href="index.htm" title="ZSNES Documentation Index">Index</a></li>
<li><a href="readme.htm" title="General documentation">Readme</a></li>
<li><a href="gui.htm" title="Description of the GUI and its options">GUI</a></li>
<li><a href="netplay.htm" title="Documentation for Netplay">Netplay</a></li>
<li><a href="advanced.htm" title="Advanced Usage">Advanced Usage</a></li>
<li><a href="games.htm" title="Information about Games">Games</a></li>
<li><a href="faq.htm" title="Frequently Asked Questions">FAQ</a></li>
</ul>
<hr />
<ul>
<li><a href="support.htm" title="How to get support">Getting Support</a></li>
<li><a href="history.htm" title="The log of changes to ZSNES">History</a></li>
<li><a href="about.htm" title="A brief description of the ZSNES emulator and ZSNES documentation projects">About</a>
<ul>
<li><a href="#about_zsnes">ZSNES</a></li>
<li><a href="#about_docs">Documentation</a></li>
<li><a href="#credits">Credits</a></li>
</ul>
</li>
<li><a href="license.htm" title="GNU General Public License">License</a></li>
</ul>
<hr />
<ul>
<li><a href="http://zsnes-docs.sourceforge.net/nsrt" title="NSRT Guide">NSRT Guide</a></li>
<li><a href="http://www.zsnes.com" title="ZSNES Home Page on the Web">ZSNES.com</a></li>
</ul>
</div>
</div>
<div id="content_column">
<div id="content">
<h2>About</h2>
<div class="section" id="about_zsnes">
<h3>About ZSNES</h3>
<p>ZSNES is a SNES emulator that has been worked on since 1997. Originally programmed by zsKnight and _Demo_, the project has since then attracted a number of new developers and contributors.</p>
<p>On <a href="history.htm#source_release" title="ZSNES.com front page post about the source release">April 2, 2001</a>, the ZSNES project was GPL'ed and its source released to the public. Written in a mixture of x86 assembler, C, and C++, ZSNES currently runs on Windows, DOS, x86 versions of Linux and FreeBSD, x86 Macintosh computers, and the Microsoft Xbox.</p>
<div class="section" id="donations">
<h4>Donations</h4>
<p>If you enjoy using ZSNES to re-live and enhance your experiences with the Super Nintendo, please consider <strong>making a donation</strong> to support further development.</p>
<p>You have two options when making a donation. You can choose to make a donation through the ZSNES SourceForge Project Donation Page: <a href="http://sourceforge.net/donate/index.php?group_id=19677" title="Make a donation to ZSNES through SourceForge.net">Donate to ZSNES through SourceForge</a>.</p>
<p>Alternatively, you can send money to the ZSNES creator's PayPal account: <a href="http://www.zsnes.com/?page=donate" title="Make a donation directly to zsKnight, creator of ZSNES">Donate directly to zsKnight, creator of ZSNES</a>.</p>
</div>
</div>
<div class="section" id="about_docs">
<h3>About the Documentation</h3>
<p>The ZSNES Documentation Project was started by RichardC in an attempt to update and reorganize all of the ZSNES documentation into an easy to read, easy to access collection. It made its public debut upon the release of ZSNES v1.40. It is officially available in HTML, CHM, and text formats.</p>
<p>If you have any suggestions or corrections that you would like to submit, feel free to let us know at our forum on the <a href="http://board.zsnes.com" title="Official ZSNES Message Board">ZSNES Message Board</a>.</p>
<p>RichardC would like to give a special thanks to Nach and the ZSNES community for all the help and support that they have given to him and the project.</p>
</div>
<div class="section" id="credits">
<h3>Credits</h3>
<div class="section" id="credits_founding">
<h4>Founding Developers</h4>
<ul>
<li>zsKnight</li>
<li>_Demo_</li>
</ul>
</div>
<div class="section" id="credits_current">
<h4>Current / Active Developers</h4>
<ul>
<li><strong class="name">pagefault</strong> - primary core developer, primary Win port developer.</li>
<li><strong class="name">Nach</strong> - primary non-core developer, mostly works on significant back-end overhauling and large new features.</li>
<li><strong class="name">grinvader</strong> - primary ASM to C porter, primary Unix build maintainer, many GUI improvements and other, and power of no pants.</li>
<li><strong class="name">Jonas Quinn</strong> - primary bug fixer, also video code contributor.</li>
<li><strong class="name">ipher</strong> - ZSNES GUI expert, WIP distributor.</li>
<li><strong class="name">Deathlike2</strong> - minor feature adder, also an ASM to C porter.</li>
</ul>
</div>
<div class="section" id="credits_assistant">
<h4>Assistant Coders</h4>
<ul>
<li>hpsolo</li>
<li>Pharos</li>
<li>Siloh (a.k.a. Stainless, a.k.a. randilyn)</li>
<li>StatMan</li>
<li>teuf</li>
<li>theoddone33</li>
</ul>
</div>
<div class="section" id="credits_contributors">
<h4>Contributors (in alphabetical order)</h4>
<ul>
<li>aaronl</li>
<li>Aerdan</li>
<li>amit</li>
<li>anomie</li>
<li>BRPXQZME</li>
<li>byuu</li>
<li>Diablo-D3</li>
<li>EvilTypeGuy</li>
<li>hector</li>
<li>Khan Artist (a.k.a. Noxious Ninja)</li>
<li>kode54</li>
<li>Kreed</li>
<li>MaxSt</li>
<li>MKendora</li>
<li>Neviksti</li>
<li>Overload</li>
<li>prometheus</li>
<li>relnev</li>
<li>snes6502</li>
<li>TRAC</li>
<li>zinx</li>
</ul>
</div>
<div class="section" id="credits_documentation">
<h4>Documentation Writers/Contributors</h4>
<p>Contributors are listed loosely based on their dates of contribution.</p>
<ul>
<li><strong class="name">RichardC</strong> - founder of the ZSNES Documentation Project. First active administrator. He had the dirty job of doing the initial conversion of the docs into HTML.</li>
<li><strong class="name">Nach</strong> - programmer extraordinaire, and knows ZSNES very well. He helps a lot in documenting the obscure things we writers don't know about.</li>
<li><strong class="name">LDAWG</strong> - updated v1.40 changelog, based on a 2 year summary by Nach, as well as another 6 months of developer notes.</li>
<li><strong class="name">kevman</strong> - helped with the v1.40 FAQ updates.</li>
<li><strong class="name">xamenus</strong> - joined the project shortly after RichardC's initial release, and made many grammar fixes and updated the content. Combined the three separate, port-specific documentations into one. Still contributes some content from time to time.</li>
<li><strong class="name">Noxious Ninja</strong> - manpage expert. No longer active in the emulation "scene", he always had something useful to contribute.</li>
<li><strong class="name">Clements</strong> - maintainer of the CHM file. Also assists with coding and content.</li>
<li><strong class="name">AspiringSquire</strong> - designer and maintainer of the TXT version of the docs; occasionally contributes content. Also an expert with grammar and vocabulary corrections.</li>
<li><strong class="name">Jipcy</strong> - current active administrator and mark-up chief. Manages and contributes to all parts of the docs.</li>
<li><strong class="name">Jonas Quinn</strong> - mainly helps in super-optimizing the images.</li>
<li><strong class="name">Deathlike2</strong> - ZBoard tech help expert. Also makes many suggestions/corrections to the docs.</li>
</ul>
<p>Special thanks to <strong>Radio</strong>. He designed the ZSNES.com main page layout, from which we stole this design for the HTML docs. Also special thanks to <strong>Roman Rudenko</strong>, for finding the elusive "display:inline" fix for floated items in IE.</p>
<p>Also thanks to <a href="http://www.snescentral.com" title="Snes Central">SnesCentral</a> for providing some info!</p>
</div>
<div class="section" id="credits_thanks">
<h4>Thanks</h4>
<p>All ports of ZSNES use NASM v0.98+, GNU Make, zlib, libpng, and JMAlib to compile, link, compress, decompress, and execute.</p>
<p>In addition to the above, ZSNES Win uses Visual C++ 2003 (or MinGW), DirectX 8, UPX, and ManyMouse; ZSNES SDL uses GCC, SDL v1.20, and ManyMouse; and ZSNES DOS uses DJGPP, CWSDPMI, and UPX.</p>
<p>Thanks to those who produced these fine programs!</p>
<h5>Special Thanks to:</h5>
<ul>
<li>wnelson; without him, ZSNES would have never existed!</li>
<li>Y0SHi for his excellent SNES docs, his help, and his excellent support!</li>
<li>Ashley, Barubary, CyberWarriorX, DCX, DooMStalK, Fanwen, GreenImp, Hucard, Kaiden, PolestaR, Stalphos Knight, Star Creator, TeleKawaru, the people on the ZSNES IRC channel, and the regulars of the ZSNES message board!</li>
<li>All of our beta testers for being a great help!</li>
<li>The MAME team; info on 256x256x256 scanlines mode is from the MAME source!</li>
</ul>
<h5>Also Thanks to:</h5>
<ul>
<li>The_Teach of Snes9x for some great info and the nice chats!</li>
<li>Trepalium of Snes9x for some great info and help!</li>
<li>Gary of Snes9x and Steve Snake of Kega for being the source of info for sound decompression!</li>
<li>Gary of Snes9x for being the source of info for TCall/PCall and also for lots of help!</li>
<li>MrGrim for his great support!</li>
<li>Crono for info on Sound Blaster programming, surround sound, sound interpolation, and other sound stuff!</li>
<li>Aquis for the ZSNES logo!</li>
<li>Alucard for helping us with an issue in the 65816!</li>
<li>Vertigo for making a compatibility list!</li>
<li>EFX for being a great supporter and also giving a lot of help and stuff!</li>
<li>Zophar for being a great supporter and also maintaining the mirror site!</li>
<li>Chris Hickman for redesigning the ZSNES web page!</li>
<li><a href="http://www.csoft.net" title="Csoft.net Hosting">CSoft</a> for (previously) hosting our web page!</li>
<li>Marius Fodor for the code for VSync, Sidewinder, Gamepad Pro, and some optimization info!</li>
<li>Sardu for some great info and help!</li>
<li>Lord ESNES for some great help!</li>
<li>Robert Grubbs for the Sidewinder info!</li>
<li>Nerlaska for some useful info on optimizing and also for some help!</li>
<li>Diskdude for writing SNESkart which we used for the info on cheat codes!</li>
<li>DarkForce for some great help!</li>
<li>Pharos for some keyboard coding help!</li>
<li>Ivar and Gary of the Snes9x team for all their great help, which includes their SuperFX info and code, DSP-1 info, info on interleave formats (HiROM and SuperFX), offset per tile mode, FIR filter, and some insights on SPC700 and HDMA bugs!</li>
<li>WolfWings ShadowFlight for help on several issues of NASM!</li>
<li>Wildfire for some help!</li>
<li>A CoolMan for the algorithm for EAGLE!</li>
<li>Neill Corlett for some info on the .ips format and also helping out a lot on improving the sound engine!</li>
<li>Kreed for the 2xSaI and Super Eagle source codes!</li>
<li>Markus Oberhumer and Laszlo Molnar for the <a href="http://upx.sourceforge.net" title="UPX Home Page">UPX</a> compression utility.</li>
<li>Jean-loup Gailly, Mark Adler, and Gilles Vollant for the unzip routines!</li>
<li>kode54 for the low pass filter routines!</li>
<li>Andy Goth for some help on the design of the key combination engine!</li>
<li>Yamaha of XYZZ (Scott Scriven) for his water effect code.</li>
<li>ipher for compiling and releasing WIP builds!</li>
<li>cdbsi for the ZSNES icons!</li>
<li>The Dumper for lots of help with special chips.</li>
<li>snes6502 for the Xbox port!</li>
<li>hector and BRPXQZME for helping to port ZSNES to Mac OS X!</li>
<li>The <a href="support.htm#utilities_nsrt" title="NSRT Information">NSRT</a> Team, for their excellent utility, JMA compression, NSRT headers, and a great database!</li>
<li>All those people who contributed by either updating the docs, helping us, supporting us, or reporting bugs!</li>
</ul>
<p><strong>The <a href="history.htm" title="ZSNES History">changelog</a> contains innumerable credits to people for their contributions or individual fixes. Many of them are not listed on this page.</strong></p>
<p>Also thanks to all those whom we forgot!</p>
<p id="snes_emus">Also, good luck to all those who are writing emulators, especially those who are writing SNES emulators, including <a href="http://www.snes9x.com" title="Snes9X Home Page">Snes9x</a>, <a href="http://sneese.sourceforge.net/" title="SNEeSe Home Page">SNEeSe</a>, <a href="http://users.tpg.com.au/advlink/spx/" title="Super Sleuth Home Page">Super Sleuth</a>, and <a href="http://www.byuu.org/" title="byuu's Home Page">bsnes</a>!</p>
</div>
</div>
</div>
<div id="footer">
<h2>Footer</h2>
<p>This documentation is best viewed in a standards-compliant web browser, like <a href="http://www.mozilla.com" title="Mozilla Corporation home page">Firefox</a> or <a href="http://www.opera.com" title="Opera web browser home page">Opera</a>.</p>
<a href="http://sourceforge.net" title="SourceForge.net"><img style="border:0;width:88px;height:31px" src="http://sflogo.sourceforge.net/sflogo.php?group_id=127354&amp;type=1" alt="SourceForge.net Logo" /></a>
<a href="http://sourceforge.net/donate/index.php?group_id=19677" title="Donate to the ZSNES Project"><img style="border:0;width:88px;height:32px" src="http://images.sourceforge.net/images/project-support.jpg" alt="Support This Project" /> </a>
<span class="web_only">
<a href="http://validator.w3.org/check?uri=referer" title="Validate this page's HTML"><img style="border:0;width:88px;height:31px" src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0 Strict" /></a>
<a href="http://jigsaw.w3.org/css-validator/check/referer" title="Validate this page's CSS"><img style="border:0;width:88px;height:31px" src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!" /></a>
</span>
<p><a href="license.htm" title="View the General Public License">Copyright (C) ZSNES Team &amp; ZSNES Documentation Team</a></p>
</div>
</div>
</body>
</html>

View File

@@ -0,0 +1,827 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Advanced Usage - ZSNES Documentation</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="styles/print.css" media="print" type="text/css" />
<link rel="stylesheet" href="styles/radio.css" title="Radio's style" media="screen" type="text/css" />
<link rel="alternate stylesheet" href="styles/jipcy.css" title="Jipcy's style" media="screen" type="text/css" />
<link rel="alternate stylesheet" href="styles/plaintxt.css" title="Plain Text" media="screen" type="text/css" />
<link rel="contents" href="index.htm" title="Index" />
<link rel="start" href="readme.htm" title="Readme" />
<link rel="previous" href="netplay.htm" title="Netplay" />
<link rel="next" href="games.htm" title="Games" />
<link rel="help" href="support.htm" title="Getting Support" />
<link rel="copyright" href="license.htm" title="GNU General Public License" />
</head>
<body>
<div id="header">
<a href="readme.htm" title="ZSNES Documentation Home"><img id="logo" src="images/zsneslogo.png" alt="The ZSNES Logo" /></a>
<h1>ZSNES v1.51 Documentation</h1>
</div>
<div id="nav_column">
<div id="navigation">
<h2>Navigation</h2>
<ul class="navigation_list">
<li><a href="index.htm" title="ZSNES Documentation Index">Index</a></li>
<li><a href="readme.htm" title="General documentation">Readme</a></li>
<li><a href="gui.htm" title="Description of the GUI and its options">GUI</a></li>
<li><a href="netplay.htm" title="Documentation for Netplay">Netplay</a></li>
<li><a href="advanced.htm" title="Advanced Usage">Advanced Usage</a>
<ul>
<li><a href="#movie_dumping">Movie Dumping</a></li>
<li><a href="#config_files">Configuration Files</a></li>
<li><a href="#debugger">Debugger</a></li>
<li><a href="#kitchensync">KitchenSync</a></li>
<li><a href="#command_line">Command-Line</a></li>
</ul>
</li>
<li><a href="games.htm" title="Information about Games">Games</a></li>
<li><a href="faq.htm" title="Frequently Asked Questions">FAQ</a></li>
</ul>
<hr />
<ul>
<li><a href="support.htm" title="How to get support">Getting Support</a></li>
<li><a href="history.htm" title="The log of changes to ZSNES">History</a></li>
<li><a href="about.htm" title="A brief description of the ZSNES emulator and ZSNES documentation projects">About</a></li>
<li><a href="license.htm" title="GNU General Public License">License</a></li>
</ul>
<hr />
<ul>
<li><a href="http://zsnes-docs.sourceforge.net/nsrt" title="NSRT Guide">NSRT Guide</a></li>
<li><a href="http://www.zsnes.com" title="ZSNES Home Page on the Web">ZSNES.com</a></li>
</ul>
</div>
</div>
<div id="content_column">
<div id="content">
<h2>Advanced Usage</h2>
<div class="section">
<p>This page documents the advanced features of ZSNES, probably not useful for most end users.</p>
</div>
<div class="section" id="movie_dumping">
<h3>Movie Dumping</h3>
<p>Please note that ZSNES does not support real-time video encoding. ZSNES only encodes existing ZMV (ZSNES movie) files. Refer to <a href="gui.htm#misc_movie" title="Description of the Movie Options dialog">the GUI page</a> for instructions on recording movies.</p>
<p>All instructions in this section assume that you are using the default settings of the <code class="file">zmovie.cfg</code> file. If you are smart enough to edit <code class="file">zmovie.cfg</code>, you had better be smart enough to dump movies with whatever new settings you've created.</p>
<p>You can dump video output alone, audio output alone, both at the same time (to separate files), or both to the same file (merged). If you choose to dump audio output, you can choose to dump that audio output uncompressed or compressed to MP3. Both uncompressed and compressed audio can be merged with the video.</p>
<div class="section">
<h4>About Video Encoding</h4>
<p>Video encoding requires <a href="http://www.mplayerhq.hu" title="MPlayer/MEncoder Home Page">MEncoder</a>.</p>
</div>
<div class="section" id="movie_dumping_about_audio">
<h4>About Audio Encoding</h4>
<p>Audio encoding requires <a href="http://lame.sourceforge.net" title="LAME Home Page">LAME</a>. Currently, Windows users <strong>must</strong> use <a href="http://nsrt.edgeemu.com/lame.zip" title="Fixed LAME build for Windows required for ZSNES audio encoding">this fixed LAME build</a> due to a bug in the official versions.</p>
<p>You have a choice of dumping audio either in uncompressed PCM format with WAV header, or compressed as MP3. ZSNES uses <a href="http://lame.sourceforge.net" title="LAME Home Page">LAME</a> for MP3, so you can expect high-quality audio, given the bit rate.</p>
<p>When dumping audio to a separate file (not merged with video), audio compressed to MP3 will be about 6% of the size of the same uncompressed PCM audio.</p>
</div>
<div class="section">
<h4>Dumping a Movie</h4>
<ol>
<li>Place your MEncoder (<code class="file">mencoder.exe</code>) and LAME (<code class="file">lame.exe</code>) binaries in the same directory as ZSNES. Alternatively, configure your PATH environment variable to include the directories where MEncoder and LAME are installed.</li>
<li>Start ZSNES and <a href="gui.htm#game_load" title="Description of the Load Game dialog">load</a> a game.</li>
<li>Open the <a href="gui.htm#misc_movie" title="Description of the Movie Options dialog">Movie Options</a> dialog. (Misc Menu->Movie Opt).</li>
<li>Make sure to select the correct movie slot, depending on which movie slot you used to record a ZMV.</li>
<li>Select the <strong class="gui">Dumping</strong> tab, and configure the <strong class="gui">Video Options</strong> and <strong class="gui">Audio Options</strong> to your liking.</li>
<li>Hit the <strong class="gui">Start</strong> button.</li>
<li>ZSNES will then exit the GUI and start playing back the previously recorded movie. If you chose to encode the video and/or audio output, you will see a console window appear, showing the progress of encoding. Don't worry if ZSNES slows down while playing back the movie; it needs to do this because the encoding process takes a lot of processor time.</li>
<li>ZSNES will indicate when the movie has finished playback (and encoding). You can now look in your ZSNES directory for the newly created file(s).</li>
</ol>
<p><strong>Note:</strong> ZSNES does not create an uncompressed temporary file and then encode it. Instead, the output stream is directly encoded. The only output files will be the finished, compressed files. Because ZSNES must encode the output stream as it is generated, ZSNES may delay the output of new frames of video/audio to give more time to MEncoder/LAME to compress the current frame. This means that you <strong>should not worry</strong> if you see the playback of your movie slow down while ZSNES is dumping it. The dumped file(s) will play back at full speed!</p>
</div>
</div>
<div class="section" id="config_files">
<h3>Configuration Files</h3>
<p>Every time you run ZSNES, it checks to see if these files are present in the same directory as the ZSNES executable. If they are not, ZSNES will create them with their default values. Thus, if you are having weird problems with ZSNES, try deleting these files.</p>
<p>If there are any missing or invalid lines in <code class="file">zsnes*.cfg</code>, ZSNES will insert or replace the lines with their default values.</p>
<div class="section" id="config_files_zsnes">
<h4>zsnes*.cfg</h4>
<p>Almost every option available in ZSNES can be configured in this file. If there is something you don't understand in this file, please refrain from changing it, and instead set the option from within the ZSNES <a href="gui.htm" title="Description of the GUI">GUI</a>.</p>
<p>The last letter of the filename is different for each port. Windows: <code class="file">zsnesw.cfg</code>. SDL: <code class="file">zsnesl.cfg</code>. DOS: <code class="file">zsnes.cfg</code>.</p>
</div>
<div class="section" id="config_files_zmovie">
<h4>zmovie.cfg</h4>
<p>This file contains <a href="advanced.htm#movie_dumping" title="Description of the Movie dumping feature">movie-dumping</a> configuration information.</p>
<p>You can edit this file to make ZSNES use something other than MEncoder or LAME, or to tweak options. Read the MEncoder and LAME manuals to see what options you can tweak. If you choose other applications, they must support stream input via stdin and raw video (in the case of video encoding). Refer to the appropriate documentation for more information.</p>
<p>Unfortunately, you're on your own if wish to play with this.</p>
</div>
<div class="section" id="config_files_zfont">
<h4>zfont.txt</h4>
<p>This file contains the font data for the ZSNES <a href="gui.htm" title="Description of the GUI">GUI</a>. You can edit this file to customize the font.</p>
<ul>
<li>Comments are preceded by a <code>;</code> and can be up to 99 characters in length.
<ul><li>In the default file, each comment precedes the character it's labeling.</li></ul>
</li>
<li>Each letter is represented by a block of five rows, each containing 8 bits. Only the first five columns of bits are used for font data; ZSNES uses a 5x5 font. The last three columns of bits should always be zeros.
<ul><li>There are characters for English, Hiragana, and Katakana scripts.</li></ul>
</li>
<li>In case it isn't obvious, a <code>1</code> means the pixel is on in that location. A <code>0</code> means it's off. If you view <code class="file">zfont.txt</code>, you should be able to figure it out.</li>
<li>The file terminates on the EOF+newline character or the last character (whichever comes first).</li>
</ul>
<p>The absolute ordering of each and every line in this file <strong>is important</strong>. If you're missing a single line, things might start messing up. Just so you know, the last line of data should be on line 846, followed by the EOF character on line 847.</p>
<p>If you mess something up, just delete <code class="file">zfont.txt</code>, and ZSNES will re-generate it as normal.</p>
</div>
</div>
<div class="section" id="debugger">
<h3>Debugger</h3>
<p>The debugger, now available in all ports, is enabled only when you enter ZSNES with a -d. (If you are using the DOS port, just type "zsnes -d" at the commandline. Win port users should add a "-d" after their ZSNES shortcut target). Loading a ROM via a command line will start ZSNES in debugger mode; otherwise press F1 to reach it.</p>
<p>Average users, however, should have no need to use the debugger.</p>
<div class="section">
<h4>Debugger Keys:</h4>
<table id="table_debugger_keys">
<tr>
<th>Key</th><th>Function</th>
</tr>
<tr>
<td><kbd class="key">1</kbd></td><td>Enable/Disable SPC700 display</td>
</tr>
<tr>
<td><kbd class="key">2</kbd></td><td>Enable/Disable 65816 display</td>
</tr>
<tr>
<td><kbd class="key">T</kbd></td><td>Trace (in 65816 opcodes)</td>
</tr>
<tr>
<td><kbd class="key">B</kbd></td><td>65816 break point</td>
</tr>
<tr>
<td><kbd class="key">S</kbd></td><td>SPC break point</td>
</tr>
<tr>
<td><kbd class="key">C</kbd></td><td>Clear counter</td>
</tr>
<tr>
<td><kbd class="key">M</kbd></td><td>65816 modify</td>
</tr>
<tr>
<td><kbd class="key">A</kbd></td><td>SPC modify</td>
</tr>
<tr>
<td><kbd class="key">D</kbd></td><td>Debug dump (SPC/DSPRAM dump only)</td>
</tr>
<tr>
<td><kbd class="key">W</kbd></td><td>Break at signal (used only by the programmers)</td>
</tr>
<tr>
<td><kbd class="key">F1</kbd></td><td>Switch between debugger input and game input</td>
</tr>
<tr>
<td><kbd class="key">F2</kbd></td><td>Save state</td>
</tr>
<tr>
<td><kbd class="key">F4</kbd></td><td>Load state</td>
</tr>
<tr>
<td><kbd class="key">Esc</kbd></td><td>Exit entire program</td>
</tr>
</table>
</div>
</div>
<div class="section" id="kitchensync">
<h3>KitchenSync (Win port only)</h3>
<p>This makes NTSC games (60Hz) run at 120Hz, and PAL games (50Hz) run at 100Hz. To enable it, just start ZSNESw with the <code>-ks</code> <a href="#command_line_windows" title="List of command-line switches for the Windows port of ZSNES">switch</a>. Alternatively, you can create a shortcut to ZSNESw that starts with this switch enabled, every time. First create a shortcut to ZSNESw in Windows. Next, right-click on the shortcut and choose Properties. Then, put the cursor right after the quotation marks in the Target box, press the space bar, and type <code>-ks</code>. Finally, click OK. If ZSNESw crashes or refuses to start after enabling this, your monitor does not support the 100/120 Hz refresh rate.</p>
<p>If your monitor supports 100Hz and not 120Hz, you can instead use the <code>-kp</code> switch for PAL only. This way, you will not have to disable the <code>-ks</code> switch every time you wish to play an NTSC game.</p>
</div>
<div class="section" id="command_line">
<h3>Command-Line Arguments</h3>
<p>ZSNES supports execution arguments via the command line. More detailed descriptions of how to use the arguments with each port is forthcoming.</p>
<p>Clicking on the description of an argument will take you to the corresponding GUI option, if one exists.</p>
<p>Usage : <kbd>zsnes* [-d,-f #, ... ] filename.sfc</kbd></p>
<p>Example : <kbd>zsnes* -s -r 2 game.sfc</kbd></p>
<p>*Fill in the appropriate letter for your port when entering this into the command line.</p>
<div class="section" id="command_line_universal">
<h4>Universal Switches</h4>
<table class="argument_list" id="table_command_line_universal">
<tr>
<th>Argument</th><th>Sub-Argument</th><th>Description</th>
</tr>
<tr>
<td>-1 #/-2 #</td><td></td><td><a href="gui.htm#config_input" title="Go to corresponding GUI option">Select Player 1/2 Input</a></td>
</tr>
<tr>
<td></td><td>0</td><td>None</td>
</tr>
<tr>
<td></td><td>1</td><td>Keyboard</td>
</tr>
<tr>
<td>-d</td><td></td><td>Start with <a href="advanced.htm#debugger" title="Go to information about the Debugger">debugger</a> enabled</td>
</tr>
<tr>
<td>-dd</td><td></td><td><a href="gui.htm#config_sound_enable" title="Go to the corresponding GUI option">Disable sound SPC700/DSP emulation</a>, which also disables sound output</td>
</tr>
<tr>
<td>-dh</td><td></td><td>Disable <a href="games.htm#roms" title="General information about ROMs">ROM</a>-specific hacks</td>
</tr>
<tr>
<td>-ds</td><td></td><td><a href="gui.htm#config_sound_enable" title="Go to the corresponding GUI option">Disable sound output</a></td>
</tr>
<tr>
<td>-f #</td><td>[0...9]</td><td><a href="gui.htm#config_speed_frameskip" title="Go to the corresponding GUI option">Enable fixed frame rate</a></td>
</tr>
<tr>
<td>-g #</td><td>[0...15]</td><td>Specify <a href="gui.htm#misc_misckeys_gfxtoggles" title="Go to the corresponding GUI option">gamma correction</a> value</td>
</tr>
<tr>
<td>-h</td><td></td><td><a href="gui.htm#game_load_force" title="Go to the corresponding GUI option">Force HiROM</a></td>
</tr>
<tr>
<td>-j</td><td></td><td>Disable Mouse (Automatically turns off right mouse-click)</td>
</tr>
<tr>
<td>-k #</td><td>[0...100]</td><td><a href="gui.htm#config_sound_volume" title="Go to corresponding GUI option">Set volume level</a></td>
</tr>
<tr>
<td>-l</td><td></td><td><a href="gui.htm#game_load_force" title="Go to the corresponding GUI option">Force LoROM</a></td>
</tr>
<tr>
<td>-m</td><td></td><td>Disable <a href="gui.htm" title="Description of the GUI">GUI</a> (must specify ROM filename)</td>
</tr>
<tr>
<td>-mc</td><td></td><td>Exit ZSNES when closing a movie (use with -zm)</td>
</tr>
<tr>
<td>-md #</td><td></td><td><a href="advanced.htm#movie_dumping" title="Go to the Movie Dumping section">Dump video</a> (use with -zm)</td>
</tr>
<tr>
<td></td><td>1</td><td>Raw</td>
</tr>
<tr>
<td></td><td>2</td><td>FFV1</td>
</tr>
<tr>
<td></td><td>3</td><td>x264</td>
</tr>
<tr>
<td></td><td>4</td><td>XviD</td>
</tr>
<tr>
<td></td><td>5</td><td>Custom</td>
</tr>
<tr>
<td>-ml #</td><td></td><td>Define movie dump length in amount of frames (use with -md)</td>
</tr>
<tr>
<td>-n #</td><td></td><td><a href="gui.htm#config_video_scanlines" title="Go to corresponding GUI option">Enable scanlines</a> (when available)</td>
</tr>
<tr>
<td></td><td>0</td><td>None</td>
</tr>
<tr>
<td></td><td>1</td><td>Full</td>
</tr>
<tr>
<td></td><td>2</td><td>25%</td>
</tr>
<tr>
<td></td><td>3</td><td>50%</td>
</tr>
<tr>
<td>-o</td><td></td><td>Disable <a href="gui.htm#config_options_mmx" title="Go to corresponding GUI option">MMX support</a></td>
</tr>
<tr>
<td>-p #</td><td>[50...150]</td><td>Percentage of instructions to execute</td>
</tr>
<tr>
<td>-r #</td><td></td><td><a href="gui.htm#config_sound_samplerate" title="Go to corresponding GUI option">Set sound sampling rate</a></td>
</tr>
<tr>
<td></td><td>0</td><td>8000Hz</td>
</tr>
<tr>
<td></td><td>1</td><td>11025Hz</td>
</tr>
<tr>
<td></td><td>2</td><td>22050Hz</td>
</tr>
<tr>
<td></td><td>3</td><td>44100Hz</td>
</tr>
<tr>
<td></td><td>4</td><td>16000Hz</td>
</tr>
<tr>
<td></td><td>5</td><td>32000Hz</td>
</tr>
<tr>
<td></td><td>6</td><td>48000Hz</td>
</tr>
<tr>
<td>-s</td><td></td><td><a href="gui.htm#config_sound_enable" title="Go to the corresponding GUI option">Enable sound output and enable SPC700/DSP emulation</a></td>
</tr>
<tr>
<td>-sa</td><td></td><td><a href="gui.htm#game_load_allext" title="Go to corresponding GUI option">Show all extensions in GUI (*.*)</a></td>
</tr>
<tr>
<td>-t</td><td></td><td><a href="gui.htm#game_load_force" title="Go to the corresponding GUI option">Force NTSC timing</a></td>
</tr>
<tr>
<td>-u</td><td></td><td><a href="gui.htm#game_load_force" title="Go to the corresponding GUI option">Force PAL timing</a></td>
</tr>
<tr>
<td>-v8</td><td></td><td><a href="gui.htm#config_video_grayscale" title="Go to the corresponding GUI option">Grayscale mode</a></td>
</tr>
<tr>
<td>-y</td><td></td><td>Enable <a href="gui.htm#config_video_interpolation" title="Go to the corresponding GUI option">Interpolation</a> graphics filter</td>
</tr>
<tr>
<td>-z</td><td></td><td><a href="gui.htm#config_sound_stereo" title="Go to the corresponding GUI option">Disable stereo sound</a></td>
</tr>
<tr>
<td>-zm #</td><td>[0...9]</td><td>Auto load specified <a href="gui.htm#misc_movie_slot" title="Go to the corresponding GUI option">movie slot</a> on startup</td>
</tr>
<tr>
<td>-zs #</td><td>[0...99]</td><td>Auto load specified <a href="gui.htm#save_slot_chooser" title="Go to the corresponding GUI option">save state slot</a> on startup</td>
</tr>
</table>
</div>
<div class="section" id="command_line_windows">
<h4>Windows-only Switches</h4>
<p>From the Windows NT command-line, you can use the following command to view the accepted command-line input for a given ZSNES binary: <kbd>zsnesw -? | more</kbd>. Typing <kbd>zsnesw -?</kbd> does not work.</p>
<p>Users of any flavor of Windows can use the following command to output to a file the same information returned from the command above: <kbd>zsnesw -? > commands.txt</kbd>.</p>
<table class="argument_list" id="table_command_line_windows">
<tr>
<th>Argument</th><th>Sub-Argument</th><th>Description</th>
</tr>
<tr>
<td>-3</td><td></td><td>Enable <a href="gui.htm#config_video_triple" title="Go to corresponding GUI option">triple buffering</a> (disables <a href="gui.htm#config_video_vsync" title="Go to corresponding GUI option">VSync</a>)</td>
</tr>
<tr>
<td>-6 #</td><td>[50...180]</td><td>Force a user-specified refresh rate for fullscreen modes</td>
</tr>
<tr>
<td>-js #</td><td>[0...32767]</td><td>Set joystick sensitivity</td>
</tr>
<tr>
<td>-kp</td><td></td><td>Enable the <a href="faq.htm#win_video_kitchensync" title="FAQ answer about the KitchenSync">KitchenSync</a> for PAL only (100Hz)</td>
</tr>
<tr>
<td>-ks</td><td></td><td>Enable the <a href="faq.htm#win_video_kitchensync" title="FAQ answer about the KitchenSync">KitchenSync</a> for NTSC and PAL (120Hz/100Hz)</td>
</tr>
<tr>
<td>-v #</td><td></td><td><a href="gui.htm#config_video_mode" title="Go to corresponding GUI option">Select Video Mode:</a></td>
</tr>
<tr>
<td></td><td>0</td><td>256x224 R WIN</td>
</tr>
<tr>
<td></td><td>1</td><td>256x224 R FULL</td>
</tr>
<tr>
<td></td><td>2</td><td>512x448 R WIN</td>
</tr>
<tr>
<td></td><td>3</td><td>512x448 DR WIN</td>
</tr>
<tr>
<td></td><td>4</td><td>640x480 S WIN</td>
</tr>
<tr>
<td></td><td>5</td><td>640x480 DS WIN</td>
</tr>
<tr>
<td></td><td>6</td><td>640x480 DR FULL</td>
</tr>
<tr>
<td></td><td>7</td><td>640x480 DS FULL</td>
</tr>
<tr>
<td></td><td>8</td><td>640x480 S FULL</td>
</tr>
<tr>
<td></td><td>9</td><td>768x672 R WIN</td>
</tr>
<tr>
<td></td><td>10</td><td>768x672 DR WIN</td>
</tr>
<tr>
<td></td><td>11</td><td>800x600 S WIN</td>
</tr>
<tr>
<td></td><td>12</td><td>800x600 DS WIN</td>
</tr>
<tr>
<td></td><td>13</td><td>800x600 S FULL</td>
</tr>
<tr>
<td></td><td>14</td><td>800x600 DR FULL</td>
</tr>
<tr>
<td></td><td>15</td><td>800x600 DS FULL</td>
</tr>
<tr>
<td></td><td>16</td><td>1024x768 S WIN</td>
</tr>
<tr>
<td></td><td>17</td><td>1024x768 DS WIN</td>
</tr>
<tr>
<td></td><td>18</td><td>1024x768 S FULL</td>
</tr>
<tr>
<td></td><td>19</td><td>1024x768 DR FULL</td>
</tr>
<tr>
<td></td><td>20</td><td>1024x768 DS FULL</td>
</tr>
<tr>
<td></td><td>21</td><td>1024x896 R WIN</td>
</tr>
<tr>
<td></td><td>22</td><td>1024x896 DR WIN</td>
</tr>
<tr>
<td></td><td>23</td><td>1280x960 S WIN</td>
</tr>
<tr>
<td></td><td>24</td><td>1280x960 DS WIN</td>
</tr>
<tr>
<td></td><td>25</td><td>1280x960 S FULL</td>
</tr>
<tr>
<td></td><td>26</td><td>1280x960 DR FULL</td>
</tr>
<tr>
<td></td><td>27</td><td>1280x960 DS FULL</td>
</tr>
<tr>
<td></td><td>28</td><td>1280x1024 S WIN</td>
</tr>
<tr>
<td></td><td>29</td><td>1280x1024 DS WIN</td>
</tr>
<tr>
<td></td><td>30</td><td>1280x1024 S FULL</td>
</tr>
<tr>
<td></td><td>31</td><td>1280x1024 DR FULL</td>
</tr>
<tr>
<td></td><td>32</td><td>1280x1024 DS FULL</td>
</tr>
<tr>
<td></td><td>33</td><td>1600x1200 S WIN</td>
</tr>
<tr>
<td></td><td>34</td><td>1600x1200 DS WIN</td>
</tr>
<tr>
<td></td><td>35</td><td>1600x1200 DR FULL</td>
</tr>
<tr>
<td></td><td>36</td><td>1600x1200 DS FULL</td>
</tr>
<tr>
<td></td><td>37</td><td>1600x1200 S FULL</td>
</tr>
<tr>
<td></td><td>38</td><td>CUSTOM D WIN</td>
</tr>
<tr>
<td></td><td>39</td><td>CUSTOM DS FULL</td>
</tr>
<tr>
<td></td><td>40</td><td>CUSTOM WIN</td>
</tr>
<tr>
<td></td><td>41</td><td>CUSTOM S FULL</td>
</tr>
<tr>
<td></td><td>42</td><td>CUSTOM DR FULL</td>
</tr>
<tr>
<td>-w</td><td></td><td><a href="gui.htm#config_video_vsync" title="Go to corresponding GUI option">Enable VSync</a> (disables <a href="gui.htm#config_video_triple" title="Go to corresponding GUI option">triple buffering</a>)</td>
</tr>
</table>
</div>
<div class="section" id="command_line_sdl">
<h4>SDL-only Switches</h4>
<table class="argument_list" id="table_command_line_sdl">
<tr>
<th>Argument</th><th>Sub-Argument</th><th>Description</th>
</tr>
<tr>
<td>-ad &lt;&gt;</td><td></td><td>Audio Driver (note you may not have all of these):</td>
</tr>
<tr>
<td></td><td>auto</td><td>Select a driver automatically - uses SDL without libao</td>
</tr>
<tr>
<td></td><td>null</td><td>No sound, only available with libao</td>
</tr>
<tr>
<td></td><td>oss</td><td>Open Sound System, only available with libao on UNIX systems with OSS</td>
</tr>
<tr>
<td></td><td>alsa</td><td>Advanced Linux Sound Architecture, only available with libao on Linux systems with ALSA</td>
</tr>
<tr>
<td></td><td>alsa09</td><td>Advanced Linux Sound Architecture, only available with libao on Linux systems with ALSA</td>
</tr>
<tr>
<td></td><td>polyp</td><td>polypaudio (next generation GNOME sound server), only available with libao and new versions of GNOME</td>
</tr>
<tr>
<td></td><td>esd</td><td>ESounD or Enlightened Sound Daemon, only available with libao and ESD installed</td>
</tr>
<tr>
<td></td><td>sun</td><td>Sun Microsystem's audio system, only available with libao and Solaris or certain BSD systems</td>
</tr>
<tr>
<td></td><td>irix</td><td>IRIX audio system, only available with libao and IRIX systems</td>
</tr>
<tr>
<td></td><td>nas</td><td>Network Audio System, only available with libao and NAS installed</td>
</tr>
<tr>
<td></td><td>arts</td><td>Analog RealTime Synthesizer sound, only available with libao on systems with aRts (KDE)</td>
</tr>
<tr>
<td></td><td>sdl</td><td>Simple DirectMedia Layer sound</td>
</tr>
<tr>
<td>-js #</td><td>[0...32767]</td><td>Set joystick sensitivity</td>
</tr>
<tr>
<td>-v #</td><td></td><td><a href="gui.htm#config_video_mode" title="Go to corresponding GUI option">Select Video Mode:</a></td>
</tr>
<tr>
<td></td><td>0</td><td>256x224 R WIN</td>
</tr>
<tr>
<td></td><td>1</td><td>256x224 R FULL</td>
</tr>
<tr>
<td></td><td>2</td><td>512x448 DR WIN</td>
</tr>
<tr>
<td></td><td>3</td><td>512x448 DR FULL</td>
</tr>
<tr>
<td></td><td>4</td><td>640x480 DR FULL</td>
</tr>
<tr>
<td></td><td>5</td><td>256x224 OR WIN</td>
</tr>
<tr>
<td></td><td>6</td><td>512x448 ODR WIN</td>
</tr>
<tr>
<td></td><td>7</td><td>640x480 ODS FULL</td>
</tr>
<tr>
<td></td><td>8</td><td>640x480 ODS WIN</td>
</tr>
<tr>
<td></td><td>9</td><td>640x560 ODR WIN</td>
</tr>
<tr>
<td></td><td>10</td><td>768x672 ODR WIN</td>
</tr>
<tr>
<td></td><td>11</td><td>800x600 ODS FULL</td>
</tr>
<tr>
<td></td><td>12</td><td>800x600 ODS WIN</td>
</tr>
<tr>
<td></td><td>13</td><td>896x784 ODR WIN</td>
</tr>
<tr>
<td></td><td>14</td><td>1024x768 ODS FULL</td>
</tr>
<tr>
<td></td><td>15</td><td>1024x768 ODS WIN</td>
</tr>
<tr>
<td></td><td>16</td><td>1024x896 ODR WIN</td>
</tr>
<tr>
<td></td><td>17</td><td>1280x960 ODS FULL</td>
</tr>
<tr>
<td></td><td>18</td><td>1280x1024 ODS FULL</td>
</tr>
<tr>
<td></td><td>19</td><td>1600x1200 ODS FULL</td>
</tr>
<tr>
<td></td><td>20</td><td>VARIABLE ODR WIN</td>
</tr>
<tr>
<td></td><td>21</td><td>VARIABLE ODS WIN</td>
</tr>
<tr>
<td></td><td>22</td><td>CUSTOM OD FULL</td>
</tr>
</table>
</div>
<div class="section" id="command_line_dos">
<h4>DOS-only Switches</h4>
<table class="argument_list" id="table_command_line_dos">
<tr>
<th>Argument</th><th>Sub-Argument</th><th>Description</th>
</tr>
<tr>
<td>-0</td><td></td><td>Force black background in 8-bit modes</td>
</tr>
<tr>
<td>-1 #/-2 #</td><td></td><td><a href="gui.htm#config_input" title="Go to corresponding GUI option">Select Player 1/2 Input</a>:</td>
</tr>
<tr>
<td></td><td>2</td><td>2 Button</td>
</tr>
<tr>
<td></td><td>3</td><td>4 Button</td>
</tr>
<tr>
<td></td><td>4</td><td>6 Button</td>
</tr>
<tr>
<td></td><td>5</td><td>8 Button</td>
</tr>
<tr>
<td></td><td>6</td><td>Sidewinder #1</td>
</tr>
<tr>
<td></td><td>7</td><td>Sidewinder #2</td>
</tr>
<tr>
<td></td><td>8</td><td>Sidewinder #3</td>
</tr>
<tr>
<td></td><td>9</td><td>Sidewinder #4</td>
</tr>
<tr>
<td></td><td>10</td><td>Gamepad Pro #0</td>
</tr>
<tr>
<td></td><td>11</td><td>Gamepad Pro #1</td>
</tr>
<tr>
<td></td><td>12</td><td>LPT1 #1</td>
</tr>
<tr>
<td></td><td>13</td><td>LPT1 #2</td>
</tr>
<tr>
<td></td><td>14</td><td>LPT1 #3</td>
</tr>
<tr>
<td></td><td>15</td><td>LPT1 #4</td>
</tr>
<tr>
<td></td><td>16</td><td>LPT1 #5</td>
</tr>
<tr>
<td>-3</td><td></td><td>Enable <a href="gui.htm#config_video_triple" title="Go to corresponding GUI option">triple buffering</a> (disables <a href="gui.htm#config_video_vsync" title="Go to corresponding GUI option">VSync</a>)</td>
</tr>
<tr>
<td>-8</td><td></td><td><a href="gui.htm#config_sound_8bit" title="Go to corresponding GUI option">Force 8-bit sound</a></td>
</tr>
<tr>
<td>-c</td><td></td><td>Enable <a href="gui.htm#config_video_full" title="Go to the corresponding GUI option">full/wide screen</a> (when available)</td>
</tr>
<tr>
<td>-cc</td><td></td><td>Enable <a href="gui.htm#config_video_small" title="Go to the corresponding GUI option">small screen</a> (when available)</td>
</tr>
<tr>
<td>-sp</td><td></td><td>Report sound detection information</td>
</tr>
<tr>
<td>-v #</td><td></td><td><a href="gui.htm#config_video_mode" title="Go to corresponding GUI option">Select Video Mode:</a></td>
</tr>
<tr>
<td></td><td>0</td><td>256x224x8B (MODEQ)</td>
</tr>
<tr>
<td></td><td>1</td><td>256x240x8B (MODEQ)</td>
</tr>
<tr>
<td></td><td>2</td><td>256x256x8B (MODEQ)</td>
</tr>
<tr>
<td></td><td>3</td><td>320x224x8B (MODEX)</td>
</tr>
<tr>
<td></td><td>4</td><td>320x240x8B (MODEX)</td>
</tr>
<tr>
<td></td><td>5</td><td>320x256x8B (MODEX)</td>
</tr>
<tr>
<td></td><td>6</td><td>640x480x16B (VESA1)*</td>
</tr>
<tr>
<td></td><td>7</td><td>320x240x8B (VESA2)</td>
</tr>
<tr>
<td></td><td>8</td><td>320x240x16B (VESA2)</td>
</tr>
<tr>
<td></td><td>9</td><td>320x480x8B (VESA2)</td>
</tr>
<tr>
<td></td><td>10</td><td>320x480x16B (VESA2)</td>
</tr>
<tr>
<td></td><td>11</td><td>512x384x8B (VESA2)</td>
</tr>
<tr>
<td></td><td>12</td><td>512x384x16B (VESA2)</td>
</tr>
<tr>
<td></td><td>13</td><td>640x400x8B (VESA2)</td>
</tr>
<tr>
<td></td><td>14</td><td>640x400x16B (VESA2)</td>
</tr>
<tr>
<td></td><td>15</td><td>640x480x8B (VESA2)</td>
</tr>
<tr>
<td></td><td>16</td><td>640x480x16B (VESA2)</td>
</tr>
<tr>
<td></td><td>17</td><td>800x600x8B (VESA2)</td>
</tr>
<tr>
<td></td><td>18</td><td>800x600x16B (VESA2)</td>
</tr>
<tr>
<td>-w</td><td></td><td><a href="gui.htm#config_video_vsync" title="Go to corresponding GUI option">Enable VSync</a> (disables <a href="gui.htm#config_video_triple" title="Go to corresponding GUI option">triple buffering</a>)</td>
</tr>
</table>
<p>*The 640x480x16B (VESA1) video mode is compatible with many video cards, but can also be very slow. We recommend that you use a VESA2 mode if your video card supports it. Please see the <a href="readme.htm#system_requirements_dos_port" title="Recommended system requirements for running ZSNES DOS">system requirements</a> for more information.</p>
</div>
</div>
</div>
<div id="footer">
<h2>Footer</h2>
<p>This documentation is best viewed in a standards-compliant web browser, like <a href="http://www.mozilla.com" title="Mozilla Corporation home page">Firefox</a> or <a href="http://www.opera.com" title="Opera web browser home page">Opera</a>.</p>
<a href="http://sourceforge.net" title="SourceForge.net"><img style="border:0;width:88px;height:31px" src="http://sflogo.sourceforge.net/sflogo.php?group_id=127354&amp;type=1" alt="SourceForge.net Logo" /></a>
<a href="http://sourceforge.net/donate/index.php?group_id=19677" title="Donate to the ZSNES Project"><img style="border:0;width:88px;height:32px" src="http://images.sourceforge.net/images/project-support.jpg" alt="Support This Project" /> </a>
<span class="web_only">
<a href="http://validator.w3.org/check?uri=referer" title="Validate this page's HTML"><img style="border:0;width:88px;height:31px" src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0 Strict" /></a>
<a href="http://jigsaw.w3.org/css-validator/check/referer" title="Validate this page's CSS"><img style="border:0;width:88px;height:31px" src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!" /></a>
</span>
<p><a href="license.htm" title="View the General Public License">Copyright (C) ZSNES Team &amp; ZSNES Documentation Team</a></p>
</div>
</div>
</body>
</html>

View File

@@ -0,0 +1,591 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Frequently Asked Questions - ZSNES Documentation</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="styles/print.css" media="print" type="text/css" />
<link rel="stylesheet" href="styles/radio.css" title="Radio's style" media="screen" type="text/css" />
<link rel="alternate stylesheet" href="styles/jipcy.css" title="Jipcy's style" media="screen" type="text/css" />
<link rel="alternate stylesheet" href="styles/plaintxt.css" title="Plain Text" media="screen" type="text/css" />
<link rel="contents" href="index.htm" title="Index" />
<link rel="start" href="readme.htm" title="Readme" />
<link rel="previous" href="games.htm" title="Games" />
<link rel="next" href="support.htm" title="Getting Support" />
<link rel="help" href="support.htm" title="Getting Support" />
<link rel="copyright" href="license.htm" title="GNU General Public License" />
</head>
<body>
<div id="header">
<a href="readme.htm" title="ZSNES Documentation Home"><img id="logo" src="images/zsneslogo.png" alt="The ZSNES Logo" /></a>
<h1>ZSNES v1.51 Documentation</h1>
</div>
<div id="nav_column">
<div id="navigation">
<h2>Navigation</h2>
<ul class="navigation_list">
<li><a href="index.htm" title="ZSNES Documentation Index">Index</a></li>
<li><a href="readme.htm" title="General documentation">Readme</a></li>
<li><a href="gui.htm" title="Description of the GUI and its options">GUI</a></li>
<li><a href="netplay.htm" title="Documentation for Netplay">Netplay</a></li>
<li><a href="advanced.htm" title="Advanced Usage">Advanced Usage</a></li>
<li><a href="games.htm" title="Information about Games">Games</a></li>
<li><a href="faq.htm" title="Frequently Asked Questions">FAQ</a>
<ul>
<li><a href="#universal">Universal</a></li>
<li><a href="#win">Win Port</a></li>
<li><a href="#sdl">SDL Port</a></li>
<li><a href="#dos">DOS Port</a></li>
</ul>
</li>
</ul>
<hr />
<ul>
<li><a href="support.htm" title="How to get support">Getting Support</a></li>
<li><a href="history.htm" title="The log of changes to ZSNES">History</a></li>
<li><a href="about.htm" title="A brief description of the ZSNES emulator and ZSNES documentation projects">About</a></li>
<li><a href="license.htm" title="GNU General Public License">License</a></li>
</ul>
<hr />
<ul>
<li><a href="http://zsnes-docs.sourceforge.net/nsrt" title="NSRT Guide">NSRT Guide</a></li>
<li><a href="http://www.zsnes.com" title="ZSNES Home Page on the Web">ZSNES.com</a></li>
</ul>
</div>
</div>
<div id="content_column">
<div id="content">
<h2><acronym title="Frequently Asked Questions">FAQ</acronym></h2>
<div class="section">
<p>The FAQ page was first included in <a href="history.htm#v0390" title="View the history for v0.390 of ZSNES">version 0.390</a> of ZSNES, released on April 11, 1998.</p>
</div>
<div class="section">
<h3>Question Index</h3>
<div class="section">
<h4><a href="#universal">UNIVERSAL QUESTIONS</a></h4>
<ul>
<li><a href="#universal_general">General</a>
<ul>
<li><a href="#universal_general_roms">Where do I download games / ROMs?</a></li>
<li><a href="#universal_general_savedir">What is the "save directory"?</a></li>
<li><a href="#universal_general_gamesaves">Why are my games not saving?</a></li>
<li><a href="#universal_general_savestates3">Are the ZSNES data files compatible among the various ZSNES ports (Win/DOS/SDL)?</a></li>
<li><a href="#universal_general_toaster">Is there Toaster Support?</a></li>
</ul>
</li>
<li><a href="#universal_games">Games</a>
<ul>
<li><a href="#universal_games_ips">Why don't my games work after applying IPS patches to them?</a></li>
<li><a href="#universal_games_idiot">Does ZSNES support Snes9x, GoodSNES, and NSRT ROMs? Or only ZSNES ones?</a></li>
</ul>
</li>
<li><a href="#universal_video">Video</a>
<ul>
<li><a href="#universal_video_scanlines">Why do my scanlines look awful?</a></li>
<li><a href="#universal_video_filters">Why am I missing some video filter options?</a></li>
</ul>
</li>
<li><a href="#universal_sound">Sound</a>
<ul>
<li><a href="#universal_sound_static">Why does ZSNES produce a lot of static?</a></li>
<li><a href="#universal_sound_missing">Why am I missing some sound options?</a></li>
</ul>
</li>
<li><a href="#universal_input">Input</a>
<ul>
<li><a href="#universal_input_threekeys">Why can't I press more than 2 keys at a time?</a></li>
<li><a href="#universal_input_joystick">Why is one direction of the d-pad always held down, even when I'm not pressing any keys?</a></li>
<li><a href="#universal_input_twoconfigs">How do I use both my keyboard and joystick for the 1st or 2nd player?</a></li>
<li><a href="#universal_input_cantset">Why can't I set the keys/buttons for Player 2?</a></li>
<li><a href="#universal_input_calibrate">Why won't ZSNES accept input when I'm configuring the keys for my gamepad?</a></li>
<li><a href="#universal_input_multitap">This game tells me that it is not compatible with the MultiTap (or an external device attached). What should I do?</a></li>
</ul>
</li>
<li><a href="#universal_speed">Speed</a>
<ul>
<li><a href="#universal_speed_slow">Why is ZSNES slow?</a></li>
<li><a href="#universal_speed_cpu">Why does the game slow down even though I'm using auto frame rate and the FPS is pretty high?</a></li>
<li><a href="#universal_speed_toofast">My games are running too quickly! How do I slow them down?</a></li>
</ul>
</li>
<li><a href="#universal_miscellaneous">Miscellaneous</a>
<ul>
<li><a href="#universal_miscellaneous_compressed">Does ZSNES support loading ROMs which are compressed?</a></li>
<li><a href="#universal_miscellaneous_othercompressed">Why doesn't ZSNES support the 7z, RAR, or ZIP deflate64 compression formats?</a></li>
<li><a href="#universal_miscellaneous_multirom">Does ZSNES support multiple ROMs in a single ZIP or JMA file?</a></li>
<li><a href="#universal_miscellaneous_ports">Can you make a Mac/PocketPC/PS2/whatever port?</a></li>
</ul>
</li>
</ul>
</div>
<div class="section">
<h4><a href="#win">WIN-SPECIFIC QUESTIONS</a></h4>
<ul>
<li><a href="#win_general">General</a>
<ul>
<li><a href="#win_general_directx">Why does ZSNESw crash and give me an error with dinput.dll?</a></li>
<li><a href="#win_general_rename">I just switched from the DOS port to the Windows port of ZSNES; why don't my savestates work? Are they incompatible?</a></li>
</ul>
</li>
<li><a href="#win_video">Video</a>
<ul>
<li><a href="#win_video_colors">Why am I seeing double, with strange colors?</a></li>
<li><a href="#win_video_choppy">Why is the video choppy with an FPS of 60 and VSync on?</a></li>
</ul>
</li>
<li><a href="#win_sound">Sound</a>
<ul>
<li><a href="#win_sound_none">How come I don't get any sound?</a></li>
</ul>
</li>
</ul>
</div>
<div class="section">
<h4><a href="#sdl">SDL-SPECIFIC QUESTIONS</a></h4>
<ul>
<li><a href="#sdl_general">General</a>
<ul>
<li><a href="#sdl_general_x">Can I run ZSNES without X?</a></li>
<li><a href="#sdl_general_distro">I got ZSNES from my distro and I found a bug. To whom should I report it?</a></li>
<li><a href="#sdl_general_svn">Should I use SVN?</a></li>
<li><a href="#sdl_general_zlib">I'm getting an error about gzdirect() missing when I try to compile ZSNES. What's up?</a></li>
</ul>
</li>
</ul>
</div>
<div class="section">
<h4><a href="#dos">DOS-SPECIFIC QUESTIONS</a></h4>
<ul>
<li><a href="#dos_video">Video</a>
<ul>
<li><a href="#dos_video_transparencies">How do you enable transparencies?</a></li>
<li><a href="#dos_video_fog">Why is there a layer of fog blocking my view?</a></li>
<li><a href="#dos_video_vesa">Why am I getting error messages regarding VESA 2 drivers?</a></li>
</ul>
</li>
<li><a href="#dos_sound">Sound</a>
<ul>
<li><a href="#dos_sound_none">Why is there no sound?</a></li>
<li><a href="#dos_sound_othercards">Are there any plans to improve detection for non-SoundBlaster cards (or supporting non-SB cards)?</a></li>
<li><a href="#dos_sound_sblive">I get a sound initialization error using my SB Live! (or any other PCI card). How do I fix it?</a></li>
</ul>
</li>
<li><a href="#dos_input">Input</a>
<ul>
<li><a href="#dos_input_sidewinder">Why doesn't my Sidewinder pad work?</a></li>
<li><a href="#dos_input_moresidewinder">How do I get my daisy-chained Sidewinder to work?</a></li>
<li><a href="#dos_input_gamepadpro">Why doesn't my Gamepad Pro work?</a></li>
<li><a href="#dos_input_joystick">Why doesn't my joystick work anymore?</a></li>
<li><a href="#dos_input_pressed">Why does JB5/JB6 keep getting pressed whenever I try to change a key?</a></li>
</ul>
</li>
<li><a href="#dos_crashes">Freezing/Crashing Issues</a>
<ul>
<li><a href="#dos_crashes_freeze">Why does ZSNES freeze when I run it under pure DOS?</a></li>
<li><a href="#dos_crashes_rom">Why does ZSNES crash when I load a ROM?</a></li>
<li><a href="#dos_crashes_gui">Why does ZSNES freeze when I try to enter the GUI?</a></li>
<li><a href="#dos_crashes_memory">ZSNES gives me an "out of memory" error and I only have 16MB of RAM. How do I fix this?</a></li>
</ul>
</li>
<li><a href="#dos_misc">Miscellaneous</a>
<ul>
<li><a href="#dos_misc_stdint">I'm using DJGPP 2.03 and I get an error about missing stdint.h. What's wrong?</a></li>
</ul>
</li>
</ul>
</div>
</div>
<div class="section" id="universal">
<h3>UNIVERSAL QUESTIONS</h3>
<div class="section" id="universal_general">
<h4>General</h4>
<dl>
<dt id="universal_general_roms">Q: Where do I download games / ROMs?</dt>
<dd>A: Due to the <a href="http://en.wikipedia.org/wiki/Rom_images#Legal_status_of_ROMs" title="Legal Status of ROMs section of the ROM Image article at Wikipedia">questionable legality</a> of ROM images of commercial games, the ZSNES Team <em>cannot</em> and <em>will not</em> provide you with any games / ROMs. We must do this in order to keep ZSNES, as an emulator, legal. Please see the <a href="readme.htm#disclaimer">disclaimer</a>.</dd>
<dt id="universal_general_savedir">Q: What is the "save directory"?</dt>
<dd>A: Please read more about the types of files ZSNES generates and where they are created <a href="readme.htm#files" title="Files that ZSNES uses">here</a>.
<p>By default, in the Win and DOS ports of ZSNES, these files will go into their corresponding ROM directory (e.g. If your <em class="game">Chrono Trigger</em> ROM is in <code class="file">C:\SNES Games\RPG</code>, its files will go into that folder; if your <em class="game">Harvest Moon</em> ROM is in <code class="file">C:\SNES Games\Simulation</code>, its files will go into that folder). In the SDL port of ZSNES, however, saves will go into <code class="file">~/.zsnes</code> by default. ZSNES SDL under Mac OS X will place them in <code class="file">~/Library/Application Support/ZSNES</code> instead.</p>
<p>If you dislike the default settings, you can configure a single, universal save path by either going to the <a href="gui.htm#config_paths" title="Description of the Setup Paths dialog">Config -> Paths</a> menu in the <a href="gui.htm" title="Description of the GUI">GUI</a> or by editing <a href="advanced.htm#config_files" title="Description of the ZSNES configuration files">the ZSNES configuration file</a>.</p>
</dd>
<dt id="universal_general_gamesaves">Q: Why are my games not saving?</dt>
<dd>A: If your ROM images are stored on a CD-ROM, you need to define a save directory that points to your hard drive. In order to do this, either go to <a href="gui.htm#config_paths" title="Description of the Setup Paths dialog">Config-->Paths</a> and enter a directory, or edit <a href="advanced.htm#config_files" title="Description of the ZSNES configuration files">the ZSNES configuration file</a> by typing in a directory after "SaveDirectory=". Make sure that this directory is not marked read-only.
<p>If this still does not solve your problem, enable SRAM Check + Save under the <a href="gui.htm#config_saves" title="Description of the Save Options dialog">Config-->Saves menu</a>.</p>
</dd>
<dt id="universal_general_savestates3">Q: Are the ZSNES data files compatible among the various ZSNES ports (Win/DOS/SDL)?</dt>
<dd>A: Yes. Unlike certain PC applications and games, ZSNES's various save <a href="readme.htm#files" title="Description of the files used by ZSNES">files</a> and formats are completely port-independent; you can share any of your files with any user using any port of ZSNES (although some things may be version-dependent). Note, however, that ZSNES's <a href="advanced.htm#config_files_zsnes" title="Description of the ZSNES Configuration File">configuration file</a> contains port-specific options which don't exist in other ports, so while they can be transfered between ports, some things won't work as expected. Note that when transfering various files, make sure they're named properly and in the proper location.
</dd>
<dt id="universal_general_toaster">Q: Is there Toaster Support?</dt>
<dd>A: While we'd love for ZSNES to lace our shoes, feed us, breathe for us, and amass wealth for us, we can't add every crazy feature that comes up. Even though ZSNES does have many, many features that are not necessarily SNES related, they normally don't go beyond features that you'd expect from an advanced gaming system.
<p>Regarding toaster support itself, rumor has it ZSNES does bread toasting if you happen to be using it after midnight while paying your respects to the master of all controls and considering monetary options.</p>
</dd>
</dl>
</div>
<div class="section" id="universal_games">
<h4>Games</h4>
<dl>
<dt id="universal_games_ips">Q: Why don't my games work after applying IPS patches to them?</dt>
<dd>A: If your patched game crashes early or just displays a black screen, you probably need to either add or remove the 512 byte offset from the patch. Use the program IPSEDIT to do this, which is bundled along with <a href="support.htm#utilities_nsrt" title="Nach's SNES ROM Tools">NSRT</a>.
<p>Alternatively, you could either add or remove a header from your ROM before patching. Again, NSRT is capable of doing this.</p>
</dd>
<dt id="universal_games_idiot">Q: Does ZSNES support Snes9x, GoodSNES, and NSRT ROMs? Or only ZSNES ones?</dt>
<dd>A: ZSNES, Snes9x, GoodSNES, and NSRT <a href="games.htm#roms" title="Description of ROMs">ROMs</a> do not exist. All these programs work with SNES ROMs. As ZSNES is an SNES emulator, it will work with all SNES ROMs (except where ZSNES has a bug or the ROM is in an unsupported interleave format).
</dd>
</dl>
</div>
<div class="section" id="universal_video">
<h4>Video</h4>
<dl>
<dt id="universal_video_scanlines">Q: Why do my scanlines look awful?</dt>
<dd>A: <a href="gui.htm#config_video_scanlines" title="Description of the Scanline video options">Scanlines</a> can be negatively affected by the method of vertical scaling that your video card uses, depending on the video mode you have selected for ZSNES. This can sometimes result in scanlines that are not of uniform darkness. The effect of this video scaling is most noticeable with Full scanlines, with 50% and 25% scanlines being less noticeable. To display the scanlines effect properly, you should use resolutions based on a multiple of 256x224 in windowed modes (e.g. 512x448) and 320x240 for fullscreen modes (e.g. 640x480).</dd>
<dt id="universal_video_filters">Q: Why am I missing some video filter options?</dt>
<dd>A: Please make sure you have <a href="gui.htm#config_options_mmx" title="Description of the MMX Support option">MMX Support</a> enabled in the <a href="gui.htm#config_options" title="Description of the Options dialog">Options dialog</a>. Refer to the <a href="gui.htm#config_video" title="Description of the Video Config dialog">Video Config</a> description in <a href="gui.htm" title="Description of the GUI">GUI.htm</a> to see what video options require MMX support.</dd>
</dl>
</div>
<div class="section" id="universal_sound">
<h4>Sound</h4>
<dl>
<dt id="universal_sound_static">Q: Why does ZSNES produce a lot of static?</dt>
<dd>A: There could be many reasons why you are hearing static. If you are using the Windows port and you have an ISA sound card, this could be your problem. If you are using the DOS port, and you have a PCI sound card, this could also be your problem. If your sound card is using SoundBlaster emulation, you probably need to use 8-bit sound, but this can make sound output worse. You can also try doing the following things to improve your sound: Reduce your <a href="gui.htm#config_sound_samplerate" title="Description of the Sampling Rate selector">sampling rate</a> or disable <a href="gui.htm#config_sound_lowpass" title="Description of the LowPass filter options">lowpass filtering</a> and <a href="gui.htm#config_sound_stereo" title="Description of the Stereo Sound option">stereo sound</a>; Win port users can also enable the <a href="gui.htm#config_sound_primarybuffer" title="Description of the Use Primary Buffer option">Primary Sound Buffer</a>.</dd>
<dt id="universal_sound_missing">Q: Why am I missing some sound options?</dt>
<dd>A: Please make sure you have <a href="gui.htm#config_options_mmx" title="Description of the MMX Support option">MMX Support</a> enabled in the <a href="gui.htm#config_options" title="Description of the Options dialog">Options dialog</a>. Refer to the <a href="gui.htm#config_sound" title="Description of the Sound Config dialog">Sound Config</a> description in <a href="gui.htm" title="Description of the GUI">GUI.htm</a> to see what sound options require MMX support.</dd>
</dl>
</div>
<div class="section" id="universal_input">
<h4>Input</h4>
<dl>
<dt id="universal_input_threekeys">Q: Why can't I press more than two keys at a time?</dt>
<dd>A: Many <acronym title="Personal Computer">PC</acronym> keyboards limit the number of key signals that can be transmitted simultaneously. For example, certain combinations of three or more alphanumeric keys may not work. Conversely, there may be some combinations of three or more keys that <em>do</em> work. You would just have to test by trial-and-error to find out, since these combinations can vary between keyboards. Joysticks and gamepads generally don't have this limitation.
<p>If you must use a keyboard, you can set multiple <a href="gui.htm#config_input" title="Description of the Input Device dialog">game keys</a> to a single keyboard key. Alternatively, you could set some keys to the right and left Ctrl and Shift keys, since most keyboards do not restrict signals from these keys.</p>
</dd>
<dt id="universal_input_joystick">Q: Why is one direction of the d-pad always held down, even when I'm not pressing any keys?</dt>
<dd>A: ZSNES auto-calibrates any connected gamepads/joysticks when it first starts. Thus, if one of the buttons or directions is accidentally held down while ZSNES is starting, ZSNES will think this is "normal" or "zero" input, even when you let go of the button. To fix the problem, simply close ZSNES, make sure no buttons are pressed and all axis are centered on your gamepad/joystick, and restart ZSNES. It will then auto-calibrate to the correct "zero" settings.</dd>
<dt id="universal_input_twoconfigs">Q: How do I use both my keyboard and joystick for the 1st or 2nd player?</dt>
<dd>A: First, configure the Player 1 pad (<a href="gui.htm#config_input" title="Description of the Input Device dialog">Config-->Input</a>--> #1) for your normal set-up (for example, a keyboard). Next, configure the Player 3 pad (Config-->Input--> #3) to use your alternative set-up (for example, a joystick or gamepad). When you want to switch between your regular and alternative set-up, go to the <a href="gui.htm#config_options" title="Description of the Options dialog">Config-->Options</a> menu and check <strong class="gui">Use Pl3/4 as Pl1/2</strong>. Now the Player 3 controls act as the Player 1 pad, and Player 4's controls act as the Player 2 pad. To return to the normal controls, simply uncheck this option. Follow the same procedure to create a similar set-up for Players 2 and 4. <strong>Note:</strong> Enabling the option <strong class="gui">Use Pl3/4 as Pl1/2</strong> disables MultiTap emulation.</dd>
<dt id="universal_input_cantset">Q: Why can't I set the keys/buttons for Player 2?</dt>
<dd>A: You need to set the Current Device before ZSNES will allow you to set the individual keys for Player 2 (or Players 3, 4, or 5). If NONE is shown after CURRENT:, the input cannot be changed (or used, for that matter). See the <a href="gui.htm#config_input" title="Description of the Input Device dialog">Input</a> section of the <a href="gui.htm" title="Description of the GUI">GUI</a> page for further instructions.</dd>
<dt id="universal_input_calibrate">Q: Why won't ZSNES accept input when I'm configuring the keys for my gamepad?</dt>
<dd>A: Exit ZSNES and calibrate your input device. Then restart ZSNES and see if it works.</dd>
<dt id="universal_input_multitap">Q: This game tells me that it is not compatible with the MultiTap (or an external device attached). What should I do?</dt>
<dd>A: Set the input devices of player 3, 4, and 5 to "None". You may also need to go to the <a href="gui.htm#config_options" title="Description of the Options dialog">Config-->Options</a> and check <strong class="gui">Use Pl3/4 as Pl1/2</strong>. Additionally, you could add an <a title="Nach's SNES ROM Tools" href="support.htm#utilities_nsrt">NSRT</a> header to your ROM if you desire.</dd>
</dl>
</div>
<div class="section" id="universal_speed">
<h4>Speed</h4>
<dl>
<dt id="universal_speed_slow">Q: Why is ZSNES slow?</dt>
<dd>A: First and foremost, does your computer meet the minimum <a href="readme.htm#system_requirements" title="Minimum system requirements to run ZSNES">system requirements</a> to run ZSNES? If not, there is little you can do to improve performance. That being said, you can still try a number of things.
<ul>
<li>Make sure that any major program(s) is/are closed (such as Winamp).</li>
<li>Try the default settings of ZSNES before you do anything else. You can reset ZSNES to the default settings by deleting all three of its <a href="advanced.htm#config_files" title="Description of the ZSNES configuration files">configuration files</a>.</li>
<li>Ensure that MMX Support is enabled in the <a href="gui.htm#config_options" title="Description of the Options dialog">Options</a> dialog; this mode should provide a noticeable speed increase for computers that can use it.</li>
<li>Certain system configurations and video cards work better with certain video modes. Try switching between different <a href="gui.htm#config_video_mode" title="Description of the Video Mode selection">video modes</a> until you find one that has good/better performance. Things to remember when doing this are that lower resolutions are faster than higher resolutions, full screen modes are faster than windowed modes, and 'R' modes are faster than 'S' modes (because no scaling is necessary).</li>
<li>Make sure you are using <a href="gui.htm#config_speed_autoframerate" title="Description of the Auto Frame Rate option">Auto Frame Skipping</a>. If you already are, try increasing the <a href="gui.htm#config_speed_frameskip" title="Description of the Max Frame Skip option">Max Frame Skip</a>.</li>
<li>Do not use <a href="gui.htm#config_video_vsync" title="Description of the VSync option">VSync</a>; if you must use VSync, try also enabling <a href="gui.htm#config_video_triple" title="Description of the Triple Buffering option">Triple Buffering</a>.</li>
<li>Disable all <a href="gui.htm#config_video_filters" title="Description of the available Video Filters">video filters</a>.</li>
<li>Compile ZSNES yourself with optimizations for your CPU's architecture.</li>
<li>If you still need more speed, <a href="gui.htm#config_sound_enable" title="Description of the Enable Sound option">disable sound</a>. If that's not enough, <a href="gui.htm#config_sound_spc" title="Description of the Disable SPC Emulation option">disable SPC emulation</a> (you must restart ZSNES for this option to take effect). Some games will not work without SPC emulation.</li>
</ul>
<p>If you have an old computer, such as one with a 486/100 processor, you will probably be better off using older DOS versions of ZSNES, as the minimum <a href="readme.htm#system_requirements" title="Minimum system requirements to run ZSNES">system requirements</a> have increased slightly with subsequent releases. To achieve greater speed, you may want to avoid using VESA video modes (although this will disable transparencies). Experiment with the different video modes and try the recommendations above to see which configuration provides the best speed for you.</p>
</dd>
<dt id="universal_speed_cpu">Q: Why does the game slow down even though I'm using auto frame rate and the FPS is pretty high?</dt>
<dd>A: If you have ever played a real SNES, you may notice that some games slow down even on it. To the extent that ZSNES accurately emulates an SNES, a game will slow down in ZSNES in the same places it would slown down on a real SNES.</dd>
<dt id="universal_speed_toofast">Q: My games are running too quickly! How do I slow them down?</dt>
<dd>A: You may have disabled <a href="gui.htm#config_speed_autoframerate" title="Description of the Auto Frame Rate option">auto frame skipping</a>. Re-enable it in the <a href="gui.htm#config_speed" title="Description of the Speed Options dialog">Config-->Speed</a> menu.
<p>If you don't want to use auto frame skipping, and you want to play in windowed mode, you might want to set your monitor's refresh rate to 60hz and enable <a href="gui.htm#config_video_vsync" title="Description of the VSync option">VSync</a> in ZSNES.</p>
<p>If you want to use fullscreen mode without using auto frame skipping, you can enable the KitchenSync by using either the -ks (for NTSC/PAL) or -kp (for PAL) <a href="advanced.htm#command_line_windows" title="List of command-line switches for ZSNES Win port">command-line parameter</a> (Windows port only). Also be sure to enable <a href="gui.htm#config_video_triple" title="Description of the Triple Buffering option">triple buffering</a>.</p>
</dd>
</dl>
</div>
<div class="section" id="universal_miscellaneous">
<h4>Miscellaneous</h4>
<dl>
<dt id="universal_miscellaneous_compressed">Q: Does ZSNES support loading ROMs which are compressed?</dt>
<dd>A: Yes, but it depends on what compression format is used. ZSNES can currently load ROMs that are compressed in the ZIP (method 0 - store and method 8 - deflate), GZip, and JMA compression formats.
<p>Many tools are available to create ZIP files. If you want a fast, commandline based ZIP program that is available on many platforms, get <a href="http://www.info-zip.org/pub/infozip/" title="Info-ZIP Home Page">Info-ZIP</a>. Info-ZIP also has a Windows front end called WiZ available if you prefer a GUI.</p>
<p>For creating GZip files, there are not too many choices. A fast, commandline based compressor for the GZip format, available for several platforms, may be downloaded at the <a href="http://www.gzip.org" title="The gzip home page">GZip site</a>. If you use Windows, there is a program with a GUI called <a href="http://www.7-zip.org" title="7-Zip Home Page">7-Zip</a> that has support for ZIP, GZip, and others. ZIP and GZip files created by 7-Zip are smaller than those created with other programs, but 7-Zip takes a longer time creating them. For users of Unix based operating systems who would like a GUI front end for both ZIP and GZip, get <a href="http://docs.kde.org/en/3.2/kdeutils/ark/" title="The Ark Handbook">Ark</a>, which is part of the KDE project.</p>
<p>To create JMA files, a format invented by Nach and the rest of the NSRT team which offers the best compression ratio for SNES ROMs, you must use <a href="support.htm#utilities_nsrt" title="Nach's SNES ROM Tools">NSRT</a>. NSRT is also capable of compressing SNES ROMs into ZIP and GZip formats.</p>
</dd>
<dt id="universal_miscellaneous_othercompressed">Q: Why doesn't ZSNES support the 7z, RAR, or ZIP deflate64 compression formats?</dt>
<dd>A: ZSNES only supports formats which have an open-source, portable, and easy-to-use library. The 7z and RAR formats do not yet have libraries that fill those criteria. If you want the best compression ratio for your SNES ROMs, you should use JMA. Currently, the only publicly available program that can compress and decompress with JMA is <a href="support.htm#utilities_nsrt" title="Nach's SNES ROM Tools">NSRT</a>. ZIP deflate64 lacks a decompression library which ZSNES can use, but rumor has it that Nach is working on one.</dd>
<dt id="universal_miscellaneous_multirom">Q: Does ZSNES support multiple ROMs in a single ZIP or JMA file?</dt>
<dd>A: ZSNES currently does not support more than one ROM in a ZIP or JMA file, although such support will probably be implemented in the future.</dd>
<dt id="universal_miscellaneous_ports">Q: Can you make a Mac/PocketPC/PS2/PSP/whatever port?</dt>
<dd>A: Since ZSNES is written in assembly, ports to any systems that are not 100% x86 compatible are impossible. Try <a href="http://www.snes9x.com" title="Snes9X Home Page">Snes9x</a> for portability.
<p><a href="http://www.apple.com/" title="Apple home page">Apple Computer, Inc.</a> recently <a href="http://www.apple.com/pr/library/2005/jun/06intel.html" title="Apple press release">switched</a> their the Macintosh computers to use Intel processors, and as such ZSNES has already been modified to run on said computers. Just compile the SDL port with an up-to-date NASM and zlib and everything normally required.</p>
<p>Another third party developer recently ported ZSNES to the Microsoft Xbox as well, and released it under the name "ZsneXbox". Unfortunately, we can not provide a download link as this port is being illegally distributed as a compiled XBE file. As a result, any link or support requests regarding this port will be promptly ignored.</p>
</dd>
</dl>
</div>
</div>
<div class="section" id="win">
<h3>WIN-SPECIFIC QUESTIONS</h3>
<div class="section" id="win_general">
<h4>General</h4>
<dl>
<dt id="win_general_directx">Q: Why does ZSNESw crash and give me an error with dinput.dll?</dt>
<dd>A: If you get this error, download and install the latest version of <a href="support.htm#utilities_directx" title="Description of the DirecX API in the Readme">DirectX</a>.
<p>You might also try running the DirectX Diagnostic Tool. You can do this by clicking the Start button, then selecting "Run...". Type "dxdiag" after "Open:", and click "OK". There are lots of options you can play with, so please read everything before you start messing around. Specifically, go to the "Display" tab, and under the "DirectX Features" section, click the "Disable" button beside each feature. After they are all disabled, re-enable them. Exit dxdiag, and try ZSNES again.</p>
<p>If none of that worked, try re-installing DirectX.</p>
</dd>
<dt id="win_general_rename">Q: I just switched from the DOS port to the Windows port of ZSNES; why don't my savestates work? Are they incompatible?</dt>
<dd>A: The saves and savestates will work just as well with any port of ZSNES. You simply need to rename all files that have .srm and .zst (and .zs1, .zs2, etc.) extensions to match the filenames of your ROMs (or the jma/zip archives that contain them).
<p>For example, if you have "Super Mario World.zip" and "Super Mario RPG.zip", both games will have saves that are labeled "SUPERM~1.SRM", "SUPERM~1.ZS2", etc., and they will be differentiated only by the number after the "~" in the filename.</p>
<p>If you need to find out which "~" number a game uses, open a DOS prompt (a.k.a. Command Prompt), change to the ROM directory, and enter "dir /on /p" (On some newer systems like Win2k you need to add the "/x" switch for the DOS filenames to be displayed). Unfortunately, this method may not be accurate if you have moved your ROMs to a different folder or another computer; you may need to guess and hope for the best, trying to swap filenames a few different ways between the saves before it works for all your games. If it comes down to guessing, we recommend that you backup your save files before renaming them.</p>
<p>Don't forget to put the files into your <a href="#universal_general_savedir" title="FAQ Answer about the Save directory">Save directory</a>.</p>
</dd>
</dl>
</div>
<div class="section" id="win_video">
<h4>Video</h4>
<dl>
<dt id="win_video_colors">Q: Why am I seeing double, with strange colors?</dt>
<dd>A: Any change of resolution within ZSNES should correct the problem. Fullscreen modes are recommended because they are faster than windowed modes.
<p>If you still experience problems, see if these suggestions help (each should be done/tried separately):</p>
<ul>
<li>The issue can be completely resolved with up-to-date video card drivers. Keeping your device drivers fully updated will provide other benefits unrelated to ZSNES.</li>
<li>Set the resolution for ZSNES to the same one used by the Windows desktop.</li>
<li>Try enabling 16-bit color depth in Windows.</li>
</ul>
</dd>
<dt id="win_video_choppy">Q: Why is the video choppy with an FPS of 60 and VSync on?</dt>
<dd>A: If you have VSync on, your monitor needs to be set to a refresh rate that is a multiple of the framerate of the game. NTSC games natively run at ~60 FPS. PAL games natively run at 50 FPS. Thus your monitor would need to be either 60Hz or 120Hz for NTSC games, or 50Hz/100Hz for PAL games. If you run ZSNES with the <a href="advanced.htm#command_line_windows" title="List of command-line switches for the Windows port">-6 switch</a>, with a sub-argument of '60', ZSNES will try to switch your monitor to 60Hz refresh rate. You can use the <a href="advanced.htm#command_line_windows" title="List of command-line switches for the Windows port">-ks switch</a> to make ZSNES try to switch your monitor to 120Hz refresh rate. These two switches only work in fullscreen modes and are for the Windows port only.
<p>You can also try enabling Triple Buffering (using the <a href="advanced.htm#command_line_universal" title="List of command-line switches for all ZSNES ports">-3 switch</a> or the <a href="gui.htm#config_video_triple" title="Description of the Triple Buffering option">GUI option</a>), however this currently only works in Full Screen modes. One last thing you can try is to turn off <a href="gui.htm#config_speed_autoframerate" title="Description of the Auto Frame Rate feature">auto frame-skipping</a>, and set <a href="gui.htm#config_spead_manframerate" title="Description of the Frame Rate feature">manual frame rate</a> to "0".</p>
</dd>
</dl>
</div>
<div class="section" id="win_sound">
<h4>Sound</h4>
<dl>
<dt id="win_sound_none">Q: How come I don't get any sound?</dt>
<dd>A: Either you accidentally <a href="gui.htm#config_sound_enable" title="Description of the Enable Sound option">disabled sound</a>, you don't have a sound card, the sound drivers aren't properly installed in your system, or your sound card is not compatible with DirectSound (part of Microsoft's <a href="support.htm#utilities_directx" title="Description of the DirecX API in the Support page">DirectX</a> <acronym title="Application Programming Interface">API</acronym>). Also make sure that <a href="gui.htm#config_sound_spc" title="Description of the Disable SPC Emulation option">Disable SPC Emulation</a> is NOT checked.
<p>Try (re-)installing the latest version of DirectX, and make sure you have the latest drivers for your sound card (WHQL Certified, if possible).</p>
<p>Please also note that ISA sound cards tend not to work with Windows, while they do with DOS.</p></dd>
</dl>
</div>
</div>
<div class="section" id="sdl">
<h3>SDL-SPECIFIC QUESTIONS</h3>
<div class="section" id="sdl_general">
<h4>General</h4>
<dl>
<dt id="sdl_general_x">Q: Can I run ZSNES without X?</dt>
<dd>A: Yes, but you'll need to have SDL compiled to use SVGAlib.</dd>
<dt id="sdl_general_distro">Q: I got ZSNES from my distro and I found a bug. To whom should I report it?</dt>
<dd>A: Compile ZSNES yourself and see if the bug still exists. If it does, please tell us, otherwise be happy that ZSNES works now, and give your distro a heads-up if you feel motivated enough.</dd>
<dt id="sdl_general_svn">Q: Should I use <acronym title="Subversion">SVN</acronym>?</dt>
<dd>A: SVN is the best way to get the most up-to-date ZSNES source. It is best to double-check with SVN if you have a problem, since we might have already fixed it. If you find a new problem in SVN, please tell us, but be warned that we won't take it too seriously if it involves something that's currently being worked on.
<p>To check out and install ZSNES from SVN, refer to <a href="http://board.zsnes.com/phpBB2/viewtopic.php?t=7371" title="ZSNES Board thread about using SVN">this thread</a> on the ZSNES board.</p>
</dd>
<dt id="sdl_general_zlib">Q: I'm getting an error about gzdirect() missing when I try to compile ZSNES. What's up?</dt>
<dd>A: Make sure you're using zlib 1.2.3 or higher. Some distributions say you have zlib 1.2.3 but in reality give you an older version. If your distribution is being problematic, compile zlib yourself. Grab the latest version of zlib at the <a href="http://www.zlib.net" title="zlib Compression Library">official website</a>.</dd>
</dl>
</div>
</div>
<div class="section" id="dos">
<h3>DOS-SPECIFIC QUESTIONS</h3>
<div class="section" id="dos_video">
<h4>Video</h4>
<dl>
<dt id="dos_video_transparencies">Q: How do you enable transparencies?</dt>
<dd>A: First, try setting the video mode to a 16-bit color mode in the <a href="gui.htm#config_video" title="Description of the Video Config dialog">GUI</a>. (If 320x240x16b doesn't work, then try 640x480x16b). If it gives you an error that says that your video card isn't compatible with VESA 2.0, you might want to get <a href="support.htm#utilities_scitech" title="Description of the Scitech Display Doctor utility">Scitech Display Doctor</a>. It provides certain cards with VESA 2.0 support. Running with transparencies on is definitely slower because of the extra math equations, memory, and video space involved.</dd>
<dt id="dos_video_fog">Q: Why is there a layer of fog blocking my view?</dt>
<dd>A: You need to either enable transparencies (see above), or you can disable certain backgrounds by pressing <a href="readme.htm#default_keys_emulator" title="List of default keys for using ZSNES">the 1, 2, 3, or 4 keys</a>. If you get lost while pressing those keys, <a href="readme.htm#default_keys_emulator" title="List of default keys for using ZSNES">press 6 to re-enable all of the backgrounds</a>.</dd>
<dt id="dos_video_vesa">Q: Why am I getting error messages regarding VESA 2 drivers?</dt>
<dd>A: Here is a list of the various error codes that you may be coming across, along with descriptions of what they mean:
<ul>
<li>VBE not detected - ZSNES failed to detect any VBE interrupts (Your video card doesn't support VESA).</li>
<li>VESA not detected - ZSNES failed to detect any VESA extensions (Your video card doesn't support VESA).</li>
<li>VESA 2.0 or greater required - Your video card supports VESA, but it has an older version. You may want to use <a href="support.htm#utilities_scitech" title="Description of the Scitech Display Doctor utility">Scitech Display Doctor</a> to upgrade your VESA driver.</li>
<li>VESA 2 mode does not work on your video card/driver - Meaning that the resolution you requested does not exist in the supported resolutions of your video card. Choose a different resolution or upgrade with <a href="support.htm#utilities_scitech" title="Description of the Scitech Display Doctor utility">SDD</a>, which can sometimes help increase the number of resolutions supported.</li>
<li>Unable to initialize video mode - A VESA 2.0 driver is found, but the video mode failed to start. There could possibly be an error on the video card setting, or it may be a defective piece of hardware.</li>
<li>Linear frame buffer not detected - Meaning that your video card does not support linear frame buffering, which is required for the ZSNES VESA 2 routines.</li>
</ul>
</dd>
</dl>
</div>
<div class="section" id="dos_sound">
<h4>Sound</h4>
<dl>
<dt id="dos_sound_none">Q: Why is there no sound?</dt>
<dd>A: There could be several situations:
<ul>
<li>You haven't enabled sound. You can enable it through the <a href="gui.htm#config_sound_enable" title="Description of the Enable Sound option">GUI</a> or through <a href="advanced.htm#config_files" title="Description of the ZSNES configuration files">zsnes.cfg</a>. Also make sure that <a href="gui.htm#config_sound_spc" title="Description of the Disable SPC Emulation option">Disable SPC Emulation</a> is NOT checked.</li>
<li>You need to make sure that the SET BLASTER variable is set properly. To do this, type SET in DOS and look for a string starting with "BLASTER=". If such a string exists, then this is not your problem.</li>
<li>You don't have a SB2.0 compatible sound card. If this is your case, there is nothing you can do at the moment. ZSNES uses auto-initialization mode for sound which requires SB2.0+.</li>
<li>Your SB IRQ conflicts with another device. If this is the case, you might want to check your sound card settings through Control Panel -> System.</li>
<li>ZSNES doesn't like your sound card.</li>
<li>You can try using <a href="http://sourceforge.net/projects/vdmsound/" title="VDMSound project at SourceForge.net">VDMSound</a>.</li>
</ul>
</dd>
<dt id="dos_sound_othercards">Q: Are there any plans to improve detection for non-SoundBlaster cards (or supporting non-SB cards)?</dt>
<dd>A: There is little effort put into major changes to the DOS code, since so few people use that port these days. However, we will gladly accept anyone's help in improving the DOS sound code.</dd>
<dt id="dos_sound_sblive">Q: I get a sound initialization error using my SB Live! (or any other PCI card). How do I fix it?</dt>
<dd>A: Here is a solution: (Thanks CyberGodz for the post on the forums!)
<p>SB Live! uses what is known as a NMI, or Non Maskable Interrupt, to emulate SB 16 sound. Don't ask us exactly what it does (it's a type of IRQ) but that is pretty much all it is good for.</p>
<p>The problem is that many sound cards either lack NMI support or don't have it enabled (No NMI = No DOS support).</p>
<p>To try and solve this problem, do the following:</p>
<ul>
<li>Check your BIOS. If there is an option for RAM parity checking, enable it; it usually turns on NMI support. If there is something that says "NMI", turn it on.</li>
<li>If you don't find anything in your BIOS, then go to your motherboard's website and download the latest BIOS flash. Install it and try your DOS sound (You may still have to enable the stuff in the BIOS afterwards).</li>
<li>Failing the first two things, you could either get a new motherboard or get another compatible sound card alongside the SB Live!. Just attach a cable from the line out of the SB 16 to the line in of the SB Live!. Enable line in on the mixer of your SB Live! and it should route the sound through the old sound card (Don't use the SPDIF to connect the cards if you have one; wave sound doesn't pass through SPDIF--only MIDI).</li>
</ul>
</dd>
</dl>
</div>
<div class="section" id="dos_input">
<h4>Input</h4>
<dl>
<dt id="dos_input_sidewinder">Q: Why doesn't my Sidewinder pad work?</dt>
<dd>A: First, for non-USB Sidewinders, you should disable the Sidewinder profiler from the Win9x icon tray, run ZSNES, set Input #1 as SidewinderPad1, then press the mode button a few times. If that doesn't work, try the following:
<ul>
<li>Try checking or unchecking <a href="gui.htm#config_input_sidewinder" title="Description of the Sidewinder Fix option">the Sidewinder Fix option</a> under <a href="gui.htm#config_options" title="Description of the Options dialog">Config Menu -> Options</a> and repeat the above steps.</li>
<li>Fully disable the Win9x Sidewinder drivers by going to Control Panel/Game Controllers. Then remove the Sidewinder (Thanks Scarlet-Slider for this info!).</li>
<li>Run ZSNES under pure DOS.</li>
<li>Again, try checking or unchecking the Sidewinder Fix in the options menu of the GUI and repeat the above 2 steps.</li>
<li>Make sure your Sidewinder is plugged in and is not broken.</li>
</ul>
<p>For USB joysticks, you can either set ZSNES as a 6-button joystick or simulate keyboard keys through the Sidewinder profiler by setting Input #1 as a keyboard with those defined keys.</p>
</dd>
<dt id="dos_input_moresidewinder">Q: How do I get my daisy-chained Sidewinder to work?</dt>
<dd>A: First, run ZSNES. Temporarily disconnect the second Sidewinder pad from the first one, get the first one to work, then re-connect the second Sidewinder pad.</dd>
<dt id="dos_input_gamepadpro">Q: Why doesn't my Gamepad Pro work?</dt>
<dd>A: For the non-USB version, be sure to have your Gamepad Pro set on 'GrIP' mode. Then set the input device as Gamepad Pro P0. For the USB version, you can use a keyboard emulator, which should be included with the software that came with your joystick.</dd>
<dt id="dos_input_joystick">Q: Why doesn't my joystick work anymore?</dt>
<dd>A: You might have accidentally clicked the <a href="gui.htm#config_input" title="GUI Description of the Input Device dialog">Use Joystick Port 209H</a> check box. Just uncheck it.</dd>
<dt id="dos_input_pressed">Q: Why does JB5/JB6 keep getting pressed whenever I try to change a key?</dt>
<dd>A: Try changing your joystick type from 6-button to 4-button.</dd>
</dl>
</div>
<div class="section" id="dos_crashes">
<h4>Freezing/Crashing Issues</h4>
<dl>
<dt id="dos_crashes_freeze">Q: Why does ZSNES freeze when I run it under pure DOS?</dt>
<dd>A: Try loading your mouse driver or run ZSNES using the -j <a href="advanced.htm#command_line_universal" title="List of command-line switches for all ZSNES ports">switch</a>. For the most compatible result, use the Microsoft Mouse driver if possible.</dd>
<dt id="dos_crashes_rom">Q: Why does ZSNES crash when I load a ROM?</dt>
<dd>A: It could be that ZSNES doesn't recognize your sound configuration. To fix it, disable sound or try changing your <a href="gui.htm#config_sound" title="Description of the Sound Config dialog">sound configuration</a>. Also see <a href="faq.htm#universal_crashes_badrom" title="Universal Question - Why does ZSNES crash as soon as I load a ROM?">this question</a>.</dd>
<dt id="dos_crashes_gui">Q: Why does ZSNES freeze when I try to enter the GUI?</dt>
<dd>A: Run ZSNES using the commandline -j.</dd>
<dt id="dos_crashes_memory">Q: ZSNES gives me an "out of memory" error and I only have 16MB of RAM. How do I fix this?</dt>
<dd>A: If you are running the DOS port of ZSNES from within Windows, try restarting the computer in DOS mode; more RAM should then presumably be available for ZSNES to use. To get it running under Win9x, first create a shortcut to the DOS prompt on the desktop (the filename 'target' can be <code>C:\command.com</code>). Next, right-click on the icon and go to Properties. Then, select the Memory tab and look below for Protected Mode (DPMI) settings and set a high value (like 20000). Last, double-click on that icon and load ZSNES as usual.</dd>
</dl>
</div>
<div class="section" id="dos_misc">
<h4>Miscellaneous</h4>
<dl>
<dt id="dos_misc_stdint">Q: I'm using DJGPP 2.03 and I get an error about missing stdint.h. What's wrong?</dt>
<dd>A: You're probably missing this file. <a href="http://www.delorie.com/bin/cvsweb.cgi/djgpp/include/stdint.h" title="Download link for stdint.h">Download the latest version</a> of this file and put it in DJGPP's include directory.</dd>
</dl>
</div>
</div>
</div>
<div id="footer">
<h2>Footer</h2>
<p>This documentation is best viewed in a standards-compliant web browser, like <a href="http://www.mozilla.com" title="Mozilla Corporation home page">Firefox</a> or <a href="http://www.opera.com" title="Opera web browser home page">Opera</a>.</p>
<a href="http://sourceforge.net" title="SourceForge.net"><img style="border:0;width:88px;height:31px" src="http://sflogo.sourceforge.net/sflogo.php?group_id=127354&amp;type=1" alt="SourceForge.net Logo" /></a>
<a href="http://sourceforge.net/donate/index.php?group_id=19677" title="Donate to the ZSNES Project"><img style="border:0;width:88px;height:32px" src="http://images.sourceforge.net/images/project-support.jpg" alt="Support This Project" /> </a>
<span class="web_only">
<a href="http://validator.w3.org/check?uri=referer" title="Validate this page's HTML"><img style="border:0;width:88px;height:31px" src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0 Strict" /></a>
<a href="http://jigsaw.w3.org/css-validator/check/referer" title="Validate this page's CSS"><img style="border:0;width:88px;height:31px" src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!" /></a>
</span>
<p><a href="license.htm" title="View the General Public License">Copyright (C) ZSNES Team &amp; ZSNES Documentation Team</a></p>
</div>
</div>
</body>
</html>

View File

@@ -0,0 +1,514 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Games - ZSNES Documentation</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="styles/print.css" media="print" type="text/css" />
<link rel="stylesheet" href="styles/radio.css" title="Radio's style" media="screen" type="text/css" />
<link rel="alternate stylesheet" href="styles/jipcy.css" title="Jipcy's style" media="screen" type="text/css" />
<link rel="alternate stylesheet" href="styles/plaintxt.css" title="Plain Text" media="screen" type="text/css" />
<link rel="contents" href="index.htm" title="Index" />
<link rel="start" href="readme.htm" title="Readme" />
<link rel="previous" href="advanced.htm" title="Advanced Usage" />
<link rel="next" href="faq.htm" title="FAQ" />
<link rel="help" href="support.htm" title="Getting Support" />
<link rel="copyright" href="license.htm" title="GNU General Public License" />
</head>
<body>
<div id="header">
<a href="readme.htm" title="ZSNES Documentation Home"><img id="logo" src="images/zsneslogo.png" alt="The ZSNES Logo" /></a>
<h1>ZSNES v1.51 Documentation</h1>
</div>
<div id="nav_column">
<div id="navigation">
<h2>Navigation</h2>
<ul class="navigation_list">
<li><a href="index.htm" title="ZSNES Documentation Index">Index</a></li>
<li><a href="readme.htm" title="General documentation">Readme</a></li>
<li><a href="gui.htm" title="Description of the GUI and its options">GUI</a></li>
<li><a href="netplay.htm" title="Documentation for Netplay">Netplay</a></li>
<li><a href="advanced.htm" title="Advanced Usage">Advanced Usage</a></li>
<li><a href="games.htm" title="Information about Games">Games</a>
<ul>
<li><a href="#roms">ROMs</a></li>
<li><a href="#compatibility">Compatibility</a></li>
<li><a href="#special_chip">Special-Chip Games</a></li>
<li><a href="#special_carts">Special Cartridges</a></li>
<li><a href="#satellaview">BS-X (Satellaview)</a></li>
<li><a href="#super_gameboy">Super Gameboy</a></li>
<li><a href="#individual_games">Individual Game Issues</a></li>
<li><a href="#manymouse_games">Games Supported by ManyMouse</a></li>
<li><a href="#multiplayer">Multiplayer List</a></li>
</ul>
</li>
<li><a href="faq.htm" title="Frequently Asked Questions">FAQ</a></li>
</ul>
<hr />
<ul>
<li><a href="support.htm" title="How to get support">Getting Support</a></li>
<li><a href="history.htm" title="The log of changes to ZSNES">History</a></li>
<li><a href="about.htm" title="A brief description of the ZSNES emulator and ZSNES documentation projects">About</a></li>
<li><a href="license.htm" title="GNU General Public License">License</a></li>
</ul>
<hr />
<ul>
<li><a href="http://zsnes-docs.sourceforge.net/nsrt" title="NSRT Guide">NSRT Guide</a></li>
<li><a href="http://www.zsnes.com" title="ZSNES Home Page on the Web">ZSNES.com</a></li>
</ul>
</div>
</div>
<div id="content_column">
<div id="content">
<h2>Games</h2>
<div class="section" id="roms">
<h3>ROMs</h3>
<p><strong>ROMs are not included with ZSNES!!!</strong> You must find them on your own.</p>
<p>Please read Wikipedia's article on <a href="http://en.wikipedia.org/wiki/ROM_image" title="ROM Image article at Wikipedia">ROM Images</a> for a general overview.</p>
<p>In relation to SNES emulation, a "ROM image" is a computer file which is an exact copy of the data that is contained in a <strong>R</strong>ead <strong>O</strong>nly <strong>M</strong>emory chip inside a game cartridge. This file contains the same data that a real SNES console reads from the game cartridge. An SNES emulator loads this ROM into its own memory, very much like how a real SNES operates.</p>
<p>A problem appears when you have a ROM image that is <em>not</em> an exact copy of the data on a real SNES cartridge. Many of the ROMs available for download on the Internet are not in fact exact copies of real SNES games. There are a variety of reasons why a ROM that appears to be a real game is not an exact copy of the cartridge data. For example, the ROM may have been incorrectly "dumped" from the cartridge, which can introduce errors. Certain prolific ROM "releasers" will "hack" a ROM to include an introduction that advertises the releaser. Regardless of the reason for an imperfect ROM image, these "bad" ROMs can display errors when they are played in an emulator.</p>
<p>Emulator developers generally try to make their emulators work with "good" ROMs; that is, ROMs that are perfect copies of the data on a real game cartridge. The developers of ZSNES in particular are unable to provide <em>any</em> help to people who are using "bad" ROMs. You <em>must</em> use a good ROM if you want any chance of playing an error-free game.</p>
<p>We recommend using <a href="support.htm#utilities_nsrt" title="Description of NSRT">NSRT</a> to verify that your ROMs are "good" dumps. In some cases, NSRT can actually modify a "bad" ROM in such a way that it becomes a "good" ROM. Please read the documentation included with NSRT for additional information.</p>
</div>
<div class="section" id="compatibility">
<h3>Compatibility</h3>
<p>There are many reasons why a particular ROM may not work correctly with ZSNES. Here is a list of things you can do to improve your chances of a ROM working with ZSNES:</p>
<ul>
<li>Make sure your ROM is actually a "good dump." Often a ROM appears to be from a particular game/cartridge, but it <strong>is not</strong> in fact a perfect copy of the data on that cartridge. You can use <a href="support.htm#utilities_nsrt" title="Nach's SNES ROM Tools">NSRT</a> to scan your ROM and tell you if it is a good dump. In some cases, NSRT can actually modify a "bad" ROM in such a way that it becomes a "good" ROM.</li>
<li>Your ROM may be a game that uses the <a href="#special_chip_superfx" title="SuperFX Special Chip information">SuperFX special chip</a>. It may also be "interleaved." ZSNES cannot detect when a ROM is interleaved with the SuperFX interleave method. There is more information about this <a href="#special_chip_superfx" title="SuperFX Special Chip information">below</a>. In cases where ZSNES cannot detect a ROM's interleave method, ZSNES will incorrectly report the ROM as <em>not</em> interleaved, and the ROM will fail to load.</li>
<li>If you have <a href="gui.htm#config_sound_enable" title="Description of the Enable Sound option">turned off sound</a>, you should re-enable it. If you wish to mute the sound output, simply move the volume slider to 0%. Many games require sound emulation to be active in order to work correctly, so disabling sound can "break" a lot of games.</li>
<li>If you have changed the percentage of execution in the <a href="advanced.htm#config_files" title="Description of the ZSNES configuration files">ZSNES configuration file</a>, change it back to 100. However, there are a few particular games that may work better if the percentage to execute is set to either 120% or 80%.</li>
</ul>
<p>The developers of ZSNES make no guarantee that any particular game will work. While we wish to play these incompatible games as much as you do, sometimes it is just not possible. Furthermore, ZSNES is in a constant state of development. Compatibility with a particular game may change between releases of ZSNES.</p>
<p>In the past, ZSNES developers programmed the emulator to "hack" certain games. These "hacks" would modify in-memory certain incompatible games, to get them to work with ZSNES. Some hacks were also used make certain games run at full speed if they were too slow. Sometimes, however, a particular game hack will break other parts of accurate SNES emulation.</p>
<p>As the emulation accuracy of ZSNES has improved, these hacks have become less necessary. In general, game hacks are removed whenever possible. With the current state of emulation in ZSNES, no new game hacks will be added.</p>
<p>In conclusion, if you have tried the steps above, and your game still doesn't work, <em>we're sorry</em>; however there is nothing we can do. ZSNES is developed for <em>emulation accuracy</em>, with game compatibility as a side effect, <em>not the other way around</em>. The most you can do is try another emulator or hope that ZSNES will become accurate enough to be able to run your particular game.</p>
</div>
<div class="section" id="special_chip">
<h3>Special-Chip Games</h3>
<p>The approximate percentage of emulation progress for these special chips is listed under <a href="readme.htm#current_progress_special_chips" title="Emulation status of special chips">Current Progress</a>.</p>
<p>The NSRT <a href="http://nsrt.edgeemu.com/INFO/chipinfo.htm" title="SNES Add-on Chip information">SNES Add-on Chip information</a> article was frequently referenced for the information assembled on this page.</p>
<p>You may find that the section on <a href="http://en.wikipedia.org/wiki/Super_Nintendo_Entertainment_System#Enhancement_chips">Enhancement chips</a> in the <a href="http://en.wikipedia.org/wiki/Super_Nintendo_Entertainment_System">Super Nintendo</a> article at <a href="http://en.wikipedia.org/">Wikipedia</a> contains some interesting historical information, not covered in this FAQ.</p>
<p>A number of games developed for the Super Nintendo included additional special-purpose processors on the game cartridge. A game would use this special processor to accomplish something that wasn't possible using just the standard SNES hardware. It is impossible to represent these processors with ROM data; in order for these games to work, ZSNES must emulate these special processors, <em>in addition</em> to all the standard SNES hardware (which ZSNES already emulates).</p>
<p>Below is a list of all known special processors, followed by a list of the games known to use each processor.</p>
<div class="section" id="special_chip_c4">
<h4>C4</h4>
<p>The C4 chip is a math co-processor with limited graphical processing capabilities.</p>
<ul>
<li>Megaman X 2 (USA) / Rockman X 2 (Japan)</li>
<li>Megaman X 3 (USA, Europe) / Rockman X 3 (Japan)</li>
</ul>
</div>
<div class="section" id="special_chip_dsp">
<h4>Nintendo DSP</h4>
<p>Each of the Nintendo DSP chips have identical hardware, but different software (firmware).</p>
<div class="section" id="special_chip_dsp1">
<h5>DSP-1</h5>
<ul>
<li>Ace wo Nerae!</li>
<li>Armored Trooper Votoms</li>
<li>Ballz 3D / 3 Jigen Kakutou Ballz</li>
<li>Battle Racers</li>
<li>Drift King Shutokou Battle '94</li>
<li>Drift King Shutokou Battle 2</li>
<li>Final Stretch</li>
<li>Hashiriya Kon</li>
<li>Korean League</li>
<li>Lock On</li>
<li>Michael Andretti's Indy Car Challenge</li>
<li>Pilotwings</li>
<li>Super 3D Baseball</li>
<li>Super Air Diver</li>
<li>Super Air Diver 2</li>
<li>Super Bases Loaded II</li>
<li>Super F1 Circus Gaiden</li>
<li>Super Mario Kart</li>
<li>Suzuka 8 Hours</li>
</ul>
</div>
<div class="section" id="special_chip_dsp2">
<h5>DSP-2</h5>
<ul>
<li>Dungeon Master</li>
</ul>
</div>
<div class="section" id="special_chip_dsp3">
<h5>DSP-3</h5>
<ul>
<li>SD Gundam GX</li>
</ul>
</div>
<div class="section" id="special_chip_dsp4">
<h5>DSP-4</h5>
<ul>
<li>Top Gear 3000 (USA) / Planets Champ TG 3000 (Japan)</li>
</ul>
</div>
</div>
<div class="section" id="special_chip_obc1">
<h4>OBC-1</h4>
<ul>
<li>Metal Combat</li>
</ul>
</div>
<div class="section" id="special_chip_sa1">
<h4>SA-1</h4>
<p><q cite="http://nsrt.edgeemu.com/INFO/chipinfo.htm" title="Quoted from http://nsrt.edgeemu.com/INFO/chipinfo.htm">The SA-1 is a 65816 chip, although at a higher clock then the SNES's internal one.</q></p>
<ul>
<li>Asahi Shinbun Rensai - Katou Ichi-Ni-San Kudan Shougi Shingiru</li>
<li>Daisenryaku Expert WWII</li>
<li>Derby Jockey 2</li>
<li>Dragon Ball Z - Hyper Dimension</li>
<li>Hanyuu Meijin no Omoshiro Shougi</li>
<li>Harukanaru Augusta 3 - Masters New</li>
<li>Hayashi Kaihou Kudan no Igo Taidou</li>
<li>Itoi Shigesato no Bass Tsuri No.1</li>
<li>J. League '96 Dream Stadium</li>
<li>Jikkyou Oshaberi Parodius</li>
<li>Jumpin' Derby</li>
<li>Kakinoki Shougi</li>
<li>Kirby Super Star (USA) / Hoshi no Kirby - Super Deluxe (Japan) / Kirby's Fun Pak (Europe)</li>
<li>Kirby's Dream Land 3 (USA) / Hoshi no Kirby 3 (Japan)</li>
<li>Marvelous</li>
<li>Mini Yonku Shining Scorpion - Let's &amp; Go!!</li>
<li>Pebble Beach no Hatou New - Tournament Edition</li>
<li>PGA European Tour</li>
<li>PGA Tour 96</li>
<li>Power Rangers Zeo - Battle Racers</li>
<li>Saikousoku Shikou Shougi Mahjong</li>
<li>SD F-1 Grand Prix</li>
<li>SD Gundam G-NEXT cartridge ROM (G-NEXT.SFC)</li>
<li>Shin Shougi Club</li>
<li>Shougi no Hanamichi</li>
<li>Shougi Saikyou</li>
<li>Shougi Saikyou II</li>
<li>Super Bomberman - Panic Bomber W</li>
<li>Super Mario RPG</li>
<li>Super Robot Wars Gaiden</li>
<li>Super Shougi 3 - Kitaihei</li>
<li>Taikyoku Igo - Idaten</li>
<li>Takemiya Masaki Kudan no Igo Daishou</li>
</ul>
</div>
<div class="section" id="special_chip_sdd1">
<h4>S-DD1</h4>
<ul>
<li>Star Ocean</li>
<li>Street Fighter Alpha 2 (USA/Europe) / Street Fighter Zero 2 (Japan)</li>
</ul>
</div>
<div class="section" id="special_chip_setadsp">
<h4>Seta DSP</h4>
<p>Seta's DSP has 2 major firmwares.</p>
<div class="section" id="special_chip_setadsp10">
<h5>Seta 10 / ST010</h5>
<ul>
<li>F1 ROC II (USA) / Exhaust Heat II (Japan)</li>
</ul>
</div>
<div class="section" id="special_chip_setadsp11">
<h5>Seta 11 / ST011</h5>
<ul>
<li>Hayazashi Nidan Morita Shougi</li>
</ul>
</div>
</div>
<div class="section" id="special_chip_setarisc">
<h4>Seta RISC</h4>
<p>The Seta RISC chip is not emulated.</p>
<div class="section">
<h5>Seta 18 / ST018</h5>
<ul>
<li>Hayazashi Nidan Morita Shougi 2</li>
</ul>
</div>
</div>
<div class="section" id="special_chip_spc7110">
<h4>SPC7110</h4>
<ul>
<li>Far East of Eden Zero</li>
<li>Far East of Eden Zero - Shounen Jump no Shou</li>
<li>Momotarou Dentetsu Happy</li>
<li>Super Power League 4</li>
</ul>
<p>ZSNES does not fully support the SPC7110 chip yet. However, you may use some third party graphics decompression packs to get the four above games to work.</p>
<p>The SPC7110 graphic packs are mirrored on a number of sites on the Internet. Here are a few:</p>
<ul>
<li>* <a href="http://other.ipherswipsite.com/gpacks/" title="ipher's WIP Page">ipher's WIP Pages</a></li>
<li>* <a href="http://nsrt.edgeemu.com" title="Nach's SNES ROM Tools">NSRT Official Site</a></li>
<li>* <a href="http://www.caitsith2.com" title="Home Page of Caitsith2">Caitsith2's Personal Web Page</a></li>
</ul>
<p>After you have downloaded all of the parts, extract them all into a new directory on your disk. Then go to the <a href="gui.htm#config_paths_spc7110" title="Description of the Setup Paths menu">Config-->Paths menu</a> in the <a href="gui.htm" title="Description of the GUI">GUI</a> and enter in the location of the folder in the appropriate field.</p>
</div>
<div class="section" id="special_chip_srtc">
<h4>S-RTC</h4>
<ul>
<li>Daikaijuu Monogatari II</li>
</ul>
</div>
<div class="section" id="special_chip_superfx">
<h4>SuperFX</h4>
<ul>
<li>Dirt Racer</li>
<li>Dirt Trax FX</li>
<li>Doom</li>
<li>Star Fox (USA / Japan) / Starwing (Europe)</li>
<li>Stunt Race FX (USA / Europe) / Wild Trax (Japan)</li>
<li>Super Mario World 2: Yoshi's Island</li>
<li>Vortex</li>
<li>Winter Gold</li>
</ul>
<p><strong>ZSNES does not support interleaved SuperFX ROMs!</strong> An interleaved ROM is one in which the data is arranged differently than in the original, real SNES cartridge. While ZSNES has the ability to read the most common types of interleaved ROMs, it cannot read interleaved SuperFX ROMs, or even determine that they are interleaved.</p>
<p>You can use <a href="support.htm#utilities_nsrt" title="Nach's SNES ROM Tools">NSRT</a> to deinterleave your SuperFX ROMs, or if you prefer, all your ROMs. Consequently, the creator of NSRT (Nach) has also written a <a href="http://nsrt.edgeemu.com/forum/kb.php?mode=article&amp;k=2" title="The Grand Document on the many SNES Interleave Algorithms">document</a> about the technical details of interleaved SNES ROMs, if you are interested.</p>
</div>
</div>
<div class="section" id="special_carts">
<h3>Special Cartridges</h3>
<p>The approximate percentage of emulation progress for these special cartridges is listed under <a href="readme.htm#current_progress_add_ons" title="Emulation status of add-on devices">Current Progress</a>.</p>
<div class="section" id="special_carts_samegame">
<h4>Same Game; SD Gundam G-Next</h4>
<p>These were special games released only in Japan. They could be played by themselves, standing alone, but they could also be played with special additional cartridges, which plugged into the top of the main cartridge. These extra cartridges used the same form-factor as the BS-X memory cartridges, and they would improve or change the main game in some small way (similar to the <em class="game">Sonic and Knuckles</em> cartridge for Sega Genesis).</p>
<p>You can play the original cartridges by themselves by loading them like any normal ROM. In order to play these games as if they had an expansion cartridge plugged in, you must first configure the paths to the base cartridge ROMs under <a href="gui.htm#config_paths" title="Description of the Setup Paths dialog">Config -> Paths</a>. After defining the path to the base ROMs, you can now load the expansion ROM like any normal ROM. ZSNES will virtually "plug in" the expansion ROM to the base ROM, and load both of them at the same time.</p>
<p>The <a href="support.htm#utilities_nsrt" title="Nach's SNES ROM Tools">NSRT</a> file names for these ROMs are <code class="file">SAMEGAME.SFC</code> and <code class="file">G-NEXT.SFC</code>, respectively.</p>
</div>
<div class="section" id="special_carts_st">
<h4>Sufami Turbo</h4>
<p><a href="http://www.gamersgraveyard.com/repository/snes/peripherals/sufamiturbo.html" title="Sufami Turbo page at Gamers Graveyard">Gamers Graveyard</a> has some pictures and information on the Sufami Turbo.</p>
<p>The Sufami Turbo is a special add-on, manufactured by Bandai, and released only in Japan. The games were sold on small, GameBoy-sized mini-cartridges, two of which could simultaneously be plugged into the Sufami Turbo main cartridge. Certain combinations of games could interact with each other.</p>
<p>To emulate the Sufami Turbo, you will first need the Sufami Turbo BIOS. You must configure the path to this BIOS under <a href="gui.htm#config_paths" title="Description of the Setup Paths dialog">Config -> Paths</a>.</p>
<p>The <a href="support.htm#utilities_nsrt" title="Nach's SNES ROM Tools">NSRT</a> file name for the Sufami Turbo BIOS is <code class="file">STBIOS.BIN</code>.</p>
<p>If you use NSRT, your Sufami Turbo ROMs will have <code class="file">.st</code> extensions. In order to load two ROMs at once (to emulate two simultaneously loaded cartridges), you must use the command line. As an example, you would type in <kbd>zsnesw.exe "C:\Path\To\ROMs\sufami turbo rom 1.st" "C:\Path\To\ROMs\sufami turbo rom 2.st"</kbd>. Note that you must type the FULL path to both ROM images. The example is specific to the Windows command line and ZSNES port, but you get the idea.</p>
<p>You may occasionally come across a Sufami Turbo ROM that is hacked to include the BIOS with it. Use <a href="support.htm#utilities_nsrt" title="Nach's SNES ROM Tools">NSRT</a> with the -split command to separate the BIOS from the ROM. This will give you at least two separate files: one will be the game, and the other will be the BIOS. You may even get 3 files: Two games and one BIOS. After you have separated the BIOS and the game(s), simply follow the directions stated above.</p>
</div>
</div>
<div class="section" id="satellaview">
<h3>Broadcast Satellaview (BS-X)</h3>
<p>Please read the <a href="http://en.wikipedia.org/wiki/Satellaview" title="Satellaview article on Wikipedia">Satellaview</a> article on <a href="http://en.wikipedia.org/" title="Wikipedia.org">Wikipedia</a> for additional information.</p>
<p>This add-on was released only in Japan. It allowed gamers to connect to a satellite feed at certain times of the day, which would transmit games to the Super Famicom. Downloaded games were optionally stored on a small, eight-megabit mini-cartridge, which plugged into the top of the BS-X main cartridge (which in turn plugged directly into the Super Famicom). Many games, some of which had time limits, were made exclusively for the BS Satellaview.</p>
<p><a href="readme.htm#current_progress_add_ons" title="Current emulation progress of special add-on devices">Currently</a>, ZSNES can partially emulate the BS-X; some games will have graphics glitches, some games can be coaxed into running by changing certain settings, but some games won't run at all.</p>
<p>Also note that there is a BIOS for the BS-X. You <em>may</em> configure the path to the BS-X BIOS under <a href="gui.htm#config_paths" title="Description of the Setup Paths dialog">Config -> Paths</a>; however, it's not currently required to run BS games. It may be required in the future.</p>
<p>The <a href="support.htm#utilities_nsrt" title="Nach's SNES ROM Tools">NSRT</a> file name for the BS-X BIOS is <code class="file">BS Satellaview BS-X (BIOS) (J).sfc</code>.</p>
</div>
<div class="section" id="super_gameboy">
<h3>Super GameBoy</h3>
<p><strong>The Super GameBoy is not emulated. There are currently no plans to support it.</strong> This is because the Super GameBoy cartridge contains a complete set of GameBoy hardware (without screen and speakers, of course). Thus, to fully support the Super GameBoy, ZSNES would have to emulate both the SNES and a GameBoy. In addition, there are some very complex interactions between the Super GameBoy and SNES hardware that are not yet fully understood.</p>
<p>"But wait," you say, "I have a Super GameBoy BIOS! Won't this allow ZSNES to emulate a Super GameBoy?"</p>
<p>The answer is "no." The BIOS you have is only the software for the Super GameBoy, not the hardware, and thus is no help in emulating the Super GameBoy hardware. In the meantime, there are some GameBoy emulators, such as <a href="http://kigb.emuunlim.com" title="KiGB : The GameBoy Emulator">KiGB</a>, <a href="http://bgb.bircd.org" title="BGB Home Page">BGB</a>, and <a href="http://vba.ngemu.com" title="VisualBoyAdvance Home Page">VisualBoyAdvance</a>, that faithfully support some of the more useful features of the Super GameBoy.</p>
</div>
<div class="section" id="individual_games">
<h3>Individual Game Issues</h3>
<div class="section">
<h4>Chrono Trigger</h4>
<p><strong>How do you get past the part in <em class="game">Chrono Trigger</em> where you have to press the L, R, and A buttons?</strong></p>
<p>Assign two or all three of these SNES controller buttons to the same keyboard key. You can do this under <a href="gui.htm#config_input" title="Description of the Input Device dialog">Config Menu -> Input</a>. Please read <a href="gui.htm#config_input_keyboard_limitations" title="Limitations of using a keyboard for playing SNES games">this note</a> about keyboard limitations.</p>
</div>
<div class="section">
<h4>Star Ocean</h4>
<p>This game is difficult to emulate correctly, and there are also bugs within the game itself. The battles in the game are emulated at an incorrect speed, and the game will often freeze or crash randomly. You may encounter more issues. You can find detailed information about the bugs in this game at <a href="http://www.rpgclassics.com/shrines/snes/so1/bugs.shtml" title="Star Ocean Bugs at RPG Classics">RPGClassics</a>.</p>
<p>For best results, we recommend that you use an emulator that runs the game more accurately, such as <a href="http://www.snes9x.com" title="Snes9X Home Page">Snes9x</a>.</p>
</div>
</div>
<div class="section" id="manymouse_games">
<h3>Games Supported by ManyMouse</h3>
<p>ZSNES supports Ryan C. Gordon's <a href="http://icculus.org/manymouse/" title="ManyMouse Home Page">ManyMouse</a> library, which allows you to take advantage of games that support usage of two SNES add-on devices at once. You will need two mice plugged into your computer.</p>
<p>Here is a list of known games that support two SNES add-on devices simultaneously:</p>
<ul>
<li><em class="game">Arkanoid - Doh It Again</em></li>
<li><em class="game">Bishoujo Senshi Sailor Moon S - Kondo ha Puzzle de Oshiokiyo!</em></li>
<li><em class="game">Fun 'N Games</em></li>
<li><em class="game">Koutetsu no Kishi</em> (and its two sequels)</li>
<li><em class="game">Lamborghini - American Challenge</em></li>
<li><em class="game">Lord Monarch</em></li>
<li><em class="game">Motoko-chan no Wonder Kitchen</em></li>
<li><em class="game">Operation Thunderbolt</em></li>
<li><em class="game">Revolution X</em></li>
<li><em class="game">Shien's Revenge</em></li>
<li><em class="game">Super Castles</em></li>
<li><em class="game">T2 - The Arcade Game</em></li>
<li><em class="game">Tin Star</em></li>
<li><em class="game">Tokimeki Memorial</em></li>
</ul>
<p>Linux users should remember to type <code>chmod a+r /dev/input/*</code> at the shell after both mice are plugged in.</p>
<p>This feature is not implemented in the DOS port.</p>
<p>ManyMouse currently does not support BSD either, so Windows, Linux, or Mac OS X is required.</p>
</div>
<div class="section" id="multiplayer">
<h3>List of Multiplayer Games</h3>
<p>Please note that this list does not include any sports games (since they are easy to recognize and most of them are multiplayer). It also does not include games with only 2-player alternating modes nor games that require the SNES Mouse/Super Scope. Also, this list does not generally have sequels or other derivatives listed; if the original is listed here, it's likely its sequels and derivatives support multiplayer, too.</p>
<p>This list is not necessarily complete.</p>
<ul>
<li><em class="game">Aero Fighters</em></li>
<li><em class="game">Art of Fighting</em></li>
<li><em class="game">Battletoads in Battlemaniacs</em></li>
<li><em class="game">Battletoads vs DoubleDragon</em></li>
<li><em class="game">Brawl Brothers</em></li>
<li><em class="game">Brutal: Paws of Fury</em></li>
<li><em class="game">Captain Commando</em></li>
<li><em class="game">Clay Fighter</em></li>
<li><em class="game">Contra 3</em></li>
<li><em class="game">Darius Twin</em></li>
<li><em class="game">Double Dragon 5</em></li>
<li><em class="game">Dragonball Z Super Butoden</em></li>
<li><em class="game">Dragonball Z Hyper Dimension</em></li>
<li><em class="game">Faceball</em></li>
<li><em class="game">Fatal Fury</em></li>
<li><em class="game">Fighter's History</em></li>
<li><em class="game">Final Fight 2</em> &amp; <em class="game">3</em></li>
<li><em class="game">Ghoul Patrol</em></li>
<li><em class="game">Goemon</em></li>
<li><em class="game">Goof Troop</em></li>
<li><em class="game">Gundam Wing: Endless Duel</em></li>
<li><em class="game">Joe &amp; Mac</em></li>
<li><em class="game">Jurassic Park 2 - The Chaos Continues</em></li>
<li><em class="game">Killer Instinct</em></li>
<li><em class="game">King of Dragons</em></li>
<li><em class="game">King of the Monsters</em></li>
<li><em class="game">Kirby's Avalanche</em></li>
<li><em class="game">Kirby's Dreamland 3</em></li>
<li><em class="game">Kirby Super Star</em></li>
<li><em class="game">Legend of the Mystical Ninja</em></li>
<li><em class="game">Lemmings</em></li>
<li><em class="game">Megaman 7</em> (Secret Code - password 1415/5585/7823/6251 and press L+R+Start)</li>
<li><em class="game">Metal Warriors</em></li>
<li><em class="game">Mortal Kombat</em></li>
<li><em class="game">Ms. Pac-Man</em></li>
<li><em class="game">NP Mario Picross Series</em></li>
<li><em class="game">Peace Keapers</em></li>
<li><em class="game">Pirates of the Dark Water</em></li>
<li><em class="game">Pocky &amp; Rocky</em></li>
<li><em class="game">Pop'n Twinbee</em></li>
<li><em class="game">Power Instinct</em></li>
<li><em class="game">Primal Rage</em></li>
<li><em class="game">Puzzle Bobble</em></li>
<li><em class="game">Raiden</em></li>
<li><em class="game">Rampart</em></li>
<li><em class="game">Ranma 1/2</em></li>
<li><em class="game">Rise of the Robots</em></li>
<li><em class="game">Rival Turf</em></li>
<li><em class="game">Rock N' Roll Racing</em></li>
<li><em class="game">Run Saber</em></li>
<li><em class="game">Sailor Moon</em></li>
<li><em class="game">Samurai Shodown</em></li>
<li><em class="game">Secret of Mana</em></li>
<li><em class="game">Seiken Densetsu 3</em></li>
<li><em class="game">Shaq Fu</em></li>
<li><em class="game">Star Fox 2</em></li>
<li><em class="game">Star Trek Starfleet Academy</em></li>
<li><em class="game">Street Fighter 2</em></li>
<li><em class="game">Street Fighter 2 Turbo</em></li>
<li><em class="game">Street Fighter Alpha 2</em></li>
<li><em class="game">Street Racer</em></li>
<li><em class="game">Stunt Race FX</em></li>
<li><em class="game">Sunset Riders</em></li>
<li><em class="game">Super Bomberman</em></li>
<li><em class="game">Super Mario All-Stars</em> (SMB3 minigame)</li>
<li><em class="game">Super Mario Kart</em></li>
<li><em class="game">Super Mario World 2: Yoshi's Island</em> (At map, press X,X,Y,B,A)</li>
<li><em class="game">Super Offroad</em></li>
<li><em class="game">Super Smash TV</em></li>
<li><em class="game">Super Street Fighter 2</em></li>
<li><em class="game">Suzuka 8 Hours</em></li>
<li><em class="game">Teenage Mutant Ninja Turtles 4 - Turtles in Time</em></li>
<li><em class="game">Teenage Mutant Ninja Turtles 5 - Tournament Fighters</em></li>
<li><em class="game">Tetris</em></li>
<li><em class="game">The Great Circus Mystery</em></li>
<li><em class="game">Top Gear 2</em></li>
<li><em class="game">Top Gear 3000</em></li>
<li><em class="game">Tuff E Nuff</em></li>
<li><em class="game">Ultimate Mortal Kombat 3</em></li>
<li><em class="game">Uniracers</em></li>
<li><em class="game">Wild Guns</em></li>
<li><em class="game">World Heroes</em></li>
<li><em class="game">Wrecking Crew '98</em></li>
<li><em class="game">Zombies Ate My Neighbors</em></li>
</ul>
</div>
</div>
<div id="footer">
<h2>Footer</h2>
<p>This documentation is best viewed in a standards-compliant web browser, like <a href="http://www.mozilla.com" title="Mozilla Corporation home page">Firefox</a> or <a href="http://www.opera.com" title="Opera web browser home page">Opera</a>.</p>
<a href="http://sourceforge.net" title="SourceForge.net"><img style="border:0;width:88px;height:31px" src="http://sflogo.sourceforge.net/sflogo.php?group_id=127354&amp;type=1" alt="SourceForge.net Logo" /></a>
<a href="http://sourceforge.net/donate/index.php?group_id=19677" title="Donate to the ZSNES Project"><img style="border:0;width:88px;height:32px" src="http://images.sourceforge.net/images/project-support.jpg" alt="Support This Project" /> </a>
<span class="web_only">
<a href="http://validator.w3.org/check?uri=referer" title="Validate this page's HTML"><img style="border:0;width:88px;height:31px" src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0 Strict" /></a>
<a href="http://jigsaw.w3.org/css-validator/check/referer" title="Validate this page's CSS"><img style="border:0;width:88px;height:31px" src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!" /></a>
</span>
<p><a href="license.htm" title="View the General Public License">Copyright (C) ZSNES Team &amp; ZSNES Documentation Team</a></p>
</div>
</div>
</body>
</html>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 922 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

View File

@@ -0,0 +1,181 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>ZSNES Documentation Index</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="styles/print.css" media="print" type="text/css" />
<link rel="stylesheet" href="styles/radio.css" title="Radio's style" media="screen" type="text/css" />
<link rel="alternate stylesheet" href="styles/jipcy.css" title="Jipcy's style" media="screen" type="text/css" />
<link rel="alternate stylesheet" href="styles/plaintxt.css" title="Plain Text" media="screen" type="text/css" />
<link rel="contents" href="index.htm" title="Index" />
<link rel="start" href="readme.htm" title="Readme" />
<link rel="next" href="readme.htm" title="Readme" />
<link rel="help" href="support.htm" title="Getting Support" />
<link rel="copyright" href="license.htm" title="GNU General Public License" />
</head>
<body>
<div id="header">
<a href="readme.htm" title="ZSNES Documentation Home"><img id="logo" src="images/zsneslogo.png" alt="The ZSNES Logo" /></a>
<h1>ZSNES v1.51 Documentation</h1>
</div>
<div id="nav_column">
<div id="navigation">
<h2>Navigation</h2>
<ul class="navigation_list">
<li><a href="index.htm" title="ZSNES Documentation Index">Index</a></li>
<li><a href="readme.htm" title="General documentation">Readme</a></li>
<li><a href="gui.htm" title="Description of the GUI and its options">GUI</a></li>
<li><a href="netplay.htm" title="Documentation for Netplay">Netplay</a></li>
<li><a href="advanced.htm" title="Advanced Usage">Advanced Usage</a></li>
<li><a href="games.htm" title="Information about Games">Games</a></li>
<li><a href="faq.htm" title="Frequently Asked Questions">FAQ</a></li>
</ul>
<hr />
<ul>
<li><a href="support.htm" title="How to get support">Getting Support</a></li>
<li><a href="history.htm" title="The log of changes to ZSNES">History</a></li>
<li><a href="about.htm" title="A brief description of the ZSNES emulator and ZSNES documentation projects">About</a></li>
<li><a href="license.htm" title="GNU General Public License">License</a></li>
</ul>
<hr />
<ul>
<li><a href="http://zsnes-docs.sourceforge.net/nsrt" title="NSRT Guide">NSRT Guide</a></li>
<li><a href="http://www.zsnes.com" title="ZSNES Home Page on the Web">ZSNES.com</a></li>
</ul>
</div>
</div>
<div id="content_column">
<div id="content">
<h2>Index</h2>
<div class="section">
<ul>
<li><a href="index.htm" title="ZSNES Documentation Index">Index</a></li>
<li><a href="readme.htm" title="General documentation">Readme</a>
<ul>
<li><a href="readme.htm#disclaimer">Disclaimer</a></li>
<li><a href="readme.htm#current_progress">Current Progress</a></li>
<li><a href="readme.htm#extra_features">Extra Features</a></li>
<li><a href="readme.htm#system_requirements">System Requirements</a></li>
<li><strong><a href="readme.htm#installation">Installation</a></strong></li>
<li><a href="readme.htm#basic_usage">Basic Usage</a></li>
<li><a href="readme.htm#default_keys">Default Keys</a></li>
<li><a href="readme.htm#save_states">Save States</a></li>
<li><a href="readme.htm#movies">Movies</a></li>
<li><a href="readme.htm#ips_patching">IPS Patching</a></li>
<li><a href="readme.htm#cheat_codes">Cheat Codes</a></li>
<li><a href="readme.htm#files">Files</a></li>
</ul>
</li>
<li><a href="gui.htm" title="Description of the GUI and its options">GUI</a>
<ul>
<li><a href="gui.htm#game_menu">Game Menu</a></li>
<li><a href="gui.htm#quick_menu">Quick Menu</a></li>
<li><a href="gui.htm#config_menu">Config Menu</a></li>
<li><a href="gui.htm#cheat_menu">Cheat Menu</a></li>
<li><a href="gui.htm#netplay_menu">Netplay Menu</a></li>
<li><a href="gui.htm#misc_menu">Misc Menu</a></li>
<li><a href="gui.htm#f1_menu">F1 Menu</a></li>
<li><a href="gui.htm#save_slot_chooser">Save Slot Chooser</a></li>
</ul>
</li>
<li><a href="netplay.htm" title="Documentation for Netplay">Netplay</a>
<ul>
<li><a href="netplay.htm#things_to_know">Things To Know</a></li>
<li><a href="netplay.htm#system_recommendations">Recommendations</a></li>
<li><a href="netplay.htm#instructions">Simple Instructions</a></li>
<li><a href="netplay.htm#loading">Loading a Game</a></li>
<li><a href="netplay.htm#configuring">Configuring</a></li>
<li><a href="netplay.htm#troubleshooting">Troubleshooting</a></li>
</ul>
</li>
<li><a href="advanced.htm" title="Advanced Usage">Advanced Usage</a>
<ul>
<li><a href="advanced.htm#movie_dumping">Movie Dumping</a></li>
<li><a href="advanced.htm#config_files">Configuration Files</a></li>
<li><a href="advanced.htm#debugger">Debugger</a></li>
<li><a href="advanced.htm#kitchensync">KitchenSync</a></li>
<li><a href="advanced.htm#command_line">Command-Line</a></li>
</ul>
</li>
<li><a href="games.htm" title="Information about Games">Games</a>
<ul>
<li><a href="games.htm#roms">ROMs</a></li>
<li><a href="games.htm#compatibility">Compatibility</a></li>
<li><a href="games.htm#special_chip">Special-Chip Games</a></li>
<li><a href="games.htm#special_carts">Special Cartridges</a></li>
<li><a href="games.htm#satellaview">BS-X (Satellaview)</a></li>
<li><a href="games.htm#super_gameboy">Super Gameboy</a></li>
<li><a href="games.htm#individual_games">Individual Game Issues</a></li>
<li><a href="games.htm#manymouse_games">Games Supported by ManyMouse</a></li>
<li><a href="games.htm#multiplayer">Multiplayer List</a></li>
</ul>
</li>
<li><a href="faq.htm" title="Frequently Asked Questions">FAQ</a>
<ul>
<li><a href="faq.htm#universal">Universal</a></li>
<li><a href="faq.htm#win">Win Port</a></li>
<li><a href="faq.htm#sdl">SDL Port</a></li>
<li><a href="faq.htm#dos">DOS Port</a></li>
</ul>
</li>
</ul>
<hr />
<ul>
<li><a href="support.htm" title="How to get support">Getting Support</a>
<ul>
<li><a href="support.htm#utilities">APIs and Utilities</a></li>
<li><a href="support.htm#contact_information">Contact Information</a></li>
<li><a href="support.htm#known_issues">Known Issues</a></li>
<li><a href="support.htm#filing_a_bug_report">Filing a Bug Report</a></li>
</ul>
</li>
<li><a href="history.htm" title="The log of changes to ZSNES">History</a></li>
<li><a href="about.htm" title="A brief description of the ZSNES emulator and ZSNES documentation projects">About</a>
<ul>
<li><a href="about.htm#about_zsnes">ZSNES</a></li>
<li><a href="about.htm#about_docs">Documentation</a></li>
<li><a href="about.htm#credits">Credits</a></li>
</ul>
</li>
<li><a href="license.htm" title="GNU General Public License">License</a></li>
</ul>
</div>
</div>
<div id="footer">
<h2>Footer</h2>
<p>This documentation is best viewed in a standards-compliant web browser, like <a href="http://www.mozilla.com" title="Mozilla Corporation home page">Firefox</a> or <a href="http://www.opera.com" title="Opera web browser home page">Opera</a>.</p>
<a href="http://sourceforge.net" title="SourceForge.net"><img style="border:0;width:88px;height:31px" src="http://sflogo.sourceforge.net/sflogo.php?group_id=127354&amp;type=1" alt="SourceForge.net Logo" /></a>
<a href="http://sourceforge.net/donate/index.php?group_id=19677" title="Donate to the ZSNES Project"><img style="border:0;width:88px;height:32px" src="http://images.sourceforge.net/images/project-support.jpg" alt="Support This Project" /> </a>
<span class="web_only">
<a href="http://validator.w3.org/check?uri=referer" title="Validate this page's HTML"><img style="border:0;width:88px;height:31px" src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0 Strict" /></a>
<a href="http://jigsaw.w3.org/css-validator/check/referer" title="Validate this page's CSS"><img style="border:0;width:88px;height:31px" src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!" /></a>
</span>
<p><a href="license.htm" title="View the General Public License">Copyright (C) ZSNES Team &amp; ZSNES Documentation Team</a></p>
</div>
</div>
</body>
</html>

View File

@@ -0,0 +1,562 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>GNU General Public License - ZSNES Documentation</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="styles/print.css" media="print" type="text/css" />
<link rel="stylesheet" href="styles/radio.css" title="Radio's style" media="screen" type="text/css" />
<link rel="alternate stylesheet" href="styles/jipcy.css" title="Jipcy's style" media="screen" type="text/css" />
<link rel="alternate stylesheet" href="styles/plaintxt.css" title="Plain Text" media="screen" type="text/css" />
<link rel="contents" href="index.htm" title="Index" />
<link rel="start" href="readme.htm" title="Readme" />
<link rel="previous" href="about.htm" title="About" />
<link rel="help" href="support.htm" title="Getting Support" />
<link rel="copyright" href="license.htm" title="GNU General Public License" />
<style type="text/css">
.section ol {
list-style-type: none;
}
.section ol li {
margin-bottom: 1em;
}
</style>
</head>
<body>
<div id="header">
<a href="readme.htm" title="ZSNES Documentation Home"><img id="logo" src="images/zsneslogo.png" alt="The ZSNES Logo" /></a>
<h1>ZSNES v1.51 Documentation</h1>
</div>
<div id="nav_column">
<div id="navigation">
<h2>Navigation</h2>
<ul class="navigation_list">
<li><a href="index.htm" title="ZSNES Documentation Index">Index</a></li>
<li><a href="readme.htm" title="General documentation">Readme</a></li>
<li><a href="gui.htm" title="Description of the GUI and its options">GUI</a></li>
<li><a href="netplay.htm" title="Documentation for Netplay">Netplay</a></li>
<li><a href="advanced.htm" title="Advanced Usage">Advanced Usage</a></li>
<li><a href="games.htm" title="Information about Games">Games</a></li>
<li><a href="faq.htm" title="Frequently Asked Questions">FAQ</a></li>
</ul>
<hr />
<ul>
<li><a href="support.htm" title="How to get support">Getting Support</a></li>
<li><a href="history.htm" title="The log of changes to ZSNES">History</a></li>
<li><a href="about.htm" title="A brief description of the ZSNES emulator and ZSNES documentation projects">About</a></li>
<li><a href="license.htm" title="GNU General Public License">License</a></li>
</ul>
<hr />
<ul>
<li><a href="http://zsnes-docs.sourceforge.net/nsrt" title="NSRT Guide">NSRT Guide</a></li>
<li><a href="http://www.zsnes.com" title="ZSNES Home Page on the Web">ZSNES.com</a></li>
</ul>
</div>
</div>
<div id="content_column">
<div id="content">
<h2>GNU General Public License</h2>
<div class="section">
<h3>Table of Contents</h3>
<ul>
<li><a id="TOC1" href="#SEC1">GNU GENERAL PUBLIC LICENSE</a>
<ul>
<li><a id="TOC2" href="#SEC2">Preamble</a></li>
<li><a id="TOC3" href="#SEC3">TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION</a></li>
<li><a id="TOC4" href="#SEC4">How to Apply These Terms to Your New Programs</a></li>
</ul>
</li>
</ul>
</div>
<div class="section">
<h3><a id="SEC1" href="#TOC1">GNU GENERAL PUBLIC LICENSE</a></h3>
<p>Version 2, June 1991</p>
<pre>
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
</pre>
</div>
<div class="section">
<h3><a id="SEC2" href="#TOC2">Preamble</a></h3>
<p>
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
</p>
<p>
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
</p>
<p>
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
</p>
<p>
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
</p>
<p>
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
</p>
<p>
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
</p>
<p>
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
</p>
<p>
The precise terms and conditions for copying, distribution and
modification follow.
</p>
</div>
<div class="section">
<h3><a id="SEC3" href="#TOC3">TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION</a></h3>
<p>
<strong>0.</strong>
This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
</p>
<p>
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
</p>
<p>
<strong>1.</strong>
You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
</p>
<p>
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
</p>
<p>
<strong>2.</strong>
You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
</p>
<ol>
<li><strong>a)</strong>
You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
</li>
<li><strong>b)</strong>
You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
</li>
<li><strong>c)</strong>
If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
</li>
</ol>
<p>
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
</p>
<p>
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
</p>
<p>
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
</p>
<p>
<strong>3.</strong>
You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
</p>
<ol>
<li><strong>a)</strong>
Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
</li>
<li><strong>b)</strong>
Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
</li>
<li><strong>c)</strong>
Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
</li>
</ol>
<p>
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
</p>
<p>
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
</p>
<p>
<strong>4.</strong>
You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
</p>
<p>
<strong>5.</strong>
You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
</p>
<p>
<strong>6.</strong>
Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
</p>
<p>
<strong>7.</strong>
If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
</p>
<p>
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
</p>
<p>
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
</p>
<p>
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
</p>
<p>
<strong>8.</strong>
If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
</p>
<p>
<strong>9.</strong>
The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
</p>
<p>
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
</p>
<p>
<strong>10.</strong>
If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
</p>
<p><strong>NO WARRANTY</strong></p>
<p>
<strong>11.</strong>
BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
</p>
<p>
<strong>12.</strong>
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
</p>
<p><strong>END OF TERMS AND CONDITIONS</strong></p>
</div>
<div class="section">
<h3><a id="SEC4" href="#TOC4">How to Apply These Terms to Your New Programs</a></h3>
<p>
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
</p>
<p>
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
</p>
<pre>
&lt;one line to give the program's name and a brief idea of what it does.>
Copyright (C) &lt;year> &lt;name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
</pre>
<p>Also add information on how to contact you by electronic and paper mail.
</p>
<p>If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
</p>
<pre>
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
</pre>
<p>The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
</p>
<p>You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
</p>
<pre>
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
&lt;signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
</pre>
<p>This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.
</p>
</div>
</div>
<div id="footer">
<h2>Footer</h2>
<p>This documentation is best viewed in a standards-compliant web browser, like <a href="http://www.mozilla.com" title="Mozilla Corporation home page">Firefox</a> or <a href="http://www.opera.com" title="Opera web browser home page">Opera</a>.</p>
<a href="http://sourceforge.net" title="SourceForge.net"><img style="border:0;width:88px;height:31px" src="http://sflogo.sourceforge.net/sflogo.php?group_id=127354&amp;type=1" alt="SourceForge.net Logo" /></a>
<a href="http://sourceforge.net/donate/index.php?group_id=19677" title="Donate to the ZSNES Project"><img style="border:0;width:88px;height:32px" src="http://images.sourceforge.net/images/project-support.jpg" alt="Support This Project" /> </a>
<span class="web_only">
<a href="http://validator.w3.org/check?uri=referer" title="Validate this page's HTML"><img style="border:0;width:88px;height:31px" src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0 Strict" /></a>
<a href="http://jigsaw.w3.org/css-validator/check/referer" title="Validate this page's CSS"><img style="border:0;width:88px;height:31px" src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!" /></a>
</span>
<p><a href="license.htm" title="View the General Public License">Copyright (C) ZSNES Team &amp; ZSNES Documentation Team</a></p>
</div>
</div>
</body>
</html>

View File

@@ -0,0 +1,171 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Netplay - ZSNES Documentation</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="styles/print.css" media="print" type="text/css" />
<link rel="stylesheet" href="styles/radio.css" title="Radio's style" media="screen" type="text/css" />
<link rel="alternate stylesheet" href="styles/jipcy.css" title="Jipcy's style" media="screen" type="text/css" />
<link rel="alternate stylesheet" href="styles/plaintxt.css" title="Plain Text" media="screen" type="text/css" />
<link rel="contents" href="index.htm" title="Index" />
<link rel="start" href="readme.htm" title="Readme" />
<link rel="previous" href="gui.htm" title="GUI" />
<link rel="next" href="advanced.htm" title="Advanced Usage" />
<link rel="help" href="support.htm" title="Getting Support" />
<link rel="copyright" href="license.htm" title="GNU General Public License" />
</head>
<body>
<div id="header">
<a href="readme.htm" title="ZSNES Documentation Home"><img id="logo" src="images/zsneslogo.png" alt="The ZSNES Logo" /></a>
<h1>ZSNES v1.51 Documentation</h1>
</div>
<div id="nav_column">
<div id="navigation">
<h2>Navigation</h2>
<ul class="navigation_list">
<li><a href="index.htm" title="ZSNES Documentation Index">Index</a></li>
<li><a href="readme.htm" title="General documentation">Readme</a></li>
<li><a href="gui.htm" title="Description of the GUI and its options">GUI</a></li>
<li><a href="netplay.htm" title="Documentation for Netplay">Netplay</a>
<ul>
<li><a href="#things_to_know">Things To Know</a></li>
<li><a href="#system_recommendations">Recommendations</a></li>
<li><a href="#instructions">Simple Instructions</a></li>
<li><a href="#loading">Loading a Game</a></li>
<li><a href="#configuring">Configuring</a></li>
<li><a href="#troubleshooting">Troubleshooting</a></li>
</ul>
</li>
<li><a href="advanced.htm" title="Advanced Usage">Advanced Usage</a></li>
<li><a href="games.htm" title="Information about Games">Games</a></li>
<li><a href="faq.htm" title="Frequently Asked Questions">FAQ</a></li>
</ul>
<hr />
<ul>
<li><a href="support.htm" title="How to get support">Getting Support</a></li>
<li><a href="history.htm" title="The log of changes to ZSNES">History</a></li>
<li><a href="about.htm" title="A brief description of the ZSNES emulator and ZSNES documentation projects">About</a></li>
<li><a href="license.htm" title="GNU General Public License">License</a></li>
</ul>
<hr />
<ul>
<li><a href="http://zsnes-docs.sourceforge.net/nsrt" title="NSRT Guide">NSRT Guide</a></li>
<li><a href="http://www.zsnes.com" title="ZSNES Home Page on the Web">ZSNES.com</a></li>
</ul>
</div>
</div>
<div id="content_column">
<div id="content">
<h2>Netplay</h2>
<div class="section">
<p><strong>Netplay has been disabled for the indefinite future, until the core becomes more accurate and/or non-random. We recommend using ZSNES v1.36 or <a href="http://nsrt.edgeemu.com/forum/viewtopic.php?t=448" title="ZSNES Enhanced Netplay Edition">v1.42n</a> until this is resolved.</strong></p>
</div>
<div class="section" id="things_to_know" style="display:none">
<h3>Things To Know</h3>
<ul>
<li>ZSNES currently limits Netplay to two computers. Up to five players can still play, however (by having more than one physical player at either of the two computers).</li>
<li>A game must be on each computer in order to have it available for Netplay.</li>
<li>You cannot use cheat codes, key combinations, or turbo keys in Netplay.</li>
</ul>
</div>
<div class="section" id="system_recommendations" style="display:none">
<h3>System Recommendations for Smooth Netplay</h3>
<ul>
<li>Both users must use the <em>same version</em> of ZSNES (e.g. Both users should be using v1.36).</li>
<li>Both users should be using reasonably fast computers (about 800mhz). If one user has a slow computer (e.g. 200mhz) while the other has a fast one, the slow computer's low framerate will bog down the fast computer, causing poor framerates on the fast computer.</li>
<li>Both users should be using the same setting for sound (either enabled or disabled; see <a href="gui.htm#config_sound" title="Description of the sound options in the GUI">the Config-->Sound menu in the GUI</a> or the ZSNES <a href="advanced.htm#config_files" title="Description of the Configuration Files">configuration file</a>).</li>
<li><a href="gui.htm#netplay_backbuffer" title="Description of the Back Buffer option in the GUI">Back Buffer</a> must be enabled and the <a href="gui.htm#netplay_latency" title="Description of the Latency option in the GUI">latency value</a> must be 3 or 2 (reduce it to 2 for fast-paced platform games).</li>
<li>The games have to run at least 50 FPS on BOTH computers without Netplay. This can completely depend on factors such as CPU, video card, video mode, and the game you are running. (See <a href="readme.htm#system_requirements">System Requirements</a>).</li>
<li>Both users must use the same <a href="gui.htm#netplay_protocol" title="Description of the Protocol setting in the GUI">protocol setting</a> (either UDP or TCP). If both players are on the same LAN, you should use UDP (it has lower overhead). Otherwise, use TCP (no packet loss).</li>
<li>You will also need an Internet connection with ping times of less than 400ms between both connections. The higher than ping time, the worse the Netplay experience, since ping times measure the time it takes for data to get to the other side and back. You can expect a not-so-great performance if you have a ping time of 400 or greater.</li>
</ul>
</div>
<div class="section" id="instructions" style="display:none">
<h3>Simple Instructions</h3>
<ol>
<li>Go to Netplay -> Internet.</li>
<li>Decide who will be the server and who will be the client. (Neither has the gameplay advantage since ZSNES treats both the same after a connection is established).</li>
<li>If you are the server, send the IP that is shown on the connection window to your friend (e.g. through any chat program (ICQ, AIM, IRC, etc.)). Then click on 'Start Server'.</li>
<li>If you are the client, type in the IP address that your friend has given you and then click on 'Connect to Server'.</li>
<li>Chat with your friend on what game to play.</li>
<li>Once decided, make sure that the filename on both sides are the same and that the load window points to the directory where the filename is.</li>
<li><a href="#loading_a_game" title="Instructions on loading a game in Netplay">Load the game</a>.</li>
<li>Have fun! (If it worked)</li>
<li>If it said 'Checksum Mismatch', try uncompressing the file if it is compressed. If not, then both sides have a different version of that ROM (e.g. One side has the Japanese version while the other has the English, or both versions are English, but are different version releases of the same game).</li>
<li>If you want to chat in-game, press 'T' and type in your line. You can change this key in the Misc -> Misc Keys options from the GUI.</li>
</ol>
</div>
<div class="section" id="loading" style="display:none">
<h3>Loading a Game</h3>
<p>Once successfully connected, the chat window should open up.</p>
<p>From there, you can load a game as you normally would. But in order to load a game, both sides must have their load window pointing to the directory where the game is located and also have identical filenames for the game. Only one side has to load the game; after that, the other side will automatically load the game without the user's interaction.</p>
<p>If an error pops up saying 'ROM data mismatch', then it means that either side has a different version of the ROM. This error sometimes happens with compressed files even when both files are the same, so it is recommended that you uncompress the games and try again if this error occurs.</p>
</div>
<div class="section" id="configuring" style="display:none">
<h3>Configuring Options</h3>
<p>The default settings are recommended.</p>
<p>However, if your computer is slower than 266 MHz, then it is recommended that both sides play with back buffer disabled. Note that disabling this will degrade controller response.</p>
<p>You can increase the latency value if the average ping time between both connections is high (you can tell if the gameplay runs too jerky).</p>
<p>Reducing the latency value when back buffer is enabled will improve controller response time. However, this will cause the remote player to jump around more in order to keep both sides in sync.</p>
<p>For controller options (PL1, PL2, PL3,..), the first checkmarked player would be using Input #1 of the local side. The second checkmarked player would be using Input #2 and so on. Players marked with an 'X' are checkmarked on the remote side.</p>
</div>
<div class="section" id="troubleshooting" style="display:none">
<h3>Troubleshooting</h3>
<ul>
<li>If you are the client, and it failed to connect, check to make sure that the IP you entered is correct and that you are properly connected to the Internet.</li>
<li>If you are the server, and the IP provided in the connection window doesn't seem to be the correct one, you can visit <a title="View your IP address" href="http://www.whatismyipaddress.com">http://www.whatismyipaddress.com</a> to determine the correct one. Then tell your client what it is so he or she can connect. Alternatively, if you're using mIRC, just type /dns &lt;nick>.</li>
<li>If the client says 'Found Client' and nothing else happens, chances are that your net connection does not support UDP. If this is the case, both sides will need to uncheck 'Use UDP Instead of TCP'. However, it is strongly recommended that you use UDP if possible since it is much faster than TCP.</li>
<li>If you have Windows 95 and you are getting a init failed error, you should download and install the <a title="Windows Socket 2 Update from Microsoft.com" href="http://www.microsoft.com/Windows95/downloads/contents/WUAdminTools/S_WUNetworkingTools/W95Sockets2/Default.asp">Winsock 2.0 update for Windows 95</a>. Warning: Do not install this if you do not have Windows 95.</li>
<li>You may need to disable your firewall (or just disable it for UDP port 7845) in order to get the UDP protocol that ZSNES's Netplay uses to work.</li>
<li>Internet Connection Sharing users (Win9x systems) may need to download an ICS configuration utility to get the connection to work and map UDP port 7845. You can use <a title="ICS Configuration Home Page" href="http://www.practicallynetworked.com/sharing/ics/icsconfiguration.htm">"ICS Configuration"</a>.</li>
<li>If you need help forwarding your router port, you may refer to AntoineWG's Router Port Forwarding Guide. It is currently available in <a href="http://board.zsnes.com/phpBB2/viewtopic.php?t=3679" title="AntoineWG's Router Port Forwarding Guide">this thread</a> on the <a href="http://board.zsnes.com" title="Official ZSNES Message Board">ZSNES Message Board</a>.</li>
<li>Tips for reducing general slowdown can be found under "Why is ZSNES slow?" in the Speed section of the <a title="Frequently Asked Questions" href="faq.htm#universal_speed_slow">FAQ</a> page.</li>
</ul>
</div>
</div>
<div id="footer">
<h2>Footer</h2>
<p>This documentation is best viewed in a standards-compliant web browser, like <a href="http://www.mozilla.com" title="Mozilla Corporation home page">Firefox</a> or <a href="http://www.opera.com" title="Opera web browser home page">Opera</a>.</p>
<a href="http://sourceforge.net" title="SourceForge.net"><img style="border:0;width:88px;height:31px" src="http://sflogo.sourceforge.net/sflogo.php?group_id=127354&amp;type=1" alt="SourceForge.net Logo" /></a>
<a href="http://sourceforge.net/donate/index.php?group_id=19677" title="Donate to the ZSNES Project"><img style="border:0;width:88px;height:32px" src="http://images.sourceforge.net/images/project-support.jpg" alt="Support This Project" /> </a>
<span class="web_only">
<a href="http://validator.w3.org/check?uri=referer" title="Validate this page's HTML"><img style="border:0;width:88px;height:31px" src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0 Strict" /></a>
<a href="http://jigsaw.w3.org/css-validator/check/referer" title="Validate this page's CSS"><img style="border:0;width:88px;height:31px" src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!" /></a>
</span>
<p><a href="license.htm" title="View the General Public License">Copyright (C) ZSNES Team &amp; ZSNES Documentation Team</a></p>
</div>
</div>
</body>
</html>

View File

@@ -0,0 +1,931 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Readme - ZSNES Documentation</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="styles/print.css" media="print" type="text/css" />
<link rel="stylesheet" href="styles/radio.css" title="Radio's style" media="screen" type="text/css" />
<link rel="alternate stylesheet" href="styles/jipcy.css" title="Jipcy's style" media="screen" type="text/css" />
<link rel="alternate stylesheet" href="styles/plaintxt.css" title="Plain Text" media="screen" type="text/css" />
<link rel="contents" href="index.htm" title="Index" />
<link rel="start" href="readme.htm" title="Readme" />
<link rel="previous" href="index.htm" title="Index" />
<link rel="next" href="gui.htm" title="GUI" />
<link rel="help" href="support.htm" title="Getting Support" />
<link rel="copyright" href="license.htm" title="GNU General Public License" />
</head>
<body>
<div id="header">
<a href="readme.htm" title="ZSNES Documentation Home"><img id="logo" src="images/zsneslogo.png" alt="The ZSNES Logo" /></a>
<h1>ZSNES v1.51 Documentation</h1>
</div>
<div id="nav_column">
<div id="navigation">
<h2>Navigation</h2>
<ul class="navigation_list">
<li><a href="index.htm" title="ZSNES Documentation Index">Index</a></li>
<li><a href="readme.htm" title="General documentation">Readme</a>
<ul>
<li><a href="#disclaimer">Disclaimer</a></li>
<li><a href="#current_progress">Current Progress</a></li>
<li><a href="#extra_features">Extra Features</a></li>
<li><a href="#system_requirements">System Requirements</a></li>
<li><strong><a href="#installation">Installation</a></strong></li>
<li><a href="#basic_usage">Basic Usage</a></li>
<li><a href="#default_keys">Default Keys</a></li>
<li><a href="#save_states">Save States</a></li>
<li><a href="#movies">Movies</a></li>
<li><a href="#ips_patching">IPS Patching</a></li>
<li><a href="#cheat_codes">Cheat Codes</a></li>
<li><a href="#files">Files</a></li>
</ul>
</li>
<li><a href="gui.htm" title="Description of the GUI and its options">GUI</a></li>
<li><a href="netplay.htm" title="Documentation for Netplay">Netplay</a></li>
<li><a href="advanced.htm" title="Advanced Usage">Advanced Usage</a></li>
<li><a href="games.htm" title="Information about Games">Games</a></li>
<li><a href="faq.htm" title="Frequently Asked Questions">FAQ</a></li>
</ul>
<hr />
<ul>
<li><a href="support.htm" title="How to get support">Getting Support</a></li>
<li><a href="history.htm" title="The log of changes to ZSNES">History</a></li>
<li><a href="about.htm" title="A brief description of the ZSNES emulator and ZSNES documentation projects">About</a></li>
<li><a href="license.htm" title="GNU General Public License">License</a></li>
</ul>
<hr />
<ul>
<li><a href="http://zsnes-docs.sourceforge.net/nsrt" title="NSRT Guide">NSRT Guide</a></li>
<li><a href="http://www.zsnes.com" title="ZSNES Home Page on the Web">ZSNES.com</a></li>
</ul>
</div>
</div>
<div id="content_column">
<div id="content">
<h2>Readme</h2>
<div class="section">
<p>ZSNES is an open-source Super Nintendo Entertainment System emulator written in x86 assembly, C, and C++. Bleeding with cutting edge SNES emulation, ZSNES is easily comparable to other leading SNES emulators, such as <span id="snes_emus"><a href="http://www.snes9x.com" title="Snes9X Home Page">Snes9x</a>, <a href="http://sneese.sourceforge.net/" title="SNEeSe Home Page">SNEeSe</a>, <a href="http://users.tpg.com.au/advlink/spx/" title="Super Sleuth Home Page">Super Sleuth</a>, and <a href="http://www.byuu.org/" title="byuu's Home Page">bsnes</a></span>.</p>
<p>Special thanks to the Snes9x team for all of their help and also for the excellent SNES emulator they have developed. We wish them the very best of luck!</p>
</div>
<div class="section" id="disclaimer">
<h3>Disclaimer</h3>
<p>The ZSNES Development Team, including all developers and contributors, is in no way responsible for any damage caused by the use of this software. Please read the <a href="license.htm" title="GNU General Public License">license</a> for more details.</p>
<p>Due to legal issues, the ZSNES Development Team can provide you neither with <a href="games.htm#roms" title="Description of ROMs">ROMs</a> nor links to them. In addition, ZSNES <strong>may not be distributed with ROM images.</strong> However, as with many cases like this, <a href="http://www.google.com" title="Google.com web site">Google</a> is your friend.</p>
<p>There are still many bugs left in ZSNES, so don't expect it to run all your favorite games. If ZSNES doesn't work for you, then don't use it. Use Snes9x, SNEeSe, Super Sleuth, or bsnes instead! In fact, even if you use ZSNES, use those emulators too!</p>
</div>
<div class="section" id="current_progress">
<h3>Current Progress</h3>
<div class="section">
<h4>The following are implemented</h4>
<ul>
<li>Complete 65816 instruction set</li>
<li>SRAM support</li>
<li>LoROM and HiROM support</li>
<li>SlowROM and FastROM support</li>
<li>Full DMA support</li>
<li>HIRQ/VIRQ/NMI Interrupts</li>
<li id="rom_file_types">Support for several SNES file formats (SMC, SFC, SWC, FIG, MGD, MGH, UFO, BIN, GD3, GD7, DX2, USA, EUR, JAP, AUS, ST, BS, 048, 058, 078,), including split files (1, 2, 3; A, B, C)</li>
<li>Interleaved format support (<a href="games.htm#special_chip_superfx" title="Information about SuperFX emulation">except SuperFX games</a>)</li>
<li>PAL/NTSC timing support</li>
</ul>
</div>
<div class="section" id="graphics_engines">
<h4>Graphics engines (PPUs)</h4>
<div class="section">
<h5>The following are implemented in both graphics engines, all color modes:</h5>
<ul>
<li>Graphic modes 0,1,2,3,4,5,6,7</li>
<li>8x8, 16x16, 32x32, and 64x64 sprite support (flipped in all directions)</li>
<li>8x8 and 16x16 tiles</li>
<li>32x32,64x32,32x64,64x64 tile modes</li>
<li>Full HDMA effects for wavy backgrounds, interesting mode 7 effects, etc.</li>
<li>Mode 7 rotating and scaling effects</li>
<li>BG priorities</li>
<li>Sprite priorities</li>
<li>Add/sub of back area</li>
<li>Mosaic effects</li>
</ul>
</div>
<div class="section">
<h5>About the old graphics engine:</h5>
<ul>
<li>Line engine</li>
<li>Missing lots of windowing and DMA effects</li>
<li>More accurate at drawing some things</li>
<li>13-bit color rendering. (This is a compromise between color accuracy and speed. Not all transparencies will work correctly with this engine.)</li>
</ul>
<h5>What's available in the old graphics engine when using an 8-bit color video mode:</h5>
<ul>
<li>Offset per tile mode (mode 2/vertical only)</li>
<li>High-res 512 horizontal resolution (missing in 16x16)</li>
<li>Single and dual windowing routines</li>
</ul>
<h5>What's available in the old graphics engine when using a 16-bit color video mode:</h5>
<ul>
<li>Palette changing in the middle of a screen</li>
<li>Screen addition (full and half)</li>
<li>Screen subtraction (full)</li>
<li>Fixed color addition/subtraction</li>
<li>Window clipping for fixed color</li>
</ul>
</div>
<div class="section">
<h5>About the new graphics engine:</h5>
<ul>
<li>Tile engine</li>
<li>Nearly complete engine with a few bugs</li>
<li>Can draw mostly everything on the SNES</li>
<li>15-bit coloring</li>
</ul>
<h5>What's available in the new graphics engine when using an 8-bit color video mode:</h5>
<ul>
<li>Offset per tile mode (mode 2/vertical only, mode 4)</li>
<li>High res 512 resolution and 448/478 vertical resolution</li>
<li>Windowing effects</li>
<li>High resolution mode 7 (only in 640x480x256 video mode; active when all other video filters are disabled)</li>
</ul>
<h5>What's available in the new graphics engine when using a 16-bit color video mode:</h5>
<ul>
<li>All of old graphics engine 16-bit</li>
<li>High resolution mode 7</li>
<li>High resolution 16x16 tiles for mode 5</li>
<li>Full 15-bit color transparencies for improved picture quality (MMX compatible CPUs only)</li>
</ul>
</div>
</div>
<div class="section">
<h4>The following are present in sound:</h4>
<ul>
<li>16-bit digital stereo sound</li>
<li>SPC700 Sound CPU</li>
<li>DSP Sound Processor
<ul>
<li>Echo effects</li>
<li>FIR filter</li>
<li>ADSR volume effects</li>
<li>GAIN volume effects</li>
<li>Noise effects</li>
<li>Pitch modulation</li>
</ul>
</li>
</ul>
</div>
<div class="section">
<h4>The following special input devices are emulated:</h4>
<ul>
<li><a href="gui.htm#config_input" title="Description of the Input Device dialog">MultiTap (5-player support)</a></li>
<li><a href="gui.htm#config_devices" title="Description of the Devices Selector dialog">Super NES Mouse</a> (missing some features, such as speed settings)</li>
<li><a href="gui.htm#config_devices" title="Description of the Devices Selector dialog">Super NES Super Scope</a></li>
<li><a href="gui.htm#config_devices" title="Description of the Devices Selector dialog">Konami Lethal Enforcer Gun</a></li>
<li>Automatic configuration via <a href="support.htm#utilities_nsrt">NSRT</a> headers</li>
</ul>
</div>
<div class="section" id="current_progress_special_chips">
<h4>The following special cartridge processors are emulated, in whole or in part:</h4>
<table id="table_current_progress_special_chips" style="text-align: center">
<tr>
<th>Special Chip</th><th>Progress</th>
</tr>
<tr>
<td><a href="games.htm#special_chip_c4" title="Information about C4 emulation">C4</a></td><td>100%</td>
</tr>
<tr>
<td><a href="games.htm#special_chip_dsp1" title="Information about Nintendo DSP-1 emulation">Nintendo DSP-1</a></td><td>100%</td>
</tr>
<tr>
<td><a href="games.htm#special_chip_dsp2" title="Information about Nintendo DSP-2 emulation">Nintendo DSP-2</a></td><td>100%</td>
</tr>
<tr>
<td><a href="games.htm#special_chip_dsp3" title="Information about Nintendo DSP-3 emulation">Nintendo DSP-3</a></td><td>80%</td>
</tr>
<tr>
<td><a href="games.htm#special_chip_dsp4" title="Information about Nintendo DSP-4 emulation">Nintendo DSP-4</a></td><td>95%</td>
</tr>
<tr>
<td><a href="games.htm#special_chip_obc1" title="Information about OBC-1 emulation">OBC-1</a></td><td>100%</td>
</tr>
<tr>
<td><a href="games.htm#special_chip_sa1" title="Information about SA-1 emulation">SA-1</a></td><td>90%</td>
</tr>
<tr>
<td><a href="games.htm#special_chip_sdd1" title="Information about S-DD1 emulation">S-DD1</a></td><td>100%</td>
</tr>
<tr>
<td><a href="games.htm#special_chip_setadsp10" title="Information about Seta DSP-10 emulation">Seta DSP 10</a></td><td>99%</td>
</tr>
<tr>
<td><a href="games.htm#special_chip_setadsp11" title="Information about Seta DSP-11 emulation">Seta DSP 11</a></td><td>80%</td>
</tr>
<tr>
<td><a href="games.htm#special_chip_spc7110" title="Information about SPC7110 emulation">SPC7110</a></td><td>100% except decompression</td>
</tr>
<tr>
<td><a href="games.htm#special_chip_srtc" title="Information about S-RTC emulation">S-RTC</a></td><td>95%</td>
</tr>
<tr>
<td><a href="games.htm#special_chip_superfx" title="Information about SuperFX emulation">SuperFX</a></td><td>90%</td>
</tr>
</table>
</div>
<div class="section" id="current_progress_add_ons">
<h4>The following add-on devices are emulated:</h4>
<table id="table_current_progress_add_ons" style="text-align: center">
<tr>
<th>Special Cartridge / Add-On</th><th>Progress</th>
</tr>
<tr>
<td><a href="games.htm#satellaview" title="Information about Broadcast Satellaview emulation">Broadcast Satellaview (BS-X)</a></td><td>50%</td>
</tr>
<tr>
<td><a href="gui.htm#config_chipcfg" title="Description of Nintendo Super System settings">Nintendo Super System</a></td><td>100% except the menus</td>
</tr>
<tr>
<td><a href="games.htm#special_carts_samegame" title="Information about Same Game and SD Gundam G-Next emulation">Same Game, SD Gundam G-Next</a></td><td>100%</td>
</tr>
<tr>
<td><a href="games.htm#special_carts_st" title="Information about the Sufami Turbo emulation">Sufami Turbo</a></td><td>95%</td>
</tr>
</table>
</div>
<div class="section">
<h4>The following features are missing:</h4>
<ul>
<li>Pseudo 512 SNES horizontal resolution (no games are known to use this)</li>
<li>Some modes in offset per tile mode</li>
<li>Some direct color modes (no games are known to use these)</li>
<li><a href="games.htm#special_chip_setarisc" title="Information about Seta RISC emulation">Seta RISC chip</a></li>
<li><a href="games.htm#special_chip_spc7110" title="Information about SPC7110 emulation">True SPC7110 decompression</a></li>
<li><a href="games.htm#super_gameboy" title="Information about Super GameBoy emulation">Super GameBoy emulation</a></li>
</ul>
</div>
<div class="section">
<h4>What will not run (or not play properly):</h4>
<p>Please read our <a href="games.htm#compatibility" title="Statement on Game Compatibility">statement on game compatibility</a>.</p>
<ul>
<li>Some SuperFX games (<a href="games.htm#compatibility" title="Statement on Game Compatibility">regardless of interleave status</a>)</li>
<li>Interleaved <a href="games.htm#special_chip_superfx" title="Information about SuperFX emulation">SuperFX</a> games (deinterleave them with <a href="support.htm#utilities_nsrt" title="Nach's SNES ROM Tools">NSRT</a>)</li>
<li>Some <a href="games.htm#satellaview" title="Information about Broadcast Satellaview emulation">Broadcast Satellaview (BS-X)</a> games</li>
<li>Games with unknown co-processors</li>
<li>Games that don't have a valid header</li>
<li>Games that hit a severe bug in the 65816/PPU/SPC700/DSP routines</li>
<li>Games that require special timing</li>
</ul>
</div>
</div>
<div class="section" id="extra_features">
<h3>Extra Features</h3>
<ul>
<li>Support for <a href="readme.htm#save_states" title="Description of the Save States feature">save states</a>, including <a href="gui.htm#config_saves_keys_rewind" title="Description of the Rewind function">rewinding</a></li>
<li>Extensive movie <a href="readme.htm#movies" title="Description of the Movie feature">recording</a> and <a href="advanced.htm#movie_dumping" title="Description of the Movie Dumping features">dumping</a> features</li>
<li>Many emulation <a href="gui.htm#config_speed" title="Description of the Speed Options dialog">speed</a> options, including <a href="gui.htm#config_speed_autoframerate" title="Description of the Auto Frame Rate option">automatic frame skipping</a> to compensate for slower machines</li>
<li>Full <a href="readme.htm#cheat_codes" title="Description of the Cheat feature">cheat code</a> support (including Game Genie, Pro Action Replay, and GoldFinger)</li>
<li>Automatic <a href="readme.htm#ips_patching" title="Description of the IPS Patching feature">IPS soft-patching</a> (including up to 11 sequential patches)</li>
</ul>
<ul>
<li>Custom-built <a href="gui.htm" title="Description of the ZSNES GUI">GUI</a> with many time-saving features</li>
<li>Support for loading Zip, gZip, and <a href="support.htm#utilities_nsrt" title="Description of JMA format">JMA</a>-compressed <a href="games.htm#roms" title="Description of ROMs">ROMs</a></li>
<li><a href="gui.htm#game_load_random" title="Description of the random ROM loading feature">Randomized ROM loading</a></li>
<li>Support for <a href="gui.htm#config_input" title="Description of the Input Device dialog">input</a> from keyboards, joysticks, and gamepads, as well as a <a href="gui.htm#misc_keycomb" title="Description of the key combination editor">key combination editor</a></li>
<li>Many <a href="gui.htm#config_video" title="Description of the Video Config dialog">video</a> output options, including graphics-enhancing <a href="gui.htm#config_video_filters" title="Description of the Video Filter options">filters</a></li>
<li>Highly configurable <a href="gui.htm#config_sound" title="Description of the Sound Config dialog">sound</a> output options</li>
</ul>
<ul>
<li><a href="netplay.htm" title="Netplay Instructions">Netplay</a> (currently disabled)</li>
</ul>
<ul>
<li>User-editable <a href="advanced.htm#config_files" title="Description of the ZSNES configuration files">configuration files</a></li>
<li><a href="advanced.htm#debugger" title="Description of the Debugger">Debugger</a></li>
<li>Accepts <a href="advanced.htm#command_line" title="Description of the command-line arguments">command-line arguments</a></li>
</ul>
</div>
<div class="section" id="system_requirements">
<h3>System Requirements</h3>
<div class="section" id="system_requirements_os">
<h4>Supported operating systems</h4>
<div class="section">
<h5>Official Ports</h5>
<ul>
<li>Win port: Microsoft Windows 95/98/ME/2000/XP/2003/Vista</li>
<li><a href="support.htm#utilities_sdl" title="Description of the SDL API">SDL</a> port: Linux, BSD, Mac OS X, or Xbox running Linux</li>
<li>DOS port: Microsoft DOS (may work on other non-MS DOSes)</li>
</ul>
<h5>Un-Official Ports</h5>
<ul>
<li><a href="http://board.zsnes.com/phpBB2/viewtopic.php?t=6933" title="ZSNES Board thread about the Xbox port">ZsnexBox</a>: Microsoft Xbox (native)</li>
</ul>
</div>
</div>
<div class="section" id="system_requirements_cpu">
<h4>CPU requirements</h4>
<p>ZSNES absolutely requires a <strong>100% x86-compatible processor</strong>. You probably already meet this requirement. Most consumer-grade processors sold by Intel and AMD use the x86 instruction set.</p>
<p>Because much of ZSNES' source code is written in x86 assembly, it will only run on processors that are 100% x86 compatible. "Ports" to other architectures are impossible; we recommend <a href="http://www.snes9x.com" title="Snes9X Home Page">Snes9x</a> as the SNES emulator of choice for portability.</p>
<p>Playing a <a href="readme.htm#current_progress_special_chips" title="Current emulation progress of special chips">special chip</a> game will significantly increase CPU usage. For these games, you may require a processor faster than those listed below.</p>
</div>
<div class="section" id="system_requirements_free_space">
<h4>Free space requirements</h4>
<p>The program files alone require about 1MB. The amount of disk space required for other files varies greatly. For example, uncompressed <a href="games.htm#roms" title="Description of ROMs">ROMs</a> <strong>(not included!)</strong> require 256KB-6144KB each. <a href="readme.htm#save_states" title="Description of the Save States feature">Save states</a> typically require about 270KB each; however, this can increase up to an additional 200KB for <a href="readme.htm#current_progress_special_chips" title="Current emulation progress of special chips">special chip</a> games.</p>
</div>
<div class="section" id="system_requirements_win_port">
<h4>Win Port</h4>
<ul>
<li><strong>OS:</strong> Windows <a href="http://support.microsoft.com/kb/304297/" title="System requirements for Microsoft Windows operating systems">95/98/ME</a>
<ul>
<li><strong>CPU:</strong> Pentium II (or equivalent) 233MHz (500MHz recommended)</li>
<li><strong>RAM:</strong> 32MB (64MB recommended)</li>
</ul>
</li>
<li><strong>OS:</strong> Windows 2000/<a href="http://support.microsoft.com/kb/314865/" title="System requirements for Windows XP operating systems">XP</a>/2003/Vista
<ul>
<li><strong>CPU:</strong> Pentium II (or equivalent) 266MHz (500MHz recommended)</li>
<li><strong>RAM:</strong> 64MB of RAM (128MB recommended)</li>
</ul>
</li>
<li><strong>API:</strong> <a href="support.htm#utilities_directx" title="Description of DirectX">DirectX</a> v8.0a or later must be installed</li>
<li><strong>Video:</strong> any video card that supports DirectDraw (acceleration recommended)</li>
<li><strong>Sound:</strong> any sound card that supports DirectSound (acceleration recommended)</li>
</ul>
</div>
<div class="section" id="system_requirements_sdl_port">
<h4>SDL Port</h4>
<ul>
<li><strong>OS:</strong> Linux, BSD, or Mac OS X</li>
<li><strong>CPU:</strong> 266MHz (500MHz recommended, especially if using X)</li>
<li><strong>RAM:</strong> 32MB (64MB recommended; more if SDL is compiled to use X)</li>
<li><strong>API:</strong> <a href="support.htm#utilities_sdl" title="Description of SDL">SDL</a> v1.20 or later</li>
<li><strong>Video:</strong> almost any video card will work (hardware OpenGL support and acceleration highly recommended)</li>
<li><strong>Sound:</strong> any sound card supported by SDL (using ALSA or OSS)</li>
</ul>
</div>
<div class="section" id="system_requirements_dos_port">
<h4>DOS Port</h4>
<ul>
<li><strong>OS:</strong> Microsoft DOS (some non-MS DOSes may work)</li>
<li><strong>CPU:</strong> Pentium II (or equivalent) 233MHz</li>
<li><strong>RAM:</strong> 32MB (minimum of 17MB free, required for loading 48mbit ROMs)</li>
<li><strong>Video:</strong> VGA card
<ul>
<li>For 16-bit color and therefore proper support of transparencies, an SVGA card with VESA 2 and Linear Frame Buffer support is required.</li>
<li>You may be able to use <a href="support.htm#utilities_scitech" title="Scitech Display Doctor">Scitech Display Doctor</a> to enable VESA 2 support on some cards that don't already support it.</li>
</ul>
</li>
<li><strong>Sound:</strong> Sound Blaster Pro or 100% compatible (SB16 or 100% compatible recommended)</li>
</ul>
<p>These system requirements assume you are running the DOS port under pure DOS. If you are using the DOS port from within Windows, the CPU and RAM requirements will be the same as for the <a href="readme.htm#system_requirements_win_port" title="System Requirements for the Win port">Win port</a>.</p>
</div>
</div>
<div class="section" id="installation">
<h3>Installation</h3>
<div class="section">
<h4>Win/DOS Port</h4>
<div class="section">
<h5>Installation:</h5>
<ol>
<li>Download the latest version of ZSNES from <a href="http://www.zsnes.com/index.php?page=files" title="ZSNES.com files page">ZSNES.com</a>. The file you download is an archive containing the ZSNES binary file and documentation.</li>
<li>Extract the contents of the archive into a new folder on your hard drive. Do not simply overwrite an older version of ZSNES.</li>
<li>You can now run ZSNES by executing the ZSNES binary, named <code class="file">zsnesw.exe</code> (Windows) or <code class="file">zsnes.exe</code> (DOS). ZSNES is not packaged with an installer, so there will be no entry in the Windows Start Menu.</li>
</ol>
<p><strong>Note:</strong> In Windows, you can create a shortcut to ZSNES to make it easier to open the program. Right-click on the <code class="file">zsnesw.exe</code> icon to bring up the context menu, and left-click <code>Create Shortcut</code>. A shortcut to the executable file will appear in the folder. You can now move the newly-created shortcut to your Desktop or Start Menu. Opening the shortcut will run ZSNES from its original location.</p>
</div>
<div class="section">
<h5>Re-Installation / Reset to default settings:</h5>
<p>If you find that you are experiencing a number of unexplained errors in ZSNES, or if you wish to reset all settings back to their defaults, simply delete the <a href="advanced.htm#config_files" title="Description of the configuration files">configuration files</a> that were generated by ZSNES the first time you ran the program.</p>
</div>
<div class="section">
<h5>Un-Installation:</h5>
<p>If you wish to uninstall ZSNES, simply delete the entire folder (and thus, all files contained within) into which you installed ZSNES (as described in Step 2 of Installation, above).</p>
<p>-or-</p>
<p>If you have since put additional files (such as <a href="games.htm#roms" title="Description of ROMs">ROMs</a>) into your ZSNES install folder, and do not wish to delete or move them, you will have to delete the individual ZSNES files. Please refer to the <a href="readme.htm#files" title="Description of the files related to ZSNES">Files</a> section for information on individual files and file types related to ZSNES. You will also need to delete the <code class="file">docs</code> folder.</p>
<p><strong>Note:</strong> ZSNES does not use the <a href="http://support.microsoft.com/kb/256986" title="Description of the Microsoft Windows registry">Windows registry</a>, nor does it generate "hidden" configuration files all over your system.</p>
</div>
</div>
<div class="section">
<h4>SDL Port / Compiling from source</h4>
<ul>
<li>Download the latest source release of ZSNES from <a href="http://www.zsnes.com/index.php?page=files" title="ZSNES.com files page">ZSNES.com</a>.</li>
<li>After unpacking, navigate to the <code class="file">src</code> directory and run the following commands:
<ul>
<li><kbd>./configure --enable-release</kbd></li>
<li><kbd>make</kbd></li>
</ul>
And as root:
<ul>
<li><kbd>make install</kbd></li>
</ul>
</li>
<li>Other, more detailed instructions are provided in the <code class="file">docs/install.txt</code> file.</li>
</ul>
</div>
<div class="section">
<h5>Un-Installation:</h5>
<p>If you wish to uninstall ZSNES, you can run <kbd>make uninstall</kbd> as root if you still have your <code class="file">Makefile</code>.</p>
<p>Otherwise, you will need to navigate to <code class="file">/usr/local/bin</code> and delete <code class="file">zsnes</code>. Then navigate to <code class="file">/usr/local/man/man1</code> and delete <code class="file">zsnes.1</code>. Or just delete the <code class="file">man1</code> directory if you have nothing else in it.</p>
<p>You will need root access to perform the above actions.</p>
<p>You will also need to delete <code class="file">~/.zsnes</code> or <code class="file">~/Library/Application Support/ZSNES</code> in Mac OS X. Do note that <a href="readme.htm#files" title="Description of the files related to ZSNES">various files</a> are saved in here by default (such as game saves); be sure to back them up if you want to keep them.</p>
</div>
</div>
<div class="section" id="basic_usage">
<h3>Basic Usage</h3>
<ol>
<li><a href="readme.htm#installation" title="How to Install ZSNES">Install</a> ZSNES.</li>
<li>Run ZSNES.
<ul>
<li>If you're using Windows, double-click on <a href="readme.htm#files_executable" title="Read about the filenames for the ZSNES executable file">the executable file</a>.</li>
<li>If you're using DOS, navigate to the ZSNES installation folder and type <kbd>zsnes.exe</kbd> at the command line.</li>
</ul>
</li>
<li>Configure the input settings (<a href="gui.htm#config_input" title="Description of the Input Device dialog">Config Menu -> Input</a>) as desired, or use <a href="readme.htm#default_keys" title="The default keys for controlling games and the emulator">the default settings</a>.</li>
<li>Configure the video settings (<a href="gui.htm#config_video" title="Description of the Video Config dialog">Config Menu -> Video</a>) as desired, or use the default settings.</li>
<li>Configure path settings (<a href="gui.htm#config_paths" title="Description of the Setup Paths dialog">Config Menu -> Paths</a>) if you don't want all the automatically generated files going into the same directories as your <a href="games.htm#roms" title="Description of ROMs">ROMs</a>.</li>
<li>Load a game (<a href="gui.htm#game_load" title="Description of the Load Game dialog">Game Menu -> Load</a>) and start playing.</li>
<li>When you are ready to stop playing, you have a number of choices to save your game.
<ul>
<li>If your game has its own native save function, just use it.</li>
<li>If your game does not have a save function, or you are at a point in the game where you can't save, you can create a <a href="readme.htm#save_states" title="Description of the save state feature">save state</a>. Do this by pressing <kbd class="key">F2</kbd>.</li>
</ul>
</li>
<li>After you save your game:
<ul>
<li>You can load a new game using the same steps as above, or</li>
<li>Exit the emulator by going to <a href="gui.htm#game_quit" title="Description of the Quit menu option">Game Menu -> Quit</a>.</li>
</ul>
</li>
<li>When you are ready to return to a previously saved game, just re-load that game.
<ul>
<li>Load an in-game save in the normal way.</li>
<li>If you saved a state, you can load that state by pressing <kbd class="key">F4</kbd>.</li>
</ul>
</li>
</ol>
<p>This section only covers very basic usage. Please read the entire documentation for more information.</p>
</div>
<div class="section" id="default_keys">
<h3>Default Keys</h3>
<div class="section" id="default_keys_game">
<h4>Game Keys</h4>
<p>You can change the default keys for the standard SNES controller under <a href="gui.htm#config_input" title="Description of the Input Device dialog">Config->Input</a>.</p>
<table id="table_default_keys_pad">
<tr>
<th>SNES Button</th><th>Player 1 Key</th><th>Player 2 Key</th>
</tr>
<tr>
<td>D-Pad Up</td><td>Arrow Up</td><td><kbd class="key">J</kbd></td>
</tr>
<tr>
<td>D-Pad Down</td><td>Arrow Down</td><td><kbd class="key">M</kbd></td>
</tr>
<tr>
<td>D-Pad Left</td><td>Arrow Left</td><td><kbd class="key">N</kbd></td>
</tr>
<tr>
<td>D-Pad Right</td><td>Arrow Right</td><td><kbd class="key">,</kbd></td>
</tr>
<tr>
<td>Start</td><td><kbd class="key">Return</kbd> / <kbd class="key">Enter</kbd></td><td>Left <kbd class="key">Ctrl</kbd></td>
</tr>
<tr>
<td>Select</td><td>Right <kbd class="key">Shift</kbd></td><td>Left <kbd class="key">Alt</kbd></td>
</tr>
<tr>
<td>A</td><td><kbd class="key">X</kbd></td><td><kbd class="key">Home</kbd></td>
</tr>
<tr>
<td>B</td><td><kbd class="key">Z</kbd></td><td><kbd class="key">End</kbd></td>
</tr>
<tr>
<td>X</td><td><kbd class="key">S</kbd></td><td><kbd class="key">Insert</kbd></td>
</tr>
<tr>
<td>Y</td><td><kbd class="key">A</kbd></td><td><kbd class="key">Delete</kbd></td>
</tr>
<tr>
<td>L (Left Shoulder)</td><td><kbd class="key">D</kbd></td><td><kbd class="key">Page Up</kbd></td>
</tr>
<tr>
<td>R (Right Shoulder)</td><td><kbd class="key">C</kbd></td><td><kbd class="key">Page Down</kbd></td>
</tr>
</table>
<p>You can change the default keys for special input devices under <a href="gui.htm#config_devices" title="Description of the Devices Selector dialog">Config->Devices</a>.</p>
<p>The special input devices just use input from your mouse for movement and aiming.</p>
<table id="table_default_keys_scope">
<tr>
<th>Super Scope Button</th><th>Computer/Mouse Button</th>
</tr>
<tr>
<td>Fire</td><td>Left mouse button</td>
</tr>
<tr>
<td>Cursor Mode Button</td><td>Right mouse button</td>
</tr>
<tr>
<td>Toggle Auto-fire</td><td><kbd class="key">=</kbd></td>
</tr>
<tr>
<td>Pause</td><td><kbd class="key">Backspace</kbd></td>
</tr>
</table>
</div>
<div class="section" id="default_keys_emulator">
<h4>Emulator Keys</h4>
<table id="table_default_keys_emulator">
<tr>
<th>Key</th><th>Function</th><th>Where to Customize</th>
</tr>
<tr>
<td><kbd class="key">Esc</kbd></td><td>When a game is loaded, toggle the GUI (pauses emulation while GUI visible).</td><td>Cannot be changed</td>
</tr>
<tr>
<td><kbd class="key">F1</kbd></td><td>Open the <a href="gui.htm#f1_menu" title="Description of the F1 Menu">F1 Quick Menu.</a></td><td>Cannot be changed</td>
</tr>
<tr>
<td><kbd class="key">F2</kbd></td><td>Save a state to current slot.</td><td><a href="gui.htm#config_saves_keys" title="Key configuration for save functions">Config->Saves</a></td>
</tr>
<tr>
<td><kbd class="key">F3</kbd></td><td>Open the <a href="gui.htm#save_slot_chooser" title="Description of the Save State Chooser dialog">save state slot chooser</a>.</td><td><a href="gui.htm#config_saves_keys" title="Key configuration for save functions">Config->Saves</a></td>
</tr>
<tr>
<td><kbd class="key">F4</kbd></td><td>Load a save state from the current slot.</td><td><a href="gui.htm#config_saves_keys" title="Key configuration for save functions">Config->Saves</a></td>
</tr>
<tr>
<td><kbd class="key">F5</kbd> &lt;--&gt; <kbd class="key">F12</kbd></td><td>Toggle sound channels 1 through 8, respectively</td><td><a href="gui.htm#misc_misckeys_sound">Misc->Misc Keys</a></td>
</tr>
<tr>
<td><kbd class="key">1</kbd> <kbd class="key">2</kbd> <kbd class="key">3</kbd> <kbd class="key">4</kbd></td><td>Toggle background layers 1, 2, 3, and 4, respectively</td><td><a href="gui.htm#misc_misckeys_bglayers">Misc->Misc Keys</a></td>
</tr>
<tr>
<td><kbd class="key">5</kbd></td><td>Toggle sprite/object layer</td><td><a href="gui.htm#misc_misckeys_bglayers">Misc->Misc Keys</a></td>
</tr>
<tr>
<td><kbd class="key">6</kbd></td><td>Panic Key - Reset all switches to default (enable Offset Mode, Windowing, all background layers, sprite/object layer, and sound channels; disable Add-on Devices; reset Emulation Speed Throttle)</td><td><a href="gui.htm#misc_misckeys_misctoggles">Misc->Misc Keys</a></td>
</tr>
<tr>
<td><kbd class="key">8</kbd></td><td>Toggle <a href="gui.htm#config_options_newgfx" title="Description of the New Graphics Engine option">New Graphics Engine</a></td><td><a href="gui.htm#misc_misckeys_gfxtoggles">Misc->Misc Keys</a></td>
</tr>
<tr>
<td><kbd class="key">9</kbd></td><td>Toggle Windowing</td><td><a href="gui.htm#misc_misckeys_gfxtoggles">Misc->Misc Keys</a></td>
</tr>
<tr>
<td><kbd class="key">0</kbd></td><td>Toggle Offset Mode</td><td><a href="gui.htm#misc_misckeys_gfxtoggles">Misc->Misc Keys</a></td>
</tr>
<tr>
<td><kbd class="key">T</kbd></td><td>While using Netplay, press to open the Chat window</td><td><a href="gui.htm#misc_misckeys_quick">Misc->Misc Keys</a></td>
</tr>
<tr>
<td><kbd class="key">~</kbd></td><td>Fast Forward</td><td><a href="gui.htm#config_speed_fastforward">Config->Speed</a></td>
</tr>
<tr>
<td><kbd class="key">P</kbd></td><td><a href="gui.htm#config_saves_pause" title="Descriptions of two options in the GUI that pause emulation">Pause Emulation</a></td><td><a href="gui.htm#config_speed_pause">Config->Speed</a></td>
</tr>
</table>
<p>Note: Besides these default keys, there are many other keys that you can configure in the GUI.</p>
</div>
</div>
<div class="section" id="save_states">
<h3>Save States</h3>
<p><strong>Warning:</strong> If you care about your progress in a game, remember to use in-game saves regularly! Do not rely solely on save states!</p>
<p>When you "save a state," ZSNES creates a file that contains the values of all the variables that change while ZSNES is emulating a game. These values are specific to the exact moment that you saved the state. You can then load a save state at a later time, thus returning ZSNES to the exact point in the game when you saved the state originally. This allows you to save your progress at a point that might not normally be possible with in-game saves, or in games that don't have in-game saves at all.</p>
<p>Save states are typically not compatible between emulators, and sometimes not even between different versions of the same emulator, often due to internal core changes. In fact, it should be noted that save states created prior to <a href="history.htm#v0600" title="Changelog for ZSNES v0.600">v0.600</a> of ZSNES will not work in current versions.</p>
<p>To remedy this problem, first load the state in any version of ZSNES from v0.600 to v1.42. Then, immediately after loading, save another state. The new state you just created should (hopefully) load correctly in ZSNES v1.50 and higher.</p>
<p>Since ZSNES does not support save states created by any other SNES emulator, you can instead use the emulator-independent SRAM (.srm) data to transfer game progress from one emulator to another.</p>
<p>Each ZSNES save state is approximately 270KB in size. <a href="readme.htm#current_progress_special_chips" title="Current emulation progress of special chips">Special chip</a> games may require an additional 200KB, however.</p>
<div class="section">
<h4>How to Use Save States</h4>
<p>You can create and load save states using the <a href="gui.htm#game_savestate" title="Description of the Save State menu item">GUI</a>.</p>
<p>It's much easier to just use the <a href="readme.htm#default_keys_emulator" title="Description of the default emulator keys">default quick keys</a> for these features. Press <kbd class="key">F2</kbd> to save, <kbd class="key">F4</kbd> to load, and <kbd class="key">F3</kbd> to open the <a href="gui.htm#save_slot_chooser" title="Description of the Save State Chooser dialog">save state slot chooser</a> (with graphical preview). However, if you don't like that method, many other save and load techniques are available.</p>
<p>Configure general save behavior under <a href="gui.htm#config_saves" title="Description of the Save Options dialog">Config->Saves</a>. Configure save paths under <a href="gui.htm#config_paths" title="Description of the Setup Paths dialog">Config->Paths</a>.</p>
</div>
</div>
<div class="section" id="movies">
<h3>Movies</h3>
<p><strong>Warning:</strong> Playing back a previously recorded movie will overwrite any SRAM data for the current game with the SRAM data contained in the ZMV file. This means you should enable <a href="gui.htm#config_saves_do_not_save_sram" title="Description of the Do Not Save SRAM option">Do Not Save SRAM</a> when playing around with movies!!</p>
<p>Note that re-recording, chapters, and appending will not work with movies recorded in the old ZMV format (movies made prior to ZSNES v1.50).</p>
<p>For descriptions of the <a href="gui.htm#misc_movie" title="Description of the Movie Options dialog">Movie Options dialog</a>, please refer to the <a href="gui.htm" title="Description of the GUI">GUI</a> page.</p>
<div class="section">
<h4>About Movies</h4>
<p>The ZSNES movie format (ZMV) has been completely rewritten and is now better and more feature-rich than before, with the most capabilities yet implemented in an emulator. Three of the most notable new features are re-recording, dumping ZMVs to AVI, and movie subtitles, described below.</p>
<p>A movie file consists of a <a href="readme.htm#save_states" title="Description of the Save State feature">save state</a>, SRAM data (when applicable), and the recorded controller data, as well as any chapters (states) that have been inserted. It also keeps track of a few other things which are negligible with regard to the overall filesize. Movie files should record at less than 1KB/minute (60KB/hour).</p>
<p>ZSNES should be able to record most actions you can do with a real SNES, including resetting. During playback, the game will reset just as you did during recording.</p>
</div>
<div class="section">
<h4>Limitations</h4>
<p>You cannot record games that use the Konami Justifier <a href="gui.htm#config_devices" title="Description of the Input Deviced dialog">special input device</a>. <em class="game">Lethal Enforcers</em> is the only game known to require this device.</p>
<p>You cannot record games while using <a href="netplay.htm" title="Description of the Netplay feature">Netplay</a>.</p>
<p>You should be able to record ZSNES movies for all game types; however, ZMVs are heavily dependant on save states, so any games that exhibit problems while using save states will also exhibit problems when recording and playing movies.</p>
<p>For best results, you should play back movies with the same version of ZSNES that was used to record them. Otherwise, keypresses may become desynchronized from the emulation playback.</p>
</div>
<div class="section">
<h4>Re-Recording</h4>
<p>You do not have to do everything perfectly the first time you record a movie. ZSNES allows you to re-record parts of a movie, inserting the newly recorded parts seamlessly into the previously recorded parts. You can accomplish this in a number of ways:</p>
<ul>
<li>While <a href="gui.htm#misc_movie_maincontrols" title="Description of the movie playback controls">playing back</a> a movie, start <a href="gui.htm#misc_movie_maincontrols" title="Description of the movie playback controls">recording</a> again.</li>
<li>Use save states while recording movies. Loading the states will allow you to re-record.</li>
<li>You can use the rewind key to go back in movies. The rewind key can be configured under the <a href="gui.htm#config_saves" title="Description of the Save Options dialog">Config->Saves</a> menu.</li>
</ul>
</div>
<div class="section">
<h4>Chapters</h4>
<p>You can insert chapters into your movies, to which you can seek during movie playback.</p>
<p>You are limited to 65535 (2<sup>16</sup>-1) chapters created during recording, in addition to 65535 (2<sup>16</sup>-1) created during playback.</p>
</div>
<div class="section" id="movies_subtitles">
<h4>Subtitles</h4>
<p>Subtitles allow you to create a short message that will be visible on-screen during playback of a movie.</p>
<ol>
<li>Create an empty file in your <a href="gui.htm#config_paths" title="Description of the Setup Paths dialog">save directory</a> (or wherever your movies are saved).</li>
<li>The subtitle file must be named in the following manner:
<ul>
<li>Subtitle file name = ZMV file name = ROM file name. (Example: <code class="filename">smw.sfc</code> (<em class="game">Super Mario World</em> ROM), <code class="filename">smw.zmv</code>, <code class="filename">smw.sub</code>).</li>
<li>If you are using movie slot <strong class="gui">0</strong>, file extension = <code class="filename">.sub</code>.</li>
<li>If you are using movie slot <strong class="gui">1</strong> through <strong class="gui">9</strong>, change the last letter of the extension to match the movie slot you are using. (Example: slot 1 = <code class="filename">.su1</code>, slot 5 = <code class="filename">.su5</code>, slot 9 = <code class="filename">.su9</code>).</li>
</ul>
</li>
<li>For each subtitle you want in the movie, add a new line to the subtitle file, with the following information:
<ul>
<li>Start Frame:Frame Duration:Message</li>
<li>For example: <kbd>10:100:Beating the Last Boss</kbd> without the quotes. In this example, the message "Beating the Last Boss" will appear in the tenth frame and stay visible for 100 frames (thus, until the 110th frame).</li>
<li>ZSNES can display only one subtitle at a time. So make sure that the start frame for the next subtitle is not during the duration time of the previous subtitle. You must also list your subtitles sequentially for all of them to be played (they cannot be out of order).</li>
<li>ZSNES can display a maximum of 34 characters (of a subtitle message) across the width of the screen.</li>
</ul>
</li>
<li>Now save your new subtitle file. Open ZSNES, play a movie, and you should see your subtitles appear!</li>
</ol>
</div>
<div class="section">
<h4>Movie Dumping</h4>
<p>See the <a href="advanced.htm#movie_dumping" title="Description of the movie dumping features">Movie Dumping</a> section of the <a href="advanced.htm" title="Advanced Usage">Advanced Usage</a> page for more information.</p>
</div>
</div>
<div class="section" id="ips_patching">
<h3>IPS Patching</h3>
<p><acronym title="International Patching System">IPS</acronym> patches are files that are applied to an original <a href="games.htm#roms" title="Description of ROMs">ROM</a>, which change the programming of the ROM in some way. They are primarily used to translate ROMs into another language; however, they can be used for a variety of purposes. Visit <a href="http://www.romhacking.net" title="Romhacking.net - Home of the Romh!">Romhacking.net</a> for more information about translations and ROM hacks.</p>
<p>ZSNES has the ability to automatically "soft-patch" a ROM. This means that after ZSNES loads a ROM into its memory, it will apply the IPS patch to the <strong>in-memory</strong> ROM data, <strong>not</strong> the ROM file on your hard disk. This <em>eliminates</em> the need to keep two copies of a ROM: the original, and the patched.</p>
<div class="section">
<h4>Applying a single IPS file to a ROM:</h4>
<ol>
<li>Make sure <strong class="gui">Enable Auto-Patch</strong> is checked in <a href="gui.htm#config_options" title="Description of the Options dialog">Config->Options</a>.</li>
<li>The IPS file must be either in your <a href="gui.htm#config_paths" title="Description of the Setup Paths dialog">Saves directory</a> or in the same directory as the ROM.</li>
<li>The IPS file and the ROM file must have matching filenames. For example, <code class="file">SD3.sfc</code> and <code class="file">SD3.ips</code>. If your ROM file is compressed, the IPS file must match the <strong>compressed</strong> filename. For example, if you have the file <code class="file">SD3.sfc</code> compressed inside the file <code class="file">Seiken Densetsu 3 (J).zip</code>, the IPS file must be named <code class="file">Seiken Densetsu 3 (J).ips</code>.</li>
<li>If you meet the above three conditions, just load your ROM file as normal, and ZSNES should automatically patch the IPS file to the in-memory ROM. Remember, your original ROM file will <strong>not</strong> be changed.</li>
<li>If you have done everything outlined in the steps above, and your game does not appear to be working, refer to the <a href="faq.htm#universal_games_ips" title="Frequently Asked Questions">FAQ</a>.</li>
</ol>
</div>
<div class="section">
<h4>Applying multiple IPS files to a ROM:</h4>
<p>ZSNES has the ability to apply up to eleven separate IPS files to the same ROM file. You must give each IPS file a specific extension to tell ZSNES in what order to apply them. Aside from changing the extension of the IPS files, just follow the directions above.</p>
<table id="table_ips_extensions" style="text-align:center">
<tr>
<th>IPS file extension</th><th>Applied When?</th>
</tr>
<tr><td>ips</td><td>First</td></tr>
<tr><td>ip0</td><td>Second</td></tr>
<tr><td>ip1</td><td>Third</td></tr>
<tr><td>ip2</td><td>Fourth</td></tr>
<tr><td>ip3</td><td>Fifth</td></tr>
<tr><td>ip4</td><td>Sixth</td></tr>
<tr><td>ip5</td><td>Seventh</td></tr>
<tr><td>ip6</td><td>Eighth</td></tr>
<tr><td>ip7</td><td>Ninth</td></tr>
<tr><td>ip8</td><td>Tenth</td></tr>
<tr><td>ip9</td><td>Eleventh</td></tr>
</table>
<p>ZSNES will <em>not</em> apply non-sequentially extensioned IPS files. This means that if you have three IPS files, named <code class="file">patch.ips</code>, <code class="file">patch.ip0</code>, and <code class="file">patch.ip6</code>, ZSNES will only apply the first two.</p>
<p>Please remember that <strong>the order in which you apply the IPS patches may be important</strong>. Applying the patches in the wrong order may result in strange bugs, or even an unplayable game. Please refer to the documentation that accompanied your IPS file.</p>
</div>
<div class="section">
<h4>Alternative method of applying IPS files to compressed ROMs:</h4>
<p>The simplest method of applying an IPS file to a compressed ROM is to simply place the IPS file in the same archive as the ROM. The filename of the IPS file does <strong>not</strong> have to match the compressed or uncompressed filename of the ROM. <strong>Do not</strong> add more than one IPS file of a given extension to an archive. Results can be unpredictable as to which of the same-extension IPS files will be applied to the ROM.</p>
<p>If your ROM is compressed, ZSNES will first look for IPS files inside the archive. If it finds any, it will only load IPS files from inside the archive, and will not look anywhere else. Otherwise, ZSNES looks in the <a href="gui.htm#config_paths" title="Description of the Setup Paths dialog">Saves directory</a> and the same directory as the ROM.</p>
</div>
</div>
<div class="section" id="cheat_codes">
<h3>Cheat Codes</h3>
<p>Currently, ZSNES supports Game Genie, Pro Action Replay, and GoldFinger codes.</p>
<div class="section">
<h4>How to use cheat codes:</h4>
<ol>
<li>Load the ROM to which you want to apply cheats.</li>
<li>Press <kbd class="key">ESC</kbd> to toggle the <a href="gui.htm" title="Description of the GUI">GUI</a>. Open the <a href="gui.htm#cheat_addcode" title="Description of the Add Code dialog">Add Code</a> dialog from the <a href="gui.htm#cheat_menu" title="Description of the Cheat Menu">Cheat Menu</a>. You can enter up to 255 codes for each game.</li>
<li>After adding your codes, press <kbd class="key">ESC</kbd> until you are back to your game.</li>
</ol>
<p><strong>To use a multi-line cheat code, just enter each line as a separate code!</strong></p>
</div>
<div class="section">
<h4>How to use <code class="file">.cht</code> files:</h4>
<p>Place the <code class="file">.cht</code> file into the same directory as the ROM, or into your <a href="gui.htm#config_paths" title="Description of the Setup Paths dialog">Saves folder</a>. The <code class="file">.cht</code> file must be named according to <a href="readme.htm#files_naming_rules" title="The pattern used for naming files and extensions">the normal naming rules</a>.</p>
</div>
<div class="section">
<h4>Troubleshooting Cheat Codes</h4>
<ul>
<li>Try using the <strong class="gui">Fix</strong> button in the <a href="gui.htm#cheat_menu_browse" title="Description of the Browse Cheats dialog">Browse Cheats</a> dialog.</li>
<li>Some codes are meant to be used with different versions of the same game. If a cheat code doesn't work and there is one for both Game Genie and Pro Action Replay, try them both.</li>
<li>Remember that Game Genie codes require the <kbd>-</kbd> (dashes).</li>
<li>Try <a href="gui.htm#game_reset" title="Description of the Reset menu item">resetting</a> the game. Any code for a game that mentions a term similar to "Start with" means that the game must be reset in order to take effect.</li>
<li>If you are having a hard time with comparative searches, make sure to delete the <code class="file">tmpchtsr.___</code> file in your ZSNES directory.</li>
</ul>
</div>
</div>
<div class="section" id="files">
<h3>Files</h3>
<p>This section attempts to explain the various files that are created, loaded, or used by ZSNES.</p>
<div class="section" id="files_naming_rules">
<p>Most of the data files that are specific to individual <a href="games.htm#roms" title="Description of ROMs">ROMs</a> are named in the following manner:</p>
<ul>
<li>The filename of the data file is the same as the filename of the ROM from which it was created.</li>
<li>The file extension of the data file changes, depending on the following:
<ul>
<li>If there are no "slots" for the data file, then it is just the normal file extension (srm, bmp, png, raw, cht, cmb, cfg, txt).</li>
<li>If you are using slot 0, then it is just the normal file extension (zst, zmv, sub, ips, spc).</li>
<li>If you are using slots 1-9, then the last letter of the file extension changes to match the slot number (zs1-zs9).</li>
<li>If you are using slots 10-99, then the last <em>two</em> letters of the file extension change to match the slot number (z10-z99).</li>
</ul>
</li>
</ul>
</div>
<table style="text-align: center" id="table_files">
<tr>
<th>File Name</th><th>File Extension</th><th>File Type Name</th><th>Description</th><th>Where Created?</th>
</tr>
<tr>
<td>Whatever you want, or have them automatically named by <a href="support.htm#utilities_nsrt" title="Nach's SNES ROM Tools">NSRT</a>.</td><td><a href="readme.htm#rom_file_types" title="Read the full list of supported ROM file extensions">smc, sfc, swc, ...</a></td><td><acronym title="Read Only Memory">ROM</acronym> (Game)</td><td>These are common extensions for <a href="games.htm#roms" title="Description of ROMs">ROMs</a>, which are computer files of the game data on real SNES cartridges.</td><td>Wherever you put them.</td>
</tr>
<tr>
<td>romname</td><td>srm</td><td>Static RAM</td><td>This is the <em>in-game</em> save file. It is automatically generated by ZSNES when you use the in-game save function. <a href="gui.htm#config_saves_sram_check_save" title="Description of the SRAM Check+Save option">Some games use Static RAM as working RAM rather than to save a game.</a> This format <em>should</em> be compatible among all emulators.</td><td><a href="gui.htm#config_paths" title="Description of the Setup Paths dialog">Saves folder</a></td>
</tr>
<tr>
<td>romname</td><td>zst, zs1-zs9, z10-z99, zss</td><td>ZSNES Save State</td><td>See the <a href="readme.htm#save_states" title="Description of the Save State feature">Save States</a> section for more information.</td><td><a href="gui.htm#config_paths" title="Description of the Setup Paths dialog">Saves folder</a></td>
</tr>
<tr>
<td>romname</td><td>zmv, zm1-zm9</td><td>ZSNES Movie</td><td>See the <a href="readme.htm#movies" title="Description of the Movie feature">Movies</a> section for more information.</td><td><a href="gui.htm#config_paths" title="Description of the Setup Paths dialog">Saves folder</a></td>
</tr>
<tr>
<td>romname</td><td>mzt, mz1-mz9</td><td>ZSNES Movie States</td><td>Directories which contain the various save state data for that particular movie. See the <a href="readme.htm#movies" title="Description of the Movie feature">Movies</a> section for more information.</td><td><a href="gui.htm#config_paths" title="Description of the Setup Paths dialog">Saves folder</a></td>
</tr>
<tr>
<td>romname</td><td>sub, su1-su9</td><td>ZSNES Subtitle</td><td>See the <a href="readme.htm#movies_subtitles" title="Description of the Subtitle feature">Subtitles</a> section for more information.</td><td><a href="gui.htm#config_paths" title="Description of the Setup Paths dialog">Saves folder</a></td>
</tr>
<tr>
<td>romname</td><td>ips, ip0-ip9</td><td>International Patching System</td><td>See the <a href="readme.htm#ips_patching" title="Description of the IPS patching features">IPS Patching</a> section for more information.</td><td><a href="gui.htm#config_paths" title="Description of the Setup Paths dialog">Saves folder</a>, Same folder as ROM</td>
</tr>
<tr>
<td>romname_***** / img*****</td><td>bmp, png</td><td>Images</td><td>These are snapshots of the game screen, created by ZSNES when you use the <a href="gui.htm#f1_menu" title="Description of the F1 Menu">F1 Menu</a>. The file name is appended by a number, up to 99999.</td><td><a href="gui.htm#config_paths" title="Description of the Setup Paths dialog">Snapshots folder</a></td>
</tr>
<tr>
<td>romname</td><td>spc, sp1-sp9, s10-s99</td><td>SPC Sound</td><td>These files are created by ZSNES when you dump the SPC data of the game you are playing by using the <a href="gui.htm#f1_menu" title="Description of the F1 Menu">F1 Menu</a>. <strong>Note:</strong> In Windows, the <code class="file">.spc</code> extension is sometimes used for PKCS Certificates.</td><td><a href="gui.htm#config_paths" title="Description of the Setup Paths dialog">SPCs folder</a></td>
</tr>
<tr id="files_cht">
<td>romname</td><td>cht</td><td>Cheat Data</td><td>This file contains <a href="readme.htm#cheat_codes" title="Description of the cheat code features">cheat codes</a> that you entered using the <a href="gui.htm#cheat_menu" title="Description of the Cheat Code Editor">Cheat Code Editor</a>. These files are generally compatible between different versions of the same emulator, but not necessarily between different emulators.</td><td><a href="gui.htm#config_paths" title="Description of the Setup Paths dialog">Saves folder</a></td>
</tr>
<tr>
<td>romname</td><td>cmb</td><td>Key Combination Data</td><td>These files contain key combination data, created when you use the <a href="gui.htm#misc_keycomb" title="Description of the Key Combination Editor">Key Combination Editor</a>.</td><td><a href="gui.htm#config_paths" title="Description of the Setup Paths dialog">Saves folder</a></td>
</tr>
<tr>
<td>romname</td><td>inp</td><td>ZSNES Input </td><td>These files contain input configuration for the specific game.</td><td><a href="gui.htm#config_paths" title="Description of the Setup Paths dialog">Saves folder</a></td>
</tr>
<tr>
<td>sounddmp</td><td>raw</td><td>Sound Buffer Dump</td><td>This is a dump of sound buffer data, created when you use the appropriate <a href="gui.htm#f1_menu" title="Description of the F1 Menu">F1 Menu</a> option.</td><td><a href="gui.htm#config_paths" title="Description of the Setup Paths dialog">SPCs folder</a></td>
</tr>
<tr>
<td>data</td><td>cmb</td><td>Key Combination Data</td><td>This file contains key combination data, created when you use the <a href="gui.htm#misc_keycomb" title="Description of the Key Combination Editor">Key Combination Editor</a> for an unspecific game.</td><td>ZSNES folder (Win/DOS) / ~/.zsnes (SDL) / ~/Library/Application Support/ZSNES (SDL - Mac OS X)</td>
</tr>
<tr id="files_executable">
<td>zsnes / zsnesw</td><td>exe (Win/DOS)</td><td>ZSNES executable</td><td>This is the main ZSNES executable binary file.</td><td>"ZSNES Folder" means the location of this executable</td>
</tr>
<tr>
<td>zsnes / zsnesw / zsnesl</td><td>cfg</td><td>ZSNES <a href="advanced.htm#config_files" title="Description of the ZSNES configuration files">Configuration File</a></td><td>User-editable configuration file where you can set almost any option in ZSNES.</td><td>ZSNES folder (Win/DOS) / ~/.zsnes (SDL) / ~/Library/Application Support/ZSNES (SDL - Mac OS X)</td>
</tr>
<tr>
<td>zmovie</td><td>cfg</td><td>ZSNES Movie <a href="advanced.htm#config_files" title="Description of the ZSNES configuration files">Configuration File</a></td><td>User-editable configuration file where you can change advanced <a href="advanced.htm#movie_dumping" title="Description of the movie dumping features">movie dumping</a> features.</td><td>ZSNES folder (Win/DOS) / ~/.zsnes (SDL) / ~/Library/Application Support/ZSNES (SDL - Mac OS X)</td>
</tr>
<tr>
<td>zinput</td><td>cfg</td><td>ZSNES Input <a href="advanced.htm#config_files" title="Description of the ZSNES configuration files">Configuration File</a></td><td>User-editable configuration file where you can change settings for controllers and extra SNES devices. This is the same as the files with the .inp extension, but is used globally.</td><td>ZSNES folder (Win/DOS) / ~/.zsnes (SDL) / ~/Library/Application Support/ZSNES (SDL - Mac OS X)</td>
</tr>
<tr id="files_zfont">
<td>zfont</td><td>txt</td><td>ZSNES Font <a href="advanced.htm#config_files" title="Description of the ZSNES configuration files">Configuration File</a></td><td>This is where the appearance of text in the ZSNES GUI is <a href="advanced.htm#config_files" title="Description of the ZSNES configuration files">configured</a>.</td><td>ZSNES folder (Win/DOS) / ~/.zsnes (SDL) / ~/Library/Application Support/ZSNES (SDL - Mac OS X)</td>
</tr>
<tr id="files_rominfo">
<td>rominfo</td><td>txt</td><td>ROM Information</td><td>This contains information about the ROM you most recently ran. You can configure this behavior under <a href="gui.htm#config_options" title="Description of the Options dialog">Config->Options</a>.</td><td>ZSNES folder (Win/DOS) / ~/.zsnes (SDL) / ~/Library/Application Support/ZSNES (SDL - Mac OS X)</td>
</tr>
</table>
</div>
</div>
<div id="footer">
<h2>Footer</h2>
<p>This documentation is best viewed in a standards-compliant web browser, like <a href="http://www.mozilla.com" title="Mozilla Corporation home page">Firefox</a> or <a href="http://www.opera.com" title="Opera web browser home page">Opera</a>.</p>
<a href="http://sourceforge.net" title="SourceForge.net"><img style="border:0;width:88px;height:31px" src="http://sflogo.sourceforge.net/sflogo.php?group_id=127354&amp;type=1" alt="SourceForge.net Logo" /></a>
<a href="http://sourceforge.net/donate/index.php?group_id=19677" title="Donate to the ZSNES Project"><img style="border:0;width:88px;height:32px" src="http://images.sourceforge.net/images/project-support.jpg" alt="Support This Project" /> </a>
<span class="web_only">
<a href="http://validator.w3.org/check?uri=referer" title="Validate this page's HTML"><img style="border:0;width:88px;height:31px" src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0 Strict" /></a>
<a href="http://jigsaw.w3.org/css-validator/check/referer" title="Validate this page's CSS"><img style="border:0;width:88px;height:31px" src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!" /></a>
</span>
<p><a href="license.htm" title="View the General Public License">Copyright (C) ZSNES Team &amp; ZSNES Documentation Team</a></p>
</div>
</div>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 300 B

View File

@@ -0,0 +1,143 @@
/* Jipcy's style.
This is used as the default stylesheet for the NSRT guide, and an alternative stylesheet for the docs proper. */
/* ALL PROPERTIES ARE ALPHABETIZED!!! KEEP THEM THAT WAY!!! */
@import url(shared.css); /* Loads shared.css, which contains shared styling information. */
@import url(release.css); /* Loads release.css, which contains styling information specific to public releases of the docs. */
body {
background-color: white;
color: black;
font-family: Verdana, "Arial Unicode MS", Arial, sans-serif;
margin: 0em; /* Removes default ~0.5em margin between the body and the view port. */
}
a img {
border-width: 0px;
}
#header {
background-color: #C8CFD8;
border-bottom: solid 1em #00CC99;
color: inherit;
}
#header #logo {
margin: 5px 7px 0px 7px; /* Compensates for the apparent non-centering in the logo image itself. */
}
#header h1 {
display: inline;
margin-left: 1em;
text-align: right;
}
#nav_column {
float: left;
margin: 1em;
width: 15em;
}
#navigation {
border: solid 1px #00CC99;
}
#navigation h2, #content h2, #content h3 {
background-color: #00CC99;
color: inherit;
margin: 0px 0px 1px 0px;
padding: 0.1em 0.5em 0.1em 0.5em;
}
#navigation a:hover, #content a:hover {
background-color: #00CC99;
color: inherit;
}
#navigation ul {
list-style-type: none;
margin: 0em;
padding-left: 0.5em;
}
#navigation ul li {
font-weight: bold;
margin: 0.3em 0em 0.3em 0em;
}
#navigation ul ul {
margin-top: 0.45em;
padding-left: 1.2em;
}
#navigation ul ul li {
font-weight: normal;
margin: 0em;
}
#navigation ul ul a {
text-decoration: none;
}
#content_column {
margin: 1em 1em 1em 17em;
min-width: 40em;
}
#content {
border-bottom: solid 3px black;
max-width: 60em;
margin: auto;
padding-bottom: 1em;
}
#content h4 {
background-color: #00FFCC;
color: inherit;
margin: 0px 0px 1px 0px;
padding: 0.2em 1.5em 0.2em 1.5em;
}
#content h5 {
margin-bottom: -1em;
}
#content img {
margin-bottom: 0.5em;
margin-top: 0.5em;
}
#footer {
clear: both; /* This is mainly for pages that might be shorter than the nav-list on the left. Keeps things looking correct. */
font-size: 0.7em;
font-weight: bold;
text-align: center;
}
#footer h2 {
display: none;
}
/* Use <dt></dt> for a FAQ question. */
dt {
font-weight: bold;
margin-left: 1.5em;
text-indent: -1.5em;
}
/* Use <dd></dd> for a FAQ answer. */
dd {
margin-bottom: 1em;
margin-left: 1.5em;
text-indent: -1.5em;
}
dd p {
margin-top: 1em;
text-indent: 0em;
}
dd ul {
text-indent: 0em;
}

View File

@@ -0,0 +1,18 @@
/* The Plain Text stylesheet.
The goal with this style is to make the docs look as much as possible like the text version of the docs. */
/* ALL PROPERTIES ARE ALPHABETIZED!!! KEEP THEM THAT WAY!!! */
body {
font-family: "Lucida Console", "Courier New", Courier, monospace;
font-size: 10pt;
width: 48em;
}
img {
display: none;
}
a:after {
content: " [" attr(href) "]";
}

View File

@@ -0,0 +1,47 @@
/* The stylesheet used for printing.
This stylesheet is used to render the docs nicely for printing. */
/* ALL PROPERTIES ARE ALPHABETIZED!!! KEEP THEM THAT WAY!!! */
@import url(shared.css); /* Loads styles/shared.css, which contains shared styling information. */
body {
background-color: white;
color: black;
font-family: Verdana, "Arial Unicode MS", Arial, sans-serif;
font-size: 10pt;
margin: 1px;
}
img {
display: none;
}
a {
background-color: inherit;
color: black;
}
#content a:after {
content: " [" attr(href) "]";
}
#nav_column {
display: none;
}
#content code {
background-color: inherit;
color: black;
}
#footer {
clear: both; /* This is mainly for pages that might be shorter than the nav-list on the left. Keeps things looking correct. */
font-size: 0.7em;
font-weight: bold;
text-align: center;
}
#footer h2 {
display: none;
}

View File

@@ -0,0 +1,191 @@
/* Radio's style.
This style is designed to mimic the ZSNES.com style, which was designed by Radio. This is the default style for the docs. */
/* ALL PROPERTIES ARE ALPHABETIZED!!! KEEP THEM THAT WAY!!! */
@import url(shared.css); /* Loads styles/shared.css, which contains shared styling information. */
@import url(release.css); /* Loads styles/release.css, which contains styling information specific to public releases of the docs. */
body {
background-color: white;
color: black;
font-size: 100%; /* Even though this line seems counter-intuitive, it fixes font scaling in Internet Explorer. */
margin: 0em; /* Removes default ~0.5em margin between the body and the view port. */
}
a:link, a:active, a:visited {
background-color: inherit;
color: #203040;
}
a:hover {
background-color: #A4A9B0;
color: black;
}
a img {
border-width: 0px;
}
#header {
background-color: #C8CFD8;
border-bottom: solid 1em #A4A9B0;
color: inherit;
}
#header a, #footer a /* Grouped selectors here; please take note. */
{
background-color: inherit;
color: inherit;
}
#header #logo {
margin: 5px 7px 0px 7px; /* Compensates for the apparent non-centering in the logo image itself. */
}
#header h1 {
display: inline;
font-family: Verdana, "Arial Unicode MS", Arial, sans-serif;
margin-left: 1em;
text-align: right;
}
/* nav_column and content_column are necessary to achive perfect margins */
#nav_column {
display: inline; /* Thanks Roman Rudenko. This fixes the floated column in Internet Explorer. */
float: left;
margin: 0.65em;
width: 11.2em;
}
#navigation, #content /* Grouped selectors here; please take note. */
{
background-color: #C8CFD8;
border: solid 1px black;
color: inherit;
padding: 1px 1px 0.5em 1px;
}
#navigation h2, #content h2, #content h3, #content h4 /* Grouped selectors here; please take note. */
{
font-family: Arial, "Arial Unicode MS", sans-serif;
font-size: 0.9em;
margin: 0px 0px 1px 0px;
}
#navigation h2, #content h2 /* Grouped selectors here; please take note. */
{
background-color: #A4A9B0;
background-image: url( 'corner.png' );
background-position: top right;
background-repeat: no-repeat;
color: inherit;
padding: 5px 0.5em 5px 0.5em; /* The top/bottom margins measured in px are required to get perfect line-up with the background image, at default font size. */
}
#navigation ul {
font-family: Verdana, "Arial Unicode MS", Arial, sans-serif;
font-size: 90%;
list-style-type: none;
margin: 0em;
padding-left: 0.5em;
}
#navigation ul li {
font-weight: bold;
margin: 0.3em 0em 0.3em 0em;
}
#navigation ul ul {
margin-top: 0.45em;
padding-left: 1.2em;
}
#navigation ul ul li {
font-weight: normal; /* Un-bold the sub-list. */
margin: 0em;
}
#navigation ul ul a {
text-decoration: none;
}
/* nav_column and content_column are necessary to achive perfect margins */
#content_column {
margin: 0.65em 0.65em 0.65em 12.5em;
min-width: 22em; /* When text is resized really big, and the window is really small, this makes it not look like crap. */
}
#content /* Grouped with #navigation, above. */
{}
#content h2 /* Grouped with #navigation h2, above. */
{}
#content h3 /* Grouped with #navigation h2, above. */
{
background-color: #A4A9B0;
color: inherit;
padding: 0.2em 0.5em 0.2em 0.5em;
}
#content h4 {
background-color: #B3B8BF;
color: inherit;
padding: 0.2em 1.5em 0.2em 1.5em;
}
#content h5 /* Closes the gaps between headers and the content below them. */
{
margin-bottom: -1em;
margin-top: 0.5em;
}
#content h5, #content p, #content ul, #content ol, #content dl, #content table {
font-family: Verdana, "Arial Unicode MS", Arial, sans-serif;
}
#content h5, #content dl, #content p, #content table /* Do not change the margins on lists! Internet Explorer has some weird ideas about them! */
{
margin-left: 0.6em;
margin-right: 0.6em;
}
#content img {
margin: 0.5em;
}
#footer {
clear: both; /* This is mainly for pages that might be shorter than the nav-list on the left. Keeps things looking correct. */
font: bold 0.7em Verdana, "Arial Unicode MS", Arial, sans-serif;
text-align: center;
}
#footer h2 {
display: none;
}
/* Page Specific */
/* Use <dt></dt> for a FAQ question. */
dt {
font-weight: bold;
margin-left: 1.5em;
text-indent: -1.5em;
}
/* Use <dd></dd> for a FAQ answer. */
dd {
margin-bottom: 1em;
margin-left: 1.5em;
text-indent: -1.5em;
}
dd p {
margin-top: 1em;
text-indent: 0em;
}
dd ul {
text-indent: 0em;
}

View File

@@ -0,0 +1,5 @@
/****This file has styling information that changes depending on the medium through which the docs are released.****/
.web_only {
display: none;
}

View File

@@ -0,0 +1,70 @@
/* Shared styles.
This stylesheet contains styling information for some tags commonly used in the zdocs. These generally aren't page-specific. */
/* ALL PROPERTIES ARE ALPHABETIZED!!! KEEP THEM THAT WAY!!! */
#content table {
border: 1px solid black;
border-collapse: collapse;
margin-bottom: 1em;
margin-top: 1em;
}
#content th {
border-style: solid;
border-width: 1px 1px 2px 1px;
font-weight: bold;
padding-left: 1em;
padding-right: 1em;
}
#content td {
border: 1px dotted black;
padding-right: 0.3em;
padding-left: 0.3em;
}
#content table.argument_list td{
border-style: dotted none dotted none;
}
#content .gui
{
font-family: "Lucida Console", "Courier New", Courier, monospace;
font-weight: bold;
}
#content strong.gui_windows {
background-color: #d4d0c8;
color: black;
font-family: Tahoma, sans-serif;
font-size: 8pt;
font-weight: normal;
}
#content em.game /* Just a reminder that you can change the text style of a game name. */
{}
#content code {
background-color: inherit;
color: blue;
font-family: "Lucida Console", "Courier New", Courier, monospace;
}
#content code.file /* Just a reminder that you can change the style of filenames. */
{}
#content kbd {
background-color: black;
color: white;
font-family: "Lucida Console", "Courier New", Courier, monospace;
}
#content kbd.key
{
background-color: white;
border: solid 2px black;
color: black;
padding-left: 1px;
padding-right: 1px;
}

View File

@@ -0,0 +1,197 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Getting Support - ZSNES Documentation</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="styles/print.css" media="print" type="text/css" />
<link rel="stylesheet" href="styles/radio.css" title="Radio's style" media="screen" type="text/css" />
<link rel="alternate stylesheet" href="styles/jipcy.css" title="Jipcy's style" media="screen" type="text/css" />
<link rel="alternate stylesheet" href="styles/plaintxt.css" title="Plain Text" media="screen" type="text/css" />
<link rel="contents" href="index.htm" title="Index" />
<link rel="start" href="readme.htm" title="Readme" />
<link rel="previous" href="faq.htm" title="FAQ" />
<link rel="next" href="history.htm" title="History" />
<link rel="help" href="support.htm" title="Getting Support" />
<link rel="copyright" href="license.htm" title="GNU General Public License" />
</head>
<body>
<div id="header">
<a href="readme.htm" title="ZSNES Documentation Home"><img id="logo" src="images/zsneslogo.png" alt="The ZSNES Logo" /></a>
<h1>ZSNES v1.51 Documentation</h1>
</div>
<div id="nav_column">
<div id="navigation">
<h2>Navigation</h2>
<ul class="navigation_list">
<li><a href="index.htm" title="ZSNES Documentation Index">Index</a></li>
<li><a href="readme.htm" title="General documentation">Readme</a></li>
<li><a href="gui.htm" title="Description of the GUI and its options">GUI</a></li>
<li><a href="netplay.htm" title="Documentation for Netplay">Netplay</a></li>
<li><a href="advanced.htm" title="Advanced Usage">Advanced Usage</a></li>
<li><a href="games.htm" title="Information about Games">Games</a></li>
<li><a href="faq.htm" title="Frequently Asked Questions">FAQ</a></li>
</ul>
<hr />
<ul>
<li><a href="support.htm" title="How to get support">Getting Support</a>
<ul>
<li><a href="#utilities">APIs and Utilities</a></li>
<li><a href="#contact_information">Contact Information</a></li>
<li><a href="#known_issues">Known Issues</a></li>
<li><a href="#filing_a_bug_report">Filing a Bug Report</a></li>
</ul>
</li>
<li><a href="history.htm" title="The log of changes to ZSNES">History</a></li>
<li><a href="about.htm" title="A brief description of the ZSNES emulator and ZSNES documentation projects">About</a></li>
<li><a href="license.htm" title="GNU General Public License">License</a></li>
</ul>
<hr />
<ul>
<li><a href="http://zsnes-docs.sourceforge.net/nsrt" title="NSRT Guide">NSRT Guide</a></li>
<li><a href="http://www.zsnes.com" title="ZSNES Home Page on the Web">ZSNES.com</a></li>
</ul>
</div>
</div>
<div id="content_column">
<div id="content">
<h2>Getting Support</h2>
<div class="section" id="utilities">
<h3>APIs and Utilities</h3>
<p>The following utilities are referenced throughout this documentation to help accomplish various tasks. There is a link to each utility and a short description of its purpose.</p>
<div class="section" id="utilities_directx">
<h4>DirectX</h4>
<p><a href="http://www.microsoft.com/directx" title="Microsoft DirectX Home Page">DirectX</a> is an <acronym title="Application Programming Interface">API</acronym> required for running ZSNES in Windows.</p>
</div>
<div class="section" id="utilities_sdl">
<h4>SDL</h4>
<p><a href="http://www.libsdl.org" title="Simple DirectMedia Layer Home Page">SDL</a> (Simple DirectMedia Layer) is an API required for running ZSNES on UNIX-like operating systems.</p>
</div>
<div class="section" id="utilities_scitech">
<h4>Scitech Display Doctor</h4>
<p><a href="http://www.scitechsoft.com/ftp/sdd" title="SciTech Display Doctor Download Page">Scitech Display Doctor</a> is a utility that provides drivers for many VGA and SVGA video cards. It can provide support for VESA VBE 2 on some video cards that may not normally support it.</p>
<p>The link above directs you to Scitech's FTP site. <code class="file">regcodes.txt</code> provides registration codes for the two different versions of <acronym title="Scitech Display Doctor">SDD</acronym> offered, v5.3 and v6.53. The newer version supports hardware acceleration and more cards. If you are in a DOS-only environment, you should use one of the <code class="file">-d.zip</code> versions. If you are in a Windows+DOS environment, use one of the <code class="file">-w.exe</code> versions. <code class="file">univbe67.exe</code> is a stand-alone VESA VBE driver, and does not provide any of the other SDD utilities.</p>
<p><strong>Note:</strong> SciTech Software no longer offers support for this software.</p>
</div>
<div class="section" id="utilities_nsrt">
<h4>NSRT</h4>
<p><a href="http://nsrt.edgeemu.com" title="Nach's SNES ROM Tools">NSRT</a> - Nach's SNES ROM Tools. <q title="from http://nsrt.edgeemu.com">NSRT, the most advanced SNES ROM tool to date, provides the ability to check, alter, retrieve info from, verify, fix, and organize SNES <a href="games.htm#roms" title="Description of ROMs">ROMs</a>.</q></p>
<p>NSRT has several important uses in relation to ZSNES:</p>
<ul>
<li>You can use it to scan your ROMs and show detailed information about them. This information will tell you whether or not the ROM is a good dump.</li>
<li>It can deinterleave your <a href="games.htm#special_chip_superfx" title="Information about SuperFX emulation">SuperFX</a> ROMs so that ZSNES can load them.</li>
<li>It can add special NSRT headers to your ROMs, which will allow ZSNES to automatically enable <a href="gui.htm#config_devices" title="Description of the Devices Selector dialog">special controllers</a> for games that need them.</li>
<li>You can use NSRT to compress your ROMs using a special, custom-built compression format called JMA. <q title="from http://nsrt.edgeemu.com">This is an archive format designed by Nach based on LZMA. When used on SNES ROMs it is faster, and creates smaller files than 7Zip.</q></li>
</ul>
<p>NSRT is primarily a command-line program, although a graphical front-end is available. <strong>The ZSNES <a href="about.htm#credits_documentation" title="Documentation Credits">Documentation Team</a> has written <a href="http://zsnes-docs.sourceforge.net/nsrt" title="NSRT Guide">a supplementary guide to NSRT</a> that covers some of the functions listed above.</strong></p>
</div>
</div>
<div class="section" id="contact_information">
<h3>Contact Information and Links</h3>
<p>The following is a list of all official ZSNES websites and resources:</p>
<ul>
<li><a href="http://www.zsnes.com/" title="ZSNES Home Page">ZSNES Home Page</a></li>
<li><a href="http://zsnes.bountysource.com" title="ZSNES Project Page at BountySource">ZSNES Project Page</a> hosted by <a href="http://www.bountysource.com/" title="BountySource">BountySource</a>.</li>
<li><a href="http://zsnes-docs.sourceforge.net/" title="ZSNES Documentation on the Web">ZSNES Documentation on the Web</a></li>
<li><a href="http://sourceforge.net/projects/zsnes-docs" title="ZSNES Documentation Project Page at SourceForge">ZSNES Documentation Project Page</a> hosted by <a href="http://sourceforge.net/" title="SourceForge.net">SourceForge.net</a>.</li>
<li><a href="http://board.zsnes.com" title="Official ZSNES Message Board">ZSNES Message Board</a></li>
</ul>
<p>In your quest to solve whatever problem you may be having with ZSNES, or to learn more about ZSNES, please first read all of this official documentation.</p>
<p>The <a href="http://board.zsnes.com" title="Official ZSNES Message Board">ZSNES Message Board</a> is the primary place to receive help about ZSNES, after you have read through this entire documentation. It is also an interesting Internet community in its own right. <strong>Asking for ROMs (or asking for games, a link to a ROM site, or where to find ROMs/games) is forbidden! Be sure to also read the RULES!</strong></p>
</div>
<div class="section" id="known_issues">
<h3>Known Issues</h3>
<ul>
<li>65816 lacks correct timing. Although ZSNES bases the timing on a variable cycle/instruction, it does not deduct correct values (such as 16-bit instructions should deduct 1 more cycle than 8-bit instructions). 100% cycles of ZSNES isn't 100% cycles of a SNES because of that. This means that a lot of games either won't run or will produce horrible displays. Sometimes, adjusting the % of execution can fix those problems. This is all due to inaccurate documentation used when the ZSNES 65816 core was written. Fortunately, there are currently ongoing efforts to rewrite the ZSNES core.</li>
<li>Some games sometimes tend to not display things properly because of graphic features that aren't implemented yet.</li>
<li>The Sound DSP chip still has its bugs (not many though). Additionally, no one knows the exact timing of the SPC700 chip.</li>
</ul>
</div>
<div class="section" id="filing_a_bug_report">
<h3>Filing a Bug Report</h3>
<div class="section">
<h4>Before you file a bug report:</h4>
<ul>
<li>Please verify that you have a good ROM. You should use <a href="support.htm#utilities_nsrt" title="Nach's SNES ROM Tools">NSRT</a> to do this. You can find detailed instructions on how to use NSRT to verify your ROM(s) in <a href="http://zsnes-docs.sourceforge.net/nsrt#verifying" title="Verifying ROMs with NSRT">this section</a> of our <a href="http://zsnes-docs.sourceforge.net/nsrt" title="NSRT Guide">NSRT Guide</a>.</li>
<li>Make sure you are using the <strong>current release of ZSNES</strong>. You can download the latest version from the <a href="http://www.zsnes.com/index.php?page=files" title="ZSNES Files Page">ZSNES home page</a> or from the ZSNES SourceForge Project <a href="http://sourceforge.net/project/showfiles.php?group_id=19677" title="Files page of the ZSNES Project at SF.net">Files page</a>. If you <em>were</em> using an old version of ZSNES, and the problem goes away when you use the new version, please do not report the bug.</li>
<li>If the bug still exists in the latest official release of ZSNES, please try again with the latest <a href="http://zsnes.ipherswipsite.com" title="ipher's WIP Page">WIP release</a> of ZSNES. These are unofficial versions, compiled from SVN source, and are updated somewhat frequently. They are available at <a href="http://zsnes.ipherswipsite.com" title="ipher's WIP Page">ipher's WIP Page</a>.</li>
<li>If you want to check against the latest development code, go obtain it from <a href="https://svn.bountysource.com/zsnes/trunk/" title="ZSNES Development at BountySource">SVN at BountySource</a>. You are warned, however, that frequent changes are made to the code, so ZSNES may not always be able to compile when using code obtained from there.</li>
<li>If possible, confirm whether the bug occurs on real hardware (as in, play the game on a real console).</li>
</ul>
<p>Bug reports should be submitted in the Bug Reports/Feature Requests section of the <a href="http://board.zsnes.com" title="Official ZSNES Message Board">ZSNES Message Board</a>. Before reporting, please use the board's search function to see if your bug has already been reported.</p>
</div>
<div class="section">
<h4>When making a bug report, please include the following information:</h4>
<ul>
<li><strong>Version</strong> (i.e., v1.51) <strong>and port</strong> (i.e., Windows, DOS, or SDL) <strong>of ZSNES you are using.</strong> Make sure to specify the revision if you obtained ZSNES from SVN.</li>
<li><strong>Detailed ROM information:</strong>
<ul><li>You <em>must</em> post the <a href="support.htm#utilities_nsrt" title="Nach's SNES ROM Tools">NSRT</a> information about your ROM when reporting a bug. Please see the <a href="http://zsnes-docs.sourceforge.net/nsrt#verifying_bug_reports" title="Verifying ROMs for use with bug reports">Verifying a ROM to make a Bug Report</a> section of our <a href="http://zsnes-docs.sourceforge.net/nsrt" title="NSRT Guide">NSRT Guide</a> for detailed instructions. Alternatively, you can use the <strong class="gui">Log Rom Info</strong> option in ZSNES to generate the file "rominfo.txt", which also provides the necessary information.</li></ul>
</li>
<li><strong>Detailed system specifications:</strong>
<ul>
<li>At minimum, you must tell us what operating system you are using and what version of <a href="#utilities_directx" title="Description of DirectX">DirectX</a> or <a href="#utilities_sdl" title="Description of SDL">SDL</a> you are using.</li>
<li>If your issue is related to performance (as in, ZSNES is too slow), also include the specs for your processor, RAM, video card, etc.</li>
</ul>
</li>
<li><strong>Detailed description of the bug:</strong>
<ul>
<li>A detailed description of the bug is important so that others can try to reproduce it.</li>
<li><a href="gui.htm#f1_menu_snapshot" title="Description of the Save Snapshot function">Screenshots</a> are highly recommended, and <a href="readme.htm#save_states" title="Description of save state features">save states</a> made before (or in some cases, during) the bug's occurrence are also greatly appreciated.</li>
<li>If you know of a previous version of ZSNES that ran the game properly, or if you know of another game that acts similarly, please let us know.</li>
<li>It may also be helpful to test the game in <a href="readme.htm#snes_emus">other SNES emulators</a> and tell us the resulting behavior.</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<div id="footer">
<h2>Footer</h2>
<p>This documentation is best viewed in a standards-compliant web browser, like <a href="http://www.mozilla.com" title="Mozilla Corporation home page">Firefox</a> or <a href="http://www.opera.com" title="Opera web browser home page">Opera</a>.</p>
<a href="http://sourceforge.net" title="SourceForge.net"><img style="border:0;width:88px;height:31px" src="http://sflogo.sourceforge.net/sflogo.php?group_id=127354&amp;type=1" alt="SourceForge.net Logo" /></a>
<a href="http://sourceforge.net/donate/index.php?group_id=19677" title="Donate to the ZSNES Project"><img style="border:0;width:88px;height:32px" src="http://images.sourceforge.net/images/project-support.jpg" alt="Support This Project" /> </a>
<span class="web_only">
<a href="http://validator.w3.org/check?uri=referer" title="Validate this page's HTML"><img style="border:0;width:88px;height:31px" src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0 Strict" /></a>
<a href="http://jigsaw.w3.org/css-validator/check/referer" title="Validate this page's CSS"><img style="border:0;width:88px;height:31px" src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!" /></a>
</span>
<p><a href="license.htm" title="View the General Public License">Copyright (C) ZSNES Team &amp; ZSNES Documentation Team</a></p>
</div>
</div>
</body>
</html>

View File

@@ -0,0 +1,280 @@
ZSNES v1.51 Documentation
================================
N a v i g a t i o n
================================
* Index [Index.txt]
* Readme [Readme.txt]
* GUI [GUI.txt]
* Netplay [Netplay.txt]
* Advanced Usage [Advanced.txt]
* Games [Games.txt]
* FAQ [FAQ.txt]
- - - - - - - - - - - - - - - - - -
* Getting Support [Support.txt]
* History [History.txt]
* About [About.txt]
1. ZSNES
2. Documentation
3. Credits
* License [License.txt]
- - - - - - - - - - - - - - - - - -
* NSRT Guide: [http://zsnes-docs.sf.net/nsrt]
* ZSNES Home Page: [ZSNES.com]
================================================================================
~ A b o u t
================================================================================
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1. About ZSNES
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ZSNES is a SNES emulator that has been worked on since 1997. Originally
programmed by zsKnight and _Demo_, the project has since then attracted a number
of new developers and contributors.
On April 2, 2001, the ZSNES project was GPL'ed and its source released to the
public. Written in a mixture of x86 assembler, C, and C++, ZSNES currently runs
on Windows, DOS, x86 versions of Linux and FreeBSD, x86 Macintosh computers, and
the Microsoft Xbox.
................................
Donations
................................
If you enjoy using ZSNES to re-live and enhance your experiences with the Super
Nintendo, please consider making a donation to support further development.
You have two options when making a donation. You can choose to make a donation
through the ZSNES SourceForge Project Donation Page:
[http://sourceforge.net/donate/index.php?group_id=19677]
(Donate to ZSNES through SourceForge).
Alternatively, you can send money to the ZSNES creator's PayPal account:
[http://www.zsnes.com/?page=donate]
(Donate directly to zsKnight, creator of ZSNES).
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2. About the Documentation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The ZSNES Documentation Project was started by RichardC in an attempt to update
and reorganize all of the ZSNES documentation into an easy to read, easy to
access collection. It made its public debut upon the release of ZSNES v1.40.
It is officially available in HTML, CHM, and text formats.
If you have any suggestions or corrections that you would like to submit,
feel free to let us know at our forum on the ZSNES Message Board
[http://board.zsnes.com].
RichardC would like to give a special thanks to Nach and the ZSNES community for
all the help and support that they have given to him and the project.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3. C r e d i t s
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
........................................
Founding Developers
........................................
zsKnight
_Demo_
........................................
Current/Active Developers
........................................
pagefault - primary core developer, primary Win port developer.
Nach - primary non-core developer, mostly works on significant back-end
overhauling and large new features.
grinvader - primary ASM to C porter, primary Unix build maintainer, many GUI
improvements and other, and power of no pants.
Jonas Quinn - primary bug fixer, also video code contributor.
ipher - ZSNES GUI expert, WIP distributor
Deathlike2 - minor feature adder, also an ASM to C porter.
........................................
Assistant Coders
........................................
hpsolo
Pharos
Siloh (a.k.a. Stainless, a.k.a. randilyn)
StatMan
teuf
theoddone33
........................................
Contributors (in alphabetical order)
........................................
aaronl
Aerdan
amit
anomie
BRPXQZME
byuu
Diablo-D3
EvilTypeGuy
hector
Khan Artist (a.k.a. Noxious Ninja)
kode54
Kreed
MaxSt
MKendora
Neviksti
Overload
prometheus
relnev
snes6502
TRAC
zinx
........................................
Documentation Writers/Contributors
........................................
Contributors are listed loosely based on their dates of contribution.
RichardC - founder of the ZSNES Documentation Project. First active
administrator. He had the dirty job of doing the initial conversion
of the docs into HTML.
Nach - programmer extraordinaire, and knows ZSNES very well. He helps a lot in
documenting the obscure things we writers don't know about.
LDAWG - updated v1.40 changelog, based on a 2 year summary by Nach, as well as
another 6 months of developer notes.
kevman - helped with the v1.40 FAQ updates.
xamenus - joined the project shortly after RichardC's initial release, and made
many grammar fixes and updated the content. Combined the 3 separate,
port-specific documentations into one. Still contributes some content from
time to time.
Noxious Ninja - manpage expert. No longer active in the emulation "scene", he
always had something useful to contribute.
Clements - maintainer of the CHM file. Also assists with coding and content.
AspiringSquire - designer and maintainer of the TXT version of the docs;
occasionally contributes content. Also an expert with grammar and
vocabulary corrections.
Jipcy - current active administrator and mark-up chief. Manages and contributes
to all parts of the docs.
Jonas Quinn - mainly helps in super-optimizing the images.
Deathlike2 - ZBoard tech help expert. Also makes many suggestions/corrections to
the docs.
Special thanks to Radio. He designed the ZSNES.com main page layout, from which
we stole this design for the HTML docs. Also special thanks to Roman Rudenko,
for finding the elusive "display:inline" fix for floated items in IE.
Also thanks to SnesCentral [http://snescentral.com] for providing some info!
........................................
Thanks
........................................
All ports of ZSNES use NASM v0.98+, GNU Make, zlib, libpng, and JMAlib to
compile, link, compress, decompress, and execute.
In addition to the above, ZSNES Win uses Visual C++ 2003 (or MinGW), DirectX 8,
UPX, and ManyMouse; ZSNES SDL uses GCC, SDL v1.20, and ManyMouse; and ZSNES DOS
uses DJGPP, CWSDPMI, and UPX.
Thanks to those who produced these fine programs!
Special Thanks to:
- wnelson; without him, ZSNES would have never existed!
- Y0SHi for his excellent SNES docs, his help, and his excellent support!
- Ashley, Barubary, CyberWarriorX, DCX, DooMStalK, Fanwen, GreenImp, Hucard,
Kaiden, PolestaR, Stalphos Knight, Star Creator, TeleKawaru, the people on
the ZSNES IRC channel, and the regulars of the ZSNES message board!
- All of our beta testers for being a great help!
- The MAME team; info on 256x256x256 scanlines mode is from the MAME source!
Also Thanks to:
- The_Teach of Snes9x for some great info and the nice chats!
- Trepalium of Snes9x for some great info and help!
- Gary of Snes9x and Steve Snake of Kega for being the source of info for
sound decompression!
- Gary of Snes9x for being the source of info for TCall/PCall and also for
lots of help!
- MrGrim for his great support!
- Crono for info on Sound Blaster programming, surround sound, sound
interpolation, and other sound stuff!
- Aquis for the ZSNES logo!
- Alucard for helping us with an issue in the 65816!
- Vertigo for making a compatibility list!
- EFX for being a great supporter and also giving a lot of help and stuff!
- Zophar for being a great supporter and also maintaining the mirror site!
- Chris Hickman for redesigning the ZSNES web page!
- CSoft [http://www.csoft.net] for (previously) hosting our web page!
- Marius Fodor for the code for VSync, Sidewinder, Gamepad Pro, and some
optimization info!
- Sardu for some great info and help!
- Lord ESNES for some great help!
- Robert Grubbs for the Sidewinder info!
- Nerlaska for some useful info on optimizing and also for some help!
- Diskdude for writing SNESkart which we used for the info on cheat codes!
- DarkForce for some great help!
- Pharos for some keyboard coding help!
- Ivar and Gary of the Snes9x team for all their great help, which includes
their SuperFX info and code, DSP-1 info, info on interleave formats (HiROM
and SuperFX), offset per tile mode, FIR filter, and some insights on
SPC700 and HDMA bugs!
- WolfWings ShadowFlight for help on several issues of NASM!
- Wildfire for some help!
- A CoolMan for the algorithm for EAGLE!
- Neill Corlett for some info on the .ips format and also helping out a lot
on improving the sound engine!
- Kreed for the 2xSaI and Super Eagle source codes!
- Markus Oberhumer and Laszlo Molnar for the UPX compression utility
[http://upx.sourceforge.net].
- Jean-loup Gailly, Mark Adler, and Gilles Vollant for the unzip routines!
- kode54 for the low pass filter routines!
- Andy Goth for some help on the design of the key combination engine!
- Yamaha of XYZZ (Scott Scriven) for his water effect code.
- ipher for compiling and releasing WIP builds!
- cdbsi for the ZSNES icons!
- The Dumper for lots of help with special chips.
- snes6502 for the Xbox port!
- hector and BRPXQZME for helping to port ZSNES to Mac OS X!
- The NSRT Team, for their excellent utility, JMA compression, NSRT headers,
and a great database!
- All those people who contributed by either updating the docs, helping us,
supporting us, or reporting bugs!
The changelog [History.txt] contains innumerable credits to people for their
contributions or individual fixes. Many of them are not listed on this page.
Also thanks to all those whom we forgot!
Also, good luck to all those who are writing emulators, especially those who are
writing SNES emulators, including Snes9x [http://www.snes9x.com],
SNEeSe [http://sneese.sourceforge.net],
Super Sleuth [http://users.tpg.com.au/advlink/spx/],
and bsnes [http://www.byuu.org]!
. . . . . . . . . . . . . . . .
This documentation is best viewed in a fixed-width font such as "Courier New".
Copyright (C) ZSNES Team & ZSNES Documentation Team [License.txt]

View File

@@ -0,0 +1,483 @@
ZSNES v1.51 Documentation
================================
N a v i g a t i o n
================================
* Index [Index.txt]
* Readme [Readme.txt]
* GUI [GUI.txt]
* Netplay [Netplay.txt]
* Advanced Usage [Advanced.txt]
1. Movie Dumping
2. Configuration Files
3. Debugger
4. KitchenSync
5. Command-Line
* Games [Games.txt]
* FAQ [FAQ.txt]
- - - - - - - - - - - - - - - - - -
* Getting Support [Support.txt]
* History [History.txt]
* About [About.txt]
* License [License.txt]
- - - - - - - - - - - - - - - - - -
* NSRT Guide: [http://zsnes-docs.sf.net/nsrt]
* ZSNES Home Page: [ZSNES.com]
================================================================================
~ A d v a n c e d U s a g e
================================================================================
This page documents the advanced features of ZSNES, probably not useful for most
end users.
............................................................
1. Movie Dumping
............................................................
Please note that ZSNES does not support real-time video encoding. ZSNES only
encodes existing ZMV (ZSNES movie) files. Refer to the GUI page [GUI.txt] for
instructions on recording movies.
All instructions in this section assume that you are using the default settings
of the zmovie.cfg file. If you are smart enough to edit zmovie.cfg, you had
better be smart enough to dump movies with whatever new settings you've created.
You can dump video output alone, audio output alone, both at the same time (to
separate files), or both to the same file (merged). If you choose to dump audio
output, you can choose to dump that audio output uncompressed or compressed to
MP3. Both uncompressed and compressed audio can be merged with the video.
- - - - - - - - - - - -
About Video Encoding
- - - - - - - - - - - -
Video encoding requires MEncoder [http://www.mplayerhq.hu].
- - - - - - - - - - - -
About Audio Encoding
- - - - - - - - - - - -
Audio encoding requires LAME [http://lame.sourceforge.net]. Currently, Windows
users *must* use this fixed LAME build [http://nsrt.edgeemu.com/lame.zip] due to
a bug in the official versions.
You have a choice of dumping audio either in uncompressed PCM format with WAV
header, or compressed as MP3. ZSNES uses LAME [http://lame.sourceforge.net] for
MP3, so you can expect high-quality audio, given the bit rate.
When dumping audio to a separate file (not merged with video), audio compressed
to MP3 will be about 6% of the size of the same uncompressed PCM audio.
- - - - - - - - -
Dumping a Movie
- - - - - - - - -
1. Place your MEncoder (mencoder.exe) and LAME (lame.exe) binaries in the same
directory as ZSNES. Alternatively, configure your PATH environment variable
to include the directories where MEncoder and LAME are installed.
2. Start ZSNES and load a game.
3. Open the Movie Options dialog. (Misc Menu->Movie Opt).
4. Make sure to select the correct movie slot, depending on which movie slot
you used to record a ZMV.
5. Select the Dumping tab, and configure the Video Options and Audio Options
to your liking [GUI.txt].
6. Hit the Start button.
7. ZSNES will then exit the GUI and start playing back the previously recorded
movie. If you chose to encode the video and/or audio output, you will see a
console window appear, showing the progress of encoding. Don't worry if
ZSNES slows down while playing back the movie; it needs to do this because
the encoding process takes a lot of processor time.
8. ZSNES will indicate when the movie has finished playback (and encoding).
You can now look in your ZSNES directory for the newly created file(s).
Note: ZSNES does not create an uncompressed temporary file and then encode it.
Instead, the output stream is directly encoded. The only output files will be
the finished, compressed files. Because ZSNES must encode the output stream as
it is generated, ZSNES may delay the output of new frames of video/audio to
give more time to MEncoder/LAME to compress the current frame. This means that
you should *not* worry if you see the playback of your movie slow down while
ZSNES is dumping it. The dumped file(s) will play back at full speed!
............................................................
2. Configuration Files
............................................................
Every time you run ZSNES, it checks to see if these files are present in the
same directory as the ZSNES executable. If they are not, ZSNES will create them
with their default values. Thus, if you are having weird problems with ZSNES,
try deleting these files.
If there are any missing or invalid lines in zsnes*.cfg, ZSNES will insert or
replace the lines with their default values.
- - - - - - -
zsnes*.cfg
- - - - - - -
Almost every option available in ZSNES can be configured in this file. If there
is something you don't understand in this file, please refrain from changing it,
and instead set the option from within the ZSNES GUI [GUI.txt].
The last letter of the filename is different for each port.
Windows: zsnesw.cfg SDL: zsnesl.cfg DOS: zsnes.cfg.
- - - - - - -
zmovie.cfg
- - - - - - -
This file contains movie-dumping configuration information.
You can edit this file to make ZSNES use something other than MEncoder or LAME,
or to tweak options. Read the MEncoder and LAME manuals to see what options you
can tweak. If you choose other applications, they must support stream input via
stdin and raw video (in the case of video encoding). Refer to the appropriate
documentation for more information.
Unfortunately, you're on your own if wish to play with this.
- - - - - - -
zfont.txt
- - - - - - -
This file contains the font data for the ZSNES GUI. You can edit this file to
customize the font.
* Comments are preceded by a ; and can be up to 99 characters in length.
- In the default file, each comment precedes the character it's labeling.
* Each letter is represented by a block of five rows, each containing 8 bits.
Only the first five columns of bits are used for font data; ZSNES uses a 5x5
font. The last three columns of bits should always be zeros.
- There are characters for English, Hiragana, and Katakana scripts.
* In case it isn't obvious, a 1 means the pixel is on in that location. A 0
means it's off. If you view zfont.txt, you should be able to figure it out.
* The file terminates on the EOF+newline character or the last character
(whichever comes first).
The absolute ordering of each and every line in this file is *important*. If
you're missing a single line, things might start messing up. Just so you know,
the last line of data should be on line 846, followed by the EOF character on
line 847.
If you mess something up, just delete zfont.txt, and ZSNES will re-generate it
as normal.
............................................................
3. Debugger
............................................................
The debugger, now available in all ports, is enabled only when you enter ZSNES
with a -d (If you are using the DOS port, just type "zsnes -d" at the
commandline. Win port users should add a "-d" after their ZSNES shortcut
target). Loading a ROM via a command line will start ZSNES in debugger mode;
otherwise press F1 to reach it.
Average users, however, should have no need to use the debugger.
- - - - - - - - - - - - - - - -
. . Debugger . Keys . .
- - - - - - - - - - - - - - - -
|Key| |Function|
- - - - - - - - -
1 Enable/Disable SPC700 display
2 Enable/Disable 65816 display
T Trace (in 65816 opcodes)
B 65816 break point
S SPC break point
C Clear counter
M 65816 modify
A SPC modify
D Debug dump (SPC/DSPRAM dump only)
W Break at signal (used only by the programmers)
F1 Switch between debugger input and game input
F2 Save state
F4 Load state
Esc Exit entire program
............................................................
4. KitchenSync (Win port only)
............................................................
This makes NTSC games (60Hz) run at 120Hz, and PAL games (50Hz) run at 100Hz.
To enable it, just start ZSNESw with the -ks switch. Alternatively, you can
create a shortcut to ZSNESw that starts with this switch enabled, every time.
First create a shortcut to ZSNESw in Windows. Next, right-click on the shortcut
and choose Properties. Then, put the cursor right after the quotation marks in
the Target box, press the space bar, and type -ks. Finally, click OK. If ZSNESw
crashes or refuses to start after enabling this, your monitor does not support
the 100/120 Hz refresh rate.
If your monitor supports 100Hz and not 120Hz, you can instead use the -kp switch
for PAL only. This way, you will not have to disable the -ks switch every time
you wish to play an NTSC game.
............................................................
5. Command-Line Arguments
............................................................
ZSNES supports execution arguments via the command line. More detailed
descriptions of how to use the arguments with each port is forthcoming.
Further detail of each argument's effect is given in [GUI.txt] for the
corresponding GUI option, if one exists.
Usage : zsnes* [-d,-f #, ... ] filename.sfc
Example : zsnes* -s -r 2 game.sfc
*Fill in the appropriate letter for your port when entering this into the
command line.
- - - - - - - - - - - - - - - -
. . Universal Switches . .
- - - - - - - - - - - - - - - -
Argument|Sub-Arg.|Description
= = = = = = = = = = = = = = =
-1 #/-2 # Select Player 1/2 Input
0 None
1 Keyboard
-d Start with debugger enabled
-dd Disable sound SPC700/DSP emulation, which also disables sound
output
-dh Disable ROM-specific hacks
-ds Disable sound output
-f # [0...9] Enable fixed frame rate
-g # [0...15] Specify gamma correction value
-h Force HiROM
-j Disable Mouse (Automatically turns off right mouse click)
-k # [0...100] Set Volume Level
-l Force LoROM
-m Disable GUI (Must specify ROM filename)
-mc Exit ZSNES when closing a movie (use with -zm)
-md # Dump video (use with -zm)
1 Raw
2 FFV1
3 x264
4 XviD
5 Custom
-ml # Define movie dump length in amount of frames (use with -md)
-n # Enable scanlines (when available)
0 None
1 Full
2 25%
3 50%
-o Disable MMX support
-p # [50...150] Percentage of instructions to execute
-r # Set sound sampling rate
0 8000Hz
1 11025Hz
2 22050Hz
3 44100Hz
4 16000Hz
5 32000Hz
6 48000Hz
-s Enable sound output and enable SPC700/DSP emulation
-sa Show all extensions in GUI (*.*)
-t Force NTSC timing
-u Force PAL timing
-v8 Grayscale mode
-y Enable Interpolation graphics filter
-z Disable stereo sound
-zm # [0...9] Auto load specified movie slot on startup
-zs # [0...99] Auto load specified save state slot on startup
- - - - - - - - - - - - - - - -
. . Windows-only Switches . .
- - - - - - - - - - - - - - - -
From the Windows NT command-line, you can use the following command to view the
accepted command-line input for a given ZSNES binary: "zsnesw -? | more".
Typing "zsnesw -?" does not work.
Users of any flavor of Windows can use the following command to output to a file
the same information returned from the command above: "zsnesw -? > commands.txt"
Argument|Sub-Arg.|Description
= = = = = = = = = = = = = = =
-3 Enable triple buffering (disables VSync)
-6 # [50...180] Force a user-specified refresh rate for fullscreen modes
-js # [0...32767] Set joystick sensitivity
-kp Enable the KitchenSync for PAL only (100Hz)
-ks Enable the KitchenSync for NTSC and PAL (120Hz/100Hz)
-v # Select Video Mode:
0 256x224 R WIN
1 256x224 R FULL
2 512x448 R WIN
3 512x448 DR WIN
4 640x480 S WIN
5 640x480 DS WIN
6 640x480 DR FULL
7 640x480 DS FULL
8 640x480 S FULL
9 768x672 R WIN
10 768x672 DR WIN
11 800x600 S WIN
12 800x600 DS WIN
13 800x600 S FULL
14 800x600 DR FULL
15 800x600 DS FULL
16 1024x768 S WIN
17 1024x768 DS WIN
18 1024x768 S FULL
19 1024x768 DR FULL
20 1024x768 DS FULL
21 1024x896 R WIN
22 1024x896 DR WIN
23 1280x960 S WIN
24 1280x960 DS WIN
25 1280x960 S FULL
26 1280x960 DR FULL
27 1280x960 DS FULL
28 1280x1024 S WIN
29 1280x1024 DS WIN
30 1280x1024 S FULL
31 1280x1024 DR FULL
32 1280x1024 DS FULL
33 1600x1200 S WIN
34 1600x1200 DS WIN
35 1600x1200 DR FULL
36 1600x1200 DS FULL
37 1600x1200 S FULL
38 CUSTOM D WIN
39 CUSTOM DS FULL
40 CUSTOM WIN
41 CUSTOM S FULL
42 CUSTOM DR FULL
-w Enable VSync (disables triple buffering)
- - - - - - - - - - - - - - - -
. . . SDL-only Switches . . .
- - - - - - - - - - - - - - - -
Argument|Sub-Arg.|Description
= = = = = = = = = = = = = = =
-ad <> Audio Driver (note you may not have all of these):
auto Select a driver automatically - uses SDL without libao
null No sound, only available with libao
oss Open Sound System, only available with libao on UNIX systems
with OSS
alsa Advanced Linux Sound Architecture, only available with libao
on Linux systems with ALSA
alsa09 Advanced Linux Sound Architecture, only available with libao
on Linux systems with ALSA
polyp polypaudio (next generation GNOME sound server), only
available with libao and new versions of GNOME
esd ESounD or Enlightened Sound Daemon, only available with
libao and ESD installed
sun Sun Microsystem's audio system, only available with libao
and Solaris or certain BSD systems
irix IRIX audio system, only available with libao and IRIX
systems
nas Network Audio System, only available with libao and NAS
installed
arts Analog RealTime Synthesizer sound, only available with libao
on systems with aRts (KDE)
sdl Simple DirectMedia Layer sound
-js # [0...32767] Set joystick sensitivity
-v # Select Video Mode:
0 256x224 R WIN
1 256x224 R FULL
2 512x448 DR WIN
3 512x448 DR FULL
4 640x480 DR FULL
5 256x224 OR WIN
6 512x448 ODR WIN
7 640x480 ODS FULL
8 640x480 ODS WIN
9 640x560 ODR WIN
10 768x672 ODR WIN
11 800x600 ODS FULL
12 800x600 ODS WIN
13 896x784 ODR WIN
14 1024x768 ODS FULL
15 1024x768 ODS WIN
16 1024x896 ODR WIN
17 1280x960 ODS FULL
18 1280x1024 ODS FULL
19 1600x1200 ODS FULL
20 VARIABLE ODR WIN
21 VARIABLE ODS WIN
22 CUSTOM OD FULL
- - - - - - - - - - - - - - - -
. . . DOS-only Switches . . .
- - - - - - - - - - - - - - - -
Argument|Sub-Arg.|Description
= = = = = = = = = = = = = = =
-0 Force black background in 8-bit modes
-1 #/-2 # Select Player 1/2 Input:
2 2 Button
3 4 Button
4 6 Button
5 8 Button
6 Sidewinder #1
7 Sidewinder #2
8 Sidewinder #3
9 Sidewinder #4
10 Gamepad Pro #0
11 Gamepad Pro #1
12 LPT1 #1
13 LPT1 #2
14 LPT1 #3
15 LPT1 #4
16 LPT1 #5
-3 Enable triple buffering (disables VSync)
-8 Force 8-bit sound
-c Enable full/wide screen (when available)
-cc Enable small screen (when available)
-sp Report sound detection information
-v # Select Video Mode:
0 256x224x8B (MODEQ)
1 256x240x8B (MODEQ)
2 256x256x8B (MODEQ)
3 320x224x8B (MODEX)
4 320x240x8B (MODEX)
5 320x256x8B (MODEX)
6 640x480x16B (VESA1)*
7 320x240x8B (VESA2)
8 320x240x16B (VESA2)
9 320x480x8B (VESA2)
10 320x480x16B (VESA2)
11 512x384x8B (VESA2)
12 512x384x16B (VESA2)
13 640x400x8B (VESA2)
14 640x400x16B (VESA2)
15 640x480x8B (VESA2)
16 640x480x16B (VESA2)
17 800x600x8B (VESA2)
18 800x600x16B (VESA2)
-w Enable VSync (disables triple buffering)
*The 640x480x16B (VESA1) video mode is compatible with many video cards, but can
also be very slow. We recommend that you use a VESA2 mode if your video card
supports it. Please see the system requirements for more information
[Readme.txt].
. . . . . . . . . . . . . . . .
This documentation is best viewed in a fixed-width font such as "Courier New".
Copyright (C) ZSNES Team & ZSNES Documentation Team [License.txt]

View File

@@ -0,0 +1,748 @@
ZSNES v1.51 Documentation
================================
N a v i g a t i o n
================================
* Index [Index.txt]
* Readme [Readme.txt]
* GUI [GUI.txt]
* Netplay [Netplay.txt]
* Advanced Usage [Advanced.txt]
* Games [Games.txt]
* FAQ [FAQ.txt]
1. Universal
2. Win Port
3. SDL Port
4. DOS Port
- - - - - - - - - - - - - - - - - -
* Getting Support [Support.txt]
* History [History.txt]
* About [About.txt]
* License [License.txt]
- - - - - - - - - - - - - - - - - -
* NSRT Guide: [http://zsnes-docs.sf.net/nsrt]
* ZSNES Home Page: [ZSNES.com]
================================================================================
~ F. A. Q. (Frequently Asked Questions)
================================================================================
The FAQ page was first included in version 0.390 of ZSNES, released on
April 11, 1998.
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
Question Index
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
- - - - - - - - - - -
UNIVERSAL QUESTIONS
- - - - - - - - - - -
General
Where do I download games / ROMs?
What is the "save directory"?
Why are my games not saving?
Are the ZSNES data files compatible among the various ZSNES ports
(Win/DOS/SDL)?
Is there Toaster Support?
Games
Why don't my games work after applying IPS patches to them?
Does ZSNES support Snes9x, GoodSNES, and NSRT ROMs? Or only ZSNES ones?
Video
Why do my scanlines look awful?
Why am I missing some video filter options?
Sound
Why does ZSNES produce a lot of static?
Why am I missing some sound options?
Input
Why can't I press more than 2 keys at a time?
Why is one direction of the d-pad always held down, even when I'm not
pressing any keys?
How do I use both my keyboard and joystick for the 1st or 2nd player?
Why can't I set the keys/buttons for Player 2?
Why won't ZSNES accept input when I'm configuring the keys for my
gamepad?
This game tells me that it is not compatible with the MultiTap
(or an external device attached). What should I do?
Speed
Why is ZSNES slow?
Why does the game slow down even though I'm using auto frame rate and
the FPS is pretty high?
My games are running too quickly! How do I slow them down?
Miscellaneous
Does ZSNES support loading ROMs which are compressed?
Why doesn't ZSNES support the 7z, RAR, or ZIP deflate64 compression
formats?
Does ZSNES support multiple ROMs in a single ZIP or JMA file?
Can you make a Mac/PocketPC/PS2/whatever port?
- - - - - - - - - - - -
WIN-SPECIFIC QUESTIONS
- - - - - - - - - - - -
General
Why does ZSNESw crash and give me an error with dinput.dll?
I just switched from the DOS port to the Windows port of ZSNES;
why don't my savestates work? Are they incompatible?
Video
Why am I seeing double, with strange colors?
Why is the video choppy with an FPS of 60 and VSync on?
Sound
How come I don't get any sound?
- - - - - - - - - - - -
SDL-SPECIFIC QUESTIONS
- - - - - - - - - - - -
General
Can I run ZSNES without X?
I got ZSNES from my distro and I found a bug. To whom should I report it?
Should I use SVN?
I'm getting an error about gzdirect() missing when I try to compile
ZSNES. What's up?
- - - - - - - - - - - -
DOS-SPECIFIC QUESTIONS
- - - - - - - - - - - -
Video
How do you enable transparencies?
Why is there a layer of fog blocking my view?
Why am I getting error messages regarding VESA 2 drivers?
Sound
Why is there no sound?
Are there any plans to improve detection for non-SoundBlaster cards
(or supporting non-SB cards)?
I get a sound initialization error using my SB Live! (or any other
PCI card). How do I fix it?
Input
Why doesn't my Sidewinder pad work?
How do I get my daisy-chained Sidewinder to work?
Why doesn't my Gamepad Pro work?
Why doesn't my joystick work anymore?
Why does JB5/JB6 keep getting pressed whenever I try to change a key?
Freezing/Crashing Issues
Why does ZSNES freeze when I run it under pure DOS?
Why does ZSNES crash when I load a ROM?
Why does ZSNES freeze when I try to enter the GUI?
ZSNES gives me an "out of memory" error and I only have 16MB of RAM.
How do I fix this?
Miscellaneous
I'm using DJGPP 2.03 and I get an error about missing stdint.h.
What's wrong?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1. UNIVERSAL QUESTIONS
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
................................
General
................................
Q: Where do I download games / ROMs?
A: Due to the questionable legality of ROM images of commercial games (see
[http://en.wikipedia.org/wiki/Rom_images#Legal_status_of_ROMs]), the ZSNES
Team *cannot* and *will not* provide you with any games / ROMs. We must do
this in order to keep ZSNES, as an emulator, legal. Please see the disclaimer
[Readme.txt].
Q: What is the "save directory"?
A: Please read more about the types of files ZSNES generates and where they are
created in the Files section of [Readme.txt].
By default, in the Win and DOS ports of ZSNES, these files will go into their
corresponding ROM directory (e.g. If your Chrono Trigger ROM is in
"C:\SNES Games\RPG", its files will go into that folder; if your Harvest Moon
ROM is in "C:\SNES Games\Simulation", its files will go into that folder).
In the SDL port of ZSNES, however, saves will go into "~/.zsnes" by default.
ZSNES SDL under Mac OS X will place them in
"~/Library/Application Support/ZSNES" instead.
If you dislike the default settings, you can configure a single, universal
save path by either going to the Config->Paths menu in the GUI or by editing
the ZSNES configuration file [Advanced.txt].
Q: Why are my games not saving?
A: If your ROM images are stored on a CD-ROM, you need to define a save
directory that points to your hard drive. In order to do this, either go to
Config-->Paths and enter a directory, or edit the ZSNES configuration file by
typing in a directory after "SaveDirectory=". Make sure that this directory
is not marked read-only.
If this still does not solve your problem, enable SRAM Check + Save under the
Config-->Saves menu.
Q: Are the ZSNES data files compatible among the various ZSNES ports
(Win/DOS/SDL)?
A: Yes. Unlike certain PC applications and games, ZSNES's various save files
and formats are completely port-independent; you can share any of your files
with any user using any port of ZSNES (although some things may be
version-dependent). Note, however, that ZSNES's configuration file
[Advanced.txt] contains port-specific options which don't exist in other
ports, so while they can be transfered between ports, some things won't work
as expected. Note that when transfering various files, make sure they're
named properly and in the proper location (see the Files section [Readme.txt]
for details).
Q: Is there Toaster Support?
A: While we'd love for ZSNES to lace our shoes, feed us, breathe for us, and
amass wealth for us, we can't add every crazy feature that comes up.
Even though ZSNES does have many, many features that are not necessarily
SNES related, they normally don't go beyond features that you'd expect from
an advanced gaming system.
Regarding toaster support itself, rumor has it ZSNES does bread toasting
if you happen to be using it after midnight while paying your respects
to the master of all controls and considering monetary options.
................................
Games
................................
Q: Why don't my games work after applying IPS patches to them?
A: If your patched game crashes early or just displays a black screen, you
probably need to either add or remove the 512 byte offset from the patch.
Use the program IPSEDIT to do this, which is bundled along with NSRT.
Alternatively, you could either add or remove a header from your ROM before
patching. Again, NSRT is capable of doing this. [http://nsrt.edgeemu.com]
Q: Does ZSNES support Snes9x, GoodSNES, and NSRT ROMs? Or only ZSNES ones?
A: ZSNES, Snes9x, GoodSNES, and NSRT ROMs do not exist. All these programs work
with SNES ROMs. As ZSNES is an SNES emulator, it will work with all SNES ROMs
(except where ZSNES has a bug or the ROM is in an unsupported interleave
format).
................................
Video
................................
Q: Why do my scanlines look awful?
A: Scanlines can be negatively affected by the method of vertical scaling that
your video card uses, depending on the video mode you have selected for
ZSNES. This can sometimes result in scanlines that are not of uniform
darkness. The effect of this video scaling is most noticeable with Full
scanlines, with 50% and 25% scanlines being less noticeable. To display the
scanlines effect properly, you should use resolutions based on a multiple of
256x224 in windowed modes (e.g. 512x448) and 320x240 for fullscreen modes
(e.g. 640x480).
Q: Why am I missing some video filter options?
A: Please make sure you have MMX Support enabled in the Options dialog. Refer to
the Video Config description in [GUI.txt] to see what video options require
MMX support.
................................
Sound
................................
Q: Why does ZSNES produce a lot of static?
A: There could be many reasons why you are hearing static. If you are using the
Windows port and you have an ISA sound card, this could be your problem. If
you are using the DOS port, and you have a PCI sound card, this could also be
your problem. If your sound card is using SoundBlaster emulation, you
probably need to use 8-bit sound, but this can make sound output worse. You
can also try doing the following things to improve your sound: Reduce your
sampling rate or disable lowpass filtering and stereo sound; Win port users
can also enable the Primary Sound Buffer.
Q: Why am I missing some sound options?
A: Please make sure you have MMX Support enabled in the Options dialog. Refer to
the Sound Config description in [GUI.txt] to see what sound options require
MMX support.
................................
Input
................................
Q: Why can't I press more than two keys at a time?
A: Many PC ("Personal Computer") keyboards limit the number of key signals that
can be transmitted simultaneously. For example, certain combinations of three
or more alphanumeric keys may not work. Conversely, there may be some
combinations of three or more keys that *do* work. You would just have to
test by trial-and-error to find out, since these combinations can vary
between keyboards. Joysticks and gamepads generally don't have this
limitation.
If you must use a keyboard, you can set multiple game keys to a single
keyboard key. Alternatively, you could set some keys to the right and left
Ctrl and Shift keys, since most keyboards do not restrict signals from
these keys.
Q: Why is one direction of the d-pad always held down, even when I'm not
pressing any keys?
A: ZSNES auto-calibrates any connected gamepads/joysticks when it first starts.
Thus, if one of the buttons or directions is accidentally held down while
ZSNES is starting, ZSNES will think this is "normal" or "zero" input, even
when you let go of the button. To fix the problem, simply close ZSNES, make
sure no buttons are pressed and all axis are centered on your
gamepad/joystick, and restart ZSNES. It will then auto-calibrate to the
correct "zero" settings.
Q: How do I use both my keyboard and joystick for the 1st or 2nd player?
A: First, configure the Player 1 pad (Config-->Input--> #1) for your normal
set-up (for example, a keyboard). Next, configure the Player 3 pad
(Config-->Input--> #3) to use your alternative set-up (for example, a
joystick or gamepad). When you want to switch between your regular and
alternative set-up, go to the Config-->Options menu and check
USE PL3/4 AS PL1/2. Now the Player 3 controls act as the Player 1 pad, and
Player 4's controls act as the Player 2 pad. To return to the normal
controls, simply uncheck this option. Follow the same procedure to create a
similar set-up for Players 2 and 4.
Note: Enabling the option USE PL3/4 AS PL1/2 disables MultiTap emulation.
Q: Why can't I set the keys/buttons for Player 2?
A: You need to set the Current Device before ZSNES will allow you to set the
individual keys for Player 2 (or Players 3, 4, or 5). If NONE is shown after
CURRENT:, the input cannot be changed (or used, for that matter). See the
Input section of the GUI page [GUI.txt] for further instructions.
Q: Why won't ZSNES accept input when I'm configuring the keys for my gamepad?
A: Exit ZSNES and calibrate your input device. Then restart ZSNES and see if it
works.
Q: This game tells me that it is not compatible with the MultiTap (or an
external device attached). What should I do?
A: Set the input devices of player 3, 4, and 5 to "None". You may also need to
go to Config-->Options, and enable "Use Player 3/4 as Player 1/2".
Additionally, you could add an NSRT header to your ROM if you desire.
................................
Speed
................................
Q: Why is ZSNES slow?
A: First and foremost, does your computer meet the minimum system requirements
to run ZSNES? If not, there is little you can do to improve performance. That
being said, you can still try a number of things.
* Make sure that any major program(s) is/are closed (such as Winamp).
* Try the default settings of ZSNES before you do anything else. You can
reset ZSNES to the default settings by deleting all three of its
configuration files.
* Ensure that MMX Support is enabled in the Options dialog; this mode
should provide a noticeable speed increase for computers that can use it.
* Certain system configurations and video cards work better with certain
video modes. Try switching between different video modes until you find
one that has good/better performance. Things to remember when doing this
are that lower resolutions are faster than higher resolutions, full
screen modes are faster than windowed modes, and 'R' modes are faster
than 'S' modes (because no scaling is necessary).
* Make sure you are using Auto Frame Skipping. If you already are, try
increasing the Max Frame Skip.
* Do not use VSync; if you must use VSync, try also enabling Triple
Buffering.
* Disable all video filters.
* Compile ZSNES yourself with optimizations for your CPU's architecture.
* If you still need more speed, disable sound. If that's not enough,
disable SPC emulation (you must restart ZSNES for this option to take
effect). Some games will not work without SPC emulation.
If you have an old computer, such as one with a 486/100 processor, you will
probably be better off using older DOS versions of ZSNES, as the minimum
system requirements have increased slightly with subsequent releases. To
achieve greater speed, you may want to avoid using VESA video modes (although
this will disable transparencies). Experiment with the different video modes
and try the recommendations above to see which configuration provides the
best speed for you.
Q: Why does the game slow down even though I'm using auto frame rate and the FPS
is pretty high?
A: If you have ever played a real SNES, you may notice that some games slow down
even on it. To the extent that ZSNES accurately emulates an SNES, a game will
slow down in ZSNES in the same places it would slown down on a real SNES.
Q: My games are running too quickly! How do I slow them down?
A: You may have disabled auto frame skipping. Re-enable it in the
Config-->Speed menu.
If you don't want to use auto frame skipping, and you want to play in
windowed mode, you might want to set your monitor's refresh rate to 60hz
and enable VSync in ZSNES.
If you want to use fullscreen mode without using auto frame skipping,
you can enable the KitchenSync by using either the -ks (for NTSC/PAL)
or -kp (for PAL) command-line parameter (Windows port only) [Advanced.txt].
Also be sure to enable triple buffering.
................................
Miscellaneous
................................
Q: Does ZSNES support loading ROMs which are compressed?
A: Yes, but it depends on what compression format is used. ZSNES can currently
load ROMs that are compressed in the ZIP (method 0 - store and method 8 -
deflate), GZip, and JMA compression formats.
Many tools are available to create ZIP files. If you want a fast, commandline
based ZIP program that is available on many platforms, get Info-ZIP. Info-ZIP
also has a Windows front end called WiZ available if you prefer a GUI.
For creating GZip files, there are not too many choices. A fast, commandline
based compressor for the GZip format, available for several platforms, may be
downloaded at the GZip site [http://www.gzip.org]. If you use Windows, there
is a program with a GUI called 7-Zip [http://www.7-zip.org] that has support
for ZIP, GZip, and others. ZIP and GZip files created by 7-Zip are smaller
than those created with other programs, but 7-Zip takes a longer time
creating them. For users of Unix based operating systems who would like a GUI
front end for both ZIP and GZip, get Ark
[http://docs.kde.org/en/3.2/kdeutils/ark/], which is part of the KDE project.
To create JMA files, a format invented by Nach and the rest of the NSRT team
which offers the best compression ratio for SNES ROMs, you must use NSRT
[http://nsrt.edgeemu.com]. NSRT is also capable of compressing SNES ROMs into
ZIP and GZip formats.
Q: Why doesn't ZSNES support the 7z, RAR, or ZIP deflate64 compression formats?
A: ZSNES only supports formats which have an open-source, portable, and
easy-to-use library. The 7z and RAR formats do not yet have libraries that
fill those criteria. If you want the best compression ratio for your SNES
ROMs, you should use JMA. Currently, the only publicly available program that
can compress and decompress with JMA is NSRT [http://nsrt.edgeemu.com]. ZIP
deflate64 lacks a decompression library which ZSNES can use, but rumor has it
that Nach is working on one.
Q: Does ZSNES support multiple ROMs in a single ZIP or JMA file?
A: ZSNES currently does not support more than one ROM in a ZIP or JMA file,
although such support will probably be implemented in the future.
Q: Can you make a Mac/PocketPC/PS2/whatever port?
A: Since ZSNES is written in assembly, ports to any systems that are not 100%
x86 compatible are impossible. Try Snes9x [http://www.snes9x.com] for
portability.
Apple Computer, Inc. recently switched the Macintosh computers to use Intel
processors [http://www.apple.com/pr/library/2005/jun/06intel.html], and
as such ZSNES has already been modified to run on said computers. Just
compile the SDL port with an up-to-date NASM and zlib and everything normally
required.
Another third party developer recently ported ZSNES to the Microsoft Xbox as
well, and released it under the name "ZsneXbox". Unfortunately, we can not
provide a download link as this port is being illegally distributed as a
compiled XBE file. As a result, any link or support requests regarding this
port will be promptly ignored.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2. WIN-SPECIFIC QUESTIONS
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
................................
General
................................
Q: Why does ZSNESw crash and give me an error with dinput.dll?
A: If you get this error, download and install the latest version of DirectX.
You might also try running the DirectX Diagnostic Tool. You can do this by
clicking the Start button, then selecting "Run...". Type "dxdiag" after
"Open:", and click "OK". There are lots of options you can play with, so
please read everything before you start messing around. Specifically, go to
the "Display" tab, and under the "DirectX Features" section, click the
"Disable" button beside each feature. After they are all disabled, re-enable
them. Exit dxdiag, and try ZSNES again.
If none of that worked, try re-installing DirectX.
Q: I just switched from the DOS port to the Windows port of ZSNES; why don't my
savestates work? Are they incompatible?
A: The saves and savestates will work just as well with any port of ZSNES. You
simply need to rename all files that have .srm and .zst (and .zs1, .zs2,
etc.) extensions to match the filenames of your ROMs (or the jma/zip archives
that contain them).
For example, if you have "Super Mario World.zip" and "Super Mario RPG.zip",
both games will have saves that are labeled "SUPERM~1.SRM", "SUPERM~1.ZS2",
etc., and they will be differentiated only by the number after the "~" in the
filename.
If you need to find out which "~" number a game uses, open a DOS prompt
(a.k.a. Command Prompt), change to the ROM directory, and enter "dir /on /p"
(On some newer systems like Win2k you need to add the "/x" switch for the DOS
filenames to be displayed). Unfortunately, this method may not be accurate if
you have moved your ROMs to a different folder or another computer; you may
need to guess and hope for the best, trying to swap filenames a few different
ways between the saves before it works for all your games. If it comes down
to guessing, we recommend that you backup your save files before renaming
them.
Don't forget to put the files into your Save directory. A question concerning
the Save directory is under Universal Questions -> General [FAQ.txt].
................................
Video
................................
Q: Why am I seeing double, with strange colors?
A: Any change of resolution within ZSNES should correct the problem. Fullscreen
modes are recommended because they are faster than windowed modes.
If you still experience problems, see if these suggestions help (each should
be done/tried separately):
- The issue can be completely resolved with up-to-date video card drivers.
Keeping your device drivers fully updated will provide other benefits
unrelated to ZSNES.
- Set the resolution for ZSNES to the same one used by the Windows desktop.
- Try enabling 16-bit color depth in Windows.
Q: Why is the video choppy with an FPS of 60 and VSync on?
A: If you have VSync on, your monitor needs to be set to a refresh rate that is
a multiple of the framerate of the game. NTSC games natively run at ~60 FPS.
PAL games natively run at 50 FPS. Thus your monitor would need to be either
60Hz or 120Hz for NTSC games, or 50Hz/100Hz for PAL games. If you run ZSNES
with the -6 switch, with a sub-argument of '60', ZSNES will try to switch
your monitor to 60Hz refresh rate. You can use the -ks switch to make ZSNES
try to switch your monitor to 120Hz refresh rate. These two switches only
work in fullscreen modes and are for the Windows port only.
Please reference [Advanced.txt] for details on command-line switches.
You can also try enabling Triple Buffering (using the -3 switch or the GUI
option), however this currently only works in Full Screen modes. One last
thing you can try is to turn off auto frame-skipping, and set manual frame
rate to "0".
................................
Sound
................................
Q: How come I don't get any sound?
A: Either you accidentally disabled sound, you don't have a sound card, the
sound drivers aren't properly installed in your system, or your sound card is
not compatible with DirectSound (part of Microsoft's DirectX API
[Support.txt]). Also make sure that 'Disable SPC Emulation' is NOT checked.
See [GUI.txt] for more information about sound settings in ZSNES.
Try (re-)installing the latest version of DirectX, and make sure you have the
latest drivers for your sound card (WHQL Certified, if possible).
Please also note that ISA sound cards tend not to work with Windows, while
they do with DOS.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3. SDL-SPECIFIC QUESTIONS
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
................................
General
................................
Q: Can I run ZSNES without X?
A: Yes, but you'll need to have SDL compiled to use SVGAlib.
Q: I got ZSNES from my distro and I found a bug. To whom should I report it?
A: Compile ZSNES yourself and see if the bug still exists. If it does,
please tell us, otherwise be happy that ZSNES works now, and give your
distro a heads-up if you feel motivated enough.
Q: Should I use SVN?
A: SVN ("Subversion") is the best way to get the most up-to-date ZSNES source.
It is best to double-check with SVN if you have a problem, since we might
have already fixed it. If you find a new problem in SVN, please tell us, but
be warned that we won't take it too seriously if it involves something that's
currently being worked on.
To check out and install ZSNES from SVN, refer to this thread on the ZSNES
board [http://board.zsnes.com/phpBB2/viewtopic.php?t=7371].
Q: I'm getting an error about gzdirect() missing when I try to compile ZSNES.
What's up?
A: Make sure you're using zlib 1.2.3 or higher. Some distributions say you have
zlib 1.2.3 but in reality give you an older version. If your distribution is
being problematic, compile zlib yourself. Grab the latest version of zlib at
the official website. [http://www.zlib.net]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4. DOS-SPECIFIC QUESTIONS
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
................................
Video
................................
Q: How do you enable transparencies?
A: First, try setting the video mode to a 16-bit color mode in the GUI. (If
320x240x16b doesn't work, then try 640x480x16b). If it gives you an error
that says that your video card isn't compatible with VESA 2.0, you might want
to get Scitech Display Doctor. It provides certain cards with VESA 2.0
support. Running with transparencies on is definitely slower because of the
extra math equations, memory, and video space involved.
Q: Why is there a layer of fog blocking my view?
A: You need to either enable transparencies (see above), or you can disable
certain backgrounds by pressing the 1, 2, 3, or 4 keys. If you get lost while
pressing those keys, press 6 to re-enable all of the backgrounds.
Q: Why am I getting error messages regarding VESA 2 drivers?
A: Here is a list of the various error codes that you may be coming across,
along with descriptions of what they mean:
* VBE not detected - ZSNES failed to detect any VBE interrupts (Your video
card doesn't support VESA).
* VESA not detected - ZSNES failed to detect any VESA extensions (Your
video card doesn't support VESA).
* VESA 2.0 or greater required - Your video card supports VESA, but it has
an older version. You may want to use SciTech Display Doctor
[http://www.scitechsoft.com/sdd.html] to upgrade your VESA driver.
* VESA 2 mode does not work on your video card/driver - Meaning that the
resolution you requested does not exist in the supported resolutions of
your video card. Choose a different resolution or upgrade with SDD,
which can sometimes help increase the number of resolutions supported.
* Unable to initialize video mode - A VESA 2.0 driver is found, but the
video mode failed to start. There could possibly be an error on the
video card setting, or it may be a defective piece of hardware.
* Linear frame buffer not detected - Meaning that your video card does not
support linear frame buffering, which is required for the ZSNES VESA 2
routines.
................................
Sound
................................
Q: Why is there no sound?
A: There could be several situations:
- You haven't enabled sound. You can enable it through the GUI or through
zsnes.cfg. Also make sure that 'Disable SPC Emulation' is NOT checked.
- You need to make sure that the SET BLASTER variable is set properly. To do
this, type SET in DOS and look for a string starting with "BLASTER=". If
such a string exists, then this is not your problem.
- You don't have a SB2.0 compatible sound card. If this is your case, there
is nothing you can do at the moment. ZSNES uses auto-initialization mode
for sound which requires SB2.0+.
- Your SB IRQ conflicts with another device. If this is the case, you might
want to check your sound card settings through Control Panel -> System.
- ZSNES doesn't like your sound card.
- You can try using VDMSound [http://sourceforge.net/projects/vdmsound/].
Q: Are there any plans to improve detection for non-SoundBlaster cards (or
supporting non-SB cards)?
A: There is little effort put into major changes to the DOS code, since so few
people use that port these days. However, we will gladly accept anyone's help
in improving the DOS sound code.
Q: I get a sound initialization error using my SB Live! (or any other PCI card).
How do I fix it?
A: Here is a solution: (Thanks CyberGodz for the post on the forums!)
SB Live! uses what is known as a NMI, or Non Maskable Interrupt, to emulate
SB 16 sound. Don't ask us exactly what it does (it's a type of IRQ) but that
is pretty much all it is good for.
The problem is that many sound cards either lack NMI support or don't have it
enabled (No NMI = No DOS support).
To try and solve this problem, do the following:
- Check your BIOS. If there is an option for RAM parity checking, enable
it; it usually turns on NMI support. If there is something that says
"NMI", turn it on.
- If you don't find anything in your BIOS, then go to your motherboard's
website and download the latest BIOS flash. Install it and try your DOS
sound (You may still have to enable the stuff in the BIOS afterwards).
- Failing the first two things, you could either get a new motherboard or
get another compatible sound card alongside the SB Live!. Just attach a
cable from the line out of the SB 16 to the line in of the SB Live!.
Enable line in on the mixer of your SB Live! and it should route the
sound through the old sound card (Don't use the SPDIF to connect the
cards if you have one; wave sound doesn't pass through SPDIF--only MIDI).
................................
Input
................................
Q: Why doesn't my Sidewinder pad work?
A: First, for non-USB Sidewinders, you should disable the Sidewinder profiler
from the Win9x icon tray, run ZSNES, set Input #1 as SidewinderPad1, then
press the mode button a few times. If that doesn't work, try the following:
- Try checking or unchecking the Sidewinder Fix option under
Config Menu -> Options and repeat the above steps.
- Fully disable the Win9x Sidewinder drivers by going to Control Panel/Game
Controllers. Then remove the Sidewinder (Thanks Scarlet-Slider for this
info!).
- Run ZSNES under pure DOS.
- Again, try checking or unchecking the Sidewinder Fix in the options menu of
the GUI and repeat the above 2 steps.
- Make sure your Sidewinder is plugged in and is not broken.
For USB joysticks, you can either set ZSNES as a 6-button joystick or
simulate keyboard keys through the Sidewinder profiler by setting Input #1 as
a keyboard with those defined keys.
Q: How do I get my daisy-chained Sidewinder to work?
A: First, run ZSNES. Temporarily disconnect the second Sidewinder pad from the
first one, get the first one to work, then re-connect the second Sidewinder
pad.
Q: Why doesn't my Gamepad Pro work?
A: For the non-USB version, be sure to have your Gamepad Pro set on 'GrIP' mode.
Then set the input device as Gamepad Pro P0. For the USB version, you can use
a keyboard emulator, which should be included with the software that came
with your joystick.
Q: Why doesn't my joystick work anymore?
A: You might have accidentally clicked the 'Use Joystick Port 209H' check box.
Just uncheck it.
Q: Why does JB5/JB6 keep getting pressed whenever I try to change a key?
A: Try changing your joystick type from 6-button to 4-button.
................................
Freezing/Crashing Issues
................................
Q: Why does ZSNES freeze when I run it under pure DOS?
A: Try loading your mouse driver or run ZSNES using the -j switch. For the most
compatible result, use the Microsoft Mouse driver if possible.
Q: Why does ZSNES crash when I load a ROM?
A: It could be that ZSNES doesn't recognize your sound configuration. To fix it,
disable sound or try changing your sound configuration. Also see this
question: (Universal-->Freezing/Crashing Issues) "Why does ZSNES crash
as soon as I load a ROM?"
Q: Why does ZSNES freeze when I try to enter the GUI?
A: Run ZSNES using the commandline -j.
Q: ZSNES gives me an "out of memory" error and I only have 16MB of RAM. How do I
fix this?
A: If you are running the DOS port of ZSNES from within Windows, try restarting
the computer in DOS mode; more RAM should then presumably be available for
ZSNES to use. To get it running under Win9x, first create a shortcut to the
DOS prompt on the desktop (the filename 'target' can be "C:\command.com").
Next, right-click on the icon and go to Properties. Then, select the Memory
tab and look below for Protected Mode (DPMI) settings and set a high value
(like 20000). Last, double-click on that icon and load ZSNES as usual.
................................
Miscellaneous
................................
Q: I'm using DJGPP 2.03 and I get an error about missing stdint.h. What's wrong?
A: You're probably missing this file. Download the latest version of this file
and put it in DJGPP's include directory.
. . . . . . . . . . . . . . . .
This documentation is best viewed in a fixed-width font such as "Courier New".
Copyright (C) ZSNES Team & ZSNES Documentation Team [License.txt]

View File

@@ -0,0 +1,600 @@
ZSNES v1.51 Documentation
================================
N a v i g a t i o n
================================
* Index [Index.txt]
* Readme [Readme.txt]
* GUI [GUI.txt]
* Netplay [Netplay.txt]
* Advanced Usage [Advanced.txt]
* Games [Games.txt]
1. ROMs
2. Compatibility
3. Special-Chip Games
4. Special Cartridges
- BS-X (Satellaview)
- Super Gameboy
5. Individual Game Issues
6. Games Supported by ManyMouse
7. Multiplayer List
* FAQ [FAQ.txt]
- - - - - - - - - - - - - - - - - -
* Getting Support [Support.txt]
* History [History.txt]
* About [About.txt]
* License [License.txt]
- - - - - - - - - - - - - - - - - -
* NSRT Guide: [http://zsnes-docs.sf.net/nsrt]
* ZSNES Home Page: [ZSNES.com]
================================================================================
~ G a m e s
================================================================================
............................................................
1. ROMS
............................................................
** ROMs are not included with ZSNES!!! ** You must find them on your own.
Please read Wikipedia's article on ROM Images for a general overview.
[http://en.wikipedia.org/wiki/ROM_image]
In relation to SNES emulation, a "ROM image" is a computer file which is an
exact copy of the data that is contained in a 'R'ead 'O'nly 'M'emory chip inside
a game cartridge. This file contains the same data that a real SNES console
reads from the game cartridge. An SNES emulator loads this ROM into its own
memory, very much like how a real SNES operates.
A problem appears when you have a ROM image that is not an exact copy of the
data on a real SNES cartridge. Many of the ROMs available for download on the
Internet are not in fact exact copies of real SNES games. There are a variety of
reasons why a ROM that appears to be a real game is not an exact copy of the
cartridge data. For example, the ROM may have been incorrectly "dumped" from the
cartridge, which can introduce errors. Certain prolific ROM "releasers" will
"hack" a ROM to include an introduction that advertises the releaser. Regardless
of the reason for an imperfect ROM image, these "bad" ROMs can display errors
when they are played in an emulator.
Emulator developers generally try to make their emulators work with "good" ROMs;
that is, ROMs that are perfect copies of the data on a real game cartridge. The
developers of ZSNES in particular are unable to provide any help to people who
are using "bad" ROMs. You must use a good ROM if you want any chance of playing
an error-free game.
We recommend using NSRT to verify that your ROMs are "good" dumps. In some
cases, NSRT can actually modify a "bad" ROM in such a way that it becomes a
"good" ROM. Please read the documentation included with NSRT for additional
information. [http://nsrt.edgeemu.com]
............................................................
2. Compatibility
............................................................
There are many reasons why a particular ROM may not work correctly with ZSNES.
Here is a list of things you can do to improve your chances of a ROM working
with ZSNES:
* Make sure your ROM is actually a "good dump." Often a ROM appears to be from
a particular game/cartridge, but it *is not* in fact a perfect copy of the
data on that cartridge. You can use NSRT to scan your ROM and tell you if it
is a good dump. In some cases, NSRT can actually modify a "bad" ROM in such
a way that it becomes a "good" ROM.
* Your ROM may be a game that uses the SuperFX special chip. It may also be
"interleaved." ZSNES cannot detect when a ROM is interleaved with the
SuperFX interleave method. There is more information about this below, in
the Special-Chip Games section under SuperFX. In cases where ZSNES cannot
detect a ROM's interleave method, ZSNES will incorrectly report the ROM as
-not- interleaved, and the ROM will fail to load.
* If you have turned off sound, you should re-enable it. If you wish to mute
the sound output, simply move the volume slider to 0%. Many games require
sound emulation to be active in order to work correctly, so disabling sound
can "break" a lot of games.
* If you have changed the percentage of execution in the ZSNES configuration
file, change it back to 100. However, there are a few particular games that
may work better if the percentage to execute is set to either 120% or 80%.
The developers of ZSNES make no guarantee that any particular game will work.
While we wish to play these incompatible games as much as you do, sometimes it
is just not possible. Furthermore, ZSNES is in a constant state of development.
Compatibility with a particular game may change between releases of ZSNES.
In the past, ZSNES developers programmed the emulator to "hack" certain games.
These "hacks" would modify in-memory certain incompatible games, to get them to
work with ZSNES. Some hacks were also used make certain games run at full speed
if they were too slow. Sometimes, however, a particular game hack will break
other parts of accurate SNES emulation.
As the emulation accuracy of ZSNES has improved, these hacks have become less
necessary. In general, game hacks are removed whenever possible. With the
current state of emulation in ZSNES, no new game hacks will be added.
In conclusion, if you have tried the steps above, and your game still doesn't
work, *we're sorry*; however there is nothing we can do. ZSNES is developed for
*emulation accuracy*, with game compatibility as a side effect, *not* the other
way around. The most you can do is try another emulator or hope that ZSNES will
become accurate enough to be able to run your particular game.
............................................................
3. Special-Chip Games
............................................................
The approximate percentage of emulation progress for these special chips is
listed under Current Progress [Readme.txt].
The NSRT SNES Add-on Chip information article was frequently referenced for the
information assembled on this page. [http://nsrt.edgeemu.com/INFO/chipinfo.htm]
You may find that the section on Enhancement chips in the Super Nintendo article
at Wikipedia contains some interesting historical information, not covered in
this FAQ. [http://en.wikipedia.org/wiki/Super_Nintendo_Entertainment_System]
A number of games developed for the Super Nintendo included additional
special-purpose processors on the game cartridge. A game would use this special
processor to accomplish something that wasn't possible using just the standard
SNES hardware. It is impossible to represent these processors with ROM data; in
order for these games to work, ZSNES must emulate these special processors, in
addition to all the standard SNES hardware (which ZSNES already emulates).
Below is a list of all known special processors, followed by a list of the games
known to use each processor.
- - - -
C4
- - - -
The C4 chip is a math co-processor with limited graphical processing
capabilities.
* Megaman X 2 (USA) / Rockman X 2 (Japan)
* Megaman X 3 (USA, Europe) / Rockman X 3 (Japan)
- - - - - - - -
Nintendo DSP
- - - - - - - -
Each of the Nintendo DSP chips have identical hardware, but different software
(firmware).
+ DSP-1 (supported)
* Ace wo Nerae!
* Armored Trooper Votoms
* Ballz 3D / 3 Jigen Kakutou Ballz
* Battle Racers
* Drift King Shutokou Battle '94
* Drift King Shutokou Battle 2
* Final Stretch
* Hashiriya Kon
* Korean League
* Lock On
* Michael Andretti's Indy Car Challenge
* Pilotwings
* Super 3D Baseball
* Super Air Diver
* Super Air Diver 2
* Super Bases Loaded II
* Super F1 Circus Gaiden
* Super Mario Kart
* Suzuka 8 Hours
+ DSP-2 (supported)
* Dungeon Master
+ DSP-3 (partially supported)
* SD Gundam GX
+ DSP-4 (supported)
* Top Gear 3000 (USA) / Planets Champ TG 3000 (Japan)
- - - -
OBC1
- - - -
* Metal Combat
- - - -
SA-1
- - - -
<20>The SA-1 is a 65816 chip, although at a higher clock then the SNES's
internal one.<2E> [Quoted from http://nsrt.edgeemu.com/INFO/chipinfo.htm]
* Asahi Shinbun Rensai - Katou Ichi-Ni-San Kudan Shougi Shingiru
* Daisenryaku Expert WWII
* Derby Jockey 2
* Dragon Ball Z - Hyper Dimension
* Hanyuu Meijin no Omoshiro Shougi
* Harukanaru Augusta 3 - Masters New
* Hayashi Kaihou Kudan no Igo Taidou
* Itoi Shigesato no Bass Tsuri No.1
* J. League '96 Dream Stadium
* Jikkyou Oshaberi Parodius
* Jumpin' Derby
* Kakinoki Shougi
* Kirby Super Star (USA) / Hoshi no Kirby - Super Deluxe (Japan)
/ Kirby's Fun Pak (Europe)
* Kirby's Dream Land 3 (USA) / Hoshi no Kirby 3 (Japan)
* Marvelous
* Mini Yonku Shining Scorpion - Let's & Go!!
* Pebble Beach no Hatou New - Tournament Edition
* PGA European Tour
* PGA Tour 96
* Power Rangers Zeo - Battle Racers
* Saikousoku Shikou Shougi Mahjong
* SD F-1 Grand Prix
* SD Gundam G-NEXT cartridge ROM (G-NEXT.SFC)
* Shin Shougi Club
* Shougi no Hanamichi
* Shougi Saikyou
* Shougi Saikyou II
* Super Bomberman - Panic Bomber W
* Super Mario RPG
* Super Robot Wars Gaiden
* Super Shougi 3 - Kitaihei
* Taikyoku Igo - Idaten
* Takemiya Masaki Kudan no Igo Daishou
- - - -
S-DD1
- - - -
* Star Ocean
* Street Fighter Alpha 2 (USA/Europe) / Street Fighter Zero 2 (Japan)
- - - - - -
Seta DSP
- - - - - -
Seta's DSP has 2 major firmwares.
+ Seta 10 / ST010 (supported)
* F1 ROC II (USA) / Exhaust Heat II (Japan)
+ Seta 11 / ST011 (partially supported)
* Hayazashi Nidan Morita Shougi
- - - - - -
Seta RISC
- - - - - -
The Seta RISC chip is not emulated.
+ Seta 18 / ST018
* Hayazashi Nidan Morita Shougi 2
- - - - -
SPC7110
- - - - -
* Far East of Eden Zero
* Far East of Eden Zero - Shounen Jump no Shou
* Momotarou Dentetsu Happy
* Super Power League 4
ZSNES does not fully support the SPC7110 chip yet. However, you may use some
third party graphics decompression packs to get the four above games to work.
The SPC7110 graphic packs are mirrored on a number of sites on the Internet.
Here are a few:
* ipher's WIP Pages [http://other.ipherswipsite.com/gpacks/]
* NSRT Official Site [http://nsrt.edgeemu.com]
* Caitsith2's Personal Web Page [http://www.caitsith2.com]
After you have downloaded all of the parts, extract them all into a new
directory on your disk. Then go to the Config-->Paths menu in the GUI
and enter in the location of the folder in the appropriate field.
- - - -
S-RTC
- - - -
* Daikaijuu Monogatari II
- - - - -
SuperFX
- - - - -
* Dirt Racer
* Dirt Trax FX
* Doom
* Star Fox (USA / Japan) / Starwing (Europe)
* Stunt Race FX (USA / Europe) / Wild Trax (Japan)
* Super Mario World 2: Yoshi's Island
* Vortex
* Winter Gold
** ZSNES does not support interleaved SuperFX ROMs! **
An interleaved ROM is one in which the data is arranged differently than in
the original, real SNES cartridge. While ZSNES has the ability to read the
most common types of interleaved ROMs, it cannot read interleaved SuperFX
ROMs, or even determine that they are interleaved.
You can use NSRT [http://nsrt.edgeemu.com] to deinterleave your SuperFX ROMs,
or if you prefer, all your ROMs. Consequently, the creator of NSRT (Nach) has
also written a document about the technical details of interleaved SNES ROMs,
if you are interested.
"The Grand Document on the many SNES Interleave Algorithms":
[http://nsrt.edgeemu.com/forum/kb.php?mode=article&k=2]
............................................................
4. Special Cartridges
............................................................
The approximate percentage of emulation progress for these special cartridges is
listed under Current Progress [Readme.txt].
- - - - - - - - - - - - - - -
Same Game; SD Gundam G-Next
- - - - - - - - - - - - - - -
These were special games released only in Japan. They could be played by
themselves, standing alone, but they could also be played with special
additional cartridges, which plugged into the top of the main cartridge.
These extra cartridges used the same form-factor as the BS-X memory
cartridges, and they would improve or change the main game in some small way
(similar to the Sonic and Knuckles cartridge for Sega Genesis).
You can play the original cartridges by themselves by loading them like any
normal ROM. In order to play these games as if they had an expansion cartridge
plugged in, you must first configure the paths to the base cartridge ROMs
under Config -> Paths. After defining the path to the base ROMs, you can now
load the expansion ROM like any normal ROM. ZSNES will virtually "plug in" the
expansion ROM to the base ROM, and load both of them at the same time.
The NSRT file names for these ROMs are "SAMEGAME.SFC" and "G-NEXT.SFC",
respectively.
- - - - - - - -
Sufami Turbo
- - - - - - - -
Gamers Graveyard has some pictures and information on the Sufami Turbo.
[http://www.gamersgraveyard.com/repository/snes/peripherals/sufamiturbo.html]
The Sufami Turbo is a special add-on, manufactured by Bandai, and released
only in Japan. The games were sold on small, GameBoy-sized mini-cartridges,
two of which could simultaneously be plugged into the Sufami Turbo main
cartridge. Certain combinations of games could interact with each other.
To emulate the Sufami Turbo, you will first need the Sufami Turbo BIOS.
You must configure the path to this BIOS under Config-->Paths.
The NSRT file name for the Sufami Turbo BIOS is "STBIOS.BIN".
If you use NSRT, your Sufami Turbo ROMs will have .st extensions. In order to
load two ROMs at once (to emulate two simultaneously loaded cartridges), you
must use the command line. As an example, you would type in:
zsnesw.exe "C:\Path\To\ROMs\sufami turbo rom 1.st"
"C:\Path\To\ROMs\sufami turbo rom 2.st"
Note that you must type the FULL path to both ROM images. The example is
specific to the Windows command line and ZSNES port, but you get the idea.
You may occasionally come across a Sufami Turbo ROM that is hacked to include
the BIOS with it. Use NSRT with the -split command to separate the BIOS from
the ROM. This will give you at least two separate files: one will be the game,
and the other will be the BIOS. You may even get 3 files: Two games and one
BIOS. After you have separated the BIOS and the game(s), simply follow the
directions stated above.
- - - - - - - - - - - - - - - -
Broadcast Satellaview (BS-X)
- - - - - - - - - - - - - - - -
Please read the Satellaview article on Wikipedia for additional information.
[http://en.wikipedia.org/wiki/Satellaview]
This add-on was released only in Japan. It allowed gamers to connect to a
satellite feed at certain times of the day, which would transmit games to the
Super Famicom. Downloaded games were optionally stored on a small,
eight-megabit mini-cartridge, which plugged into the top of the BS-X main
cartridge (which in turn plugged directly into the Super Famicom). Many games,
some of which had time limits, were made exclusively for the BS Satellaview.
Currently, ZSNES can partially emulate the BS-X; some games will have graphics
glitches, some games can be coaxed into running by changing certain settings,
but some games won't run at all.
Also note that there is a BIOS for the BS-X. You may configure the path to the
BS-X BIOS under Config -> Paths; however, it's not currently required to run
BS games. It may be required in the future.
The NSRT file name for the BS-X BIOS is "BS Satellaview BS-X (BIOS) (J).sfc".
- - - - - - - -
Super GameBoy
- - - - - - - -
** The Super GameBoy is not emulated. There are currently no plans to support
it. ** This is because the Super GameBoy cartridge contains a complete set of
GameBoy hardware (without screen and speakers, of course). Thus, to fully
support the Super GameBoy, ZSNES would have to emulate both the SNES and a
GameBoy. In addition, there are some very complex interactions between the
Super GameBoy and SNES hardware that are not yet fully understood.
"But wait," you say, "I have a Super GameBoy BIOS! Won't this allow ZSNES to
emulate a Super GameBoy?"
The answer is "no." The BIOS you have is only the software for the Super
GameBoy, not the hardware, and thus is no help in emulating the Super GameBoy
hardware. In the meantime, there are some GameBoy emulators, such as KiGB
[http://kigb.emuunlim.com], BGB [http://bgb.bircd.org], and VisualBoyAdvance
[http://vba.ngemu.com], that faithfully support some of the more useful
features of the Super GameBoy.
............................................................
5. Individual Game Issues
............................................................
- - - - - - - - - - - - - - - -
Chrono Trigger
- - - - - - - - - - - - - - - -
How do you get past the part in Chrono Trigger where you have to press the
L, R, and A buttons?
Assign two or all three of these SNES controller buttons to the same keyboard
key. You can do this under Config Menu -> Input. Please read the note about
keyboard limitations in the Input section [GUI.txt].
- - - - - - - - - - - - - - - -
Star Ocean
- - - - - - - - - - - - - - - -
This game is difficult to emulate correctly, and there are also bugs within
the game itself. The battles in the game are emulated at an incorrect speed,
and the game will often freeze or crash randomly. You may encounter more
issues. You can find detailed information about the bugs in this game at
RPGClassics [http://www.rpgclassics.com/shrines/snes/so1/bugs.shtml].
For best results, we recommend that you use an emulator that runs the game
more accurately, such as Snes9x [http://www.snes9x.com].
............................................................
6. Games Supported by ManyMouse
............................................................
ZSNES supports Ryan C. Gordon's ManyMouse library, which allows you to take
advantage of games that support usage of two SNES add-on devices at once.
[http://icculus.org/manymouse/]
You will need two mice plugged into your computer.
Here is a list of known games that support two SNES add-on devices
simultaneously:
- Arkanoid - Doh It Again
- Bishoujo Senshi Sailor Moon S - Kondo ha Puzzle de Oshiokiyo!
- Fun 'N Games
- Koutetsu no Kishi (and its two sequels)
- Lamborghini - American Challenge
- Lord Monarch
- Motoko-chan no Wonder Kitchen
- Operation Thunderbolt
- Revolution X
- Shien's Revenge
- Super Castles
- T2 - The Arcade Game
- Tin Star
- Tokimeki Memorial
Linux users should remember to type
chmod a+r /dev/input/*
at the shell after both mice are plugged in.
This feature is not implemented in the DOS port.
ManyMouse currently does not support BSD either, so Windows, Linux, or
Mac OS X is required.
............................................................
7. List of Multiplayer Games
............................................................
Please note that this list does not include any sports games (since they are
easy to recognize and most of them are multiplayer). It also does not include
games with only 2-player alternating modes nor games that require the SNES
Mouse/Super Scope. Also, this list does not generally have sequels or other
derivatives listed; if the original is listed here, it's likely its sequels
and derivatives support multiplayer, too.
This list is not necessarily complete.
Aero Fighters
Art of Fighting
Battletoads in Battlemaniacs
Battletoads vs DoubleDragon
Brawl Brothers
Brutal: Paws of Fury
Captain Commando
Clay Fighter
Contra 3
Darius Twin
Double Dragon 5
Dragonball Z Super Butoden
Dragonball Z Hyper Dimension
Faceball
Fatal Fury
Fighter's History
Final Fight 2 & 3
Ghoul Patrol
Goemon
Goof Troop
Gundam Wing: Endless Duel
Joe & Mac
Jurassic Park 2 - The Chaos Continues
Killer Instinct
King of Dragons
King of the Monsters
Kirby's Avalanche
Kirby's Dreamland 3
Kirby Super Star
Legend of the Mystical Ninja
Lemmings
Megaman 7 (Secret Code - password 1415/5585/7823/6251 and press L+R+Start)
Metal Warriors
Mortal Kombat
Ms. Pac-Man
NP Mario Picross Series
Peace Keapers
Pirates of the Dark Water
Pocky & Rocky
Pop'n Twinbee
Power Instinct
Primal Rage
Puzzle Bobble
Raiden
Rampart
Ranma 1/2
Rise of the Robots
Rival Turf
Rock N' Roll Racing
Run Saber
Sailor Moon
Samurai Shodown
Secret of Mana
Seiken Densetsu 3
Shaq Fu
Star Fox 2
Star Trek Starfleet Academy
Street Fighter 2
Street Fighter 2 Turbo
Street Fighter Alpha 2
Street Racer
Stunt Race FX
Sunset Riders
Super Bomberman
Super Mario All-Stars (SMB3 minigame)
Super Mario Kart
Super Mario World 2: Yoshi's Island (At map, press X,X,Y,B,A)
Super Offroad
Super Smash TV
Super Street Fighter 2
Suzuka 8 Hours
Teenage Mutant Ninja Turtles 4 - Turtles in Time
Teenage Mutant Ninja Turtles 5 - Tournament Fighters
Tetris
The Great Circus Mystery
Top Gear 2
Top Gear 3000
Tuff E Nuff
Ultimate Mortal Kombat 3
Uniracers
Wild Guns
World Heroes
Wrecking Crew '98
Zombies Ate My Neighbors
. . . . . . . . . . . . . . . .
This documentation is best viewed in a fixed-width font such as "Courier New".
Copyright (C) ZSNES Team & ZSNES Documentation Team [License.txt]

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,122 @@
ZSNES v1.51 Documentation
================================
N a v i g a t i o n
================================
* Index [Index.txt]
* Readme [Readme.txt]
* GUI [GUI.txt]
* Netplay [Netplay.txt]
* Advanced Usage [Advanced.txt]
* Games [Games.txt]
* FAQ [FAQ.txt]
- - - - - - - - - - - - - - - - - -
* Getting Support [Support.txt]
* History [History.txt]
* About [About.txt]
* License [License.txt]
- - - - - - - - - - - - - - - - - -
* NSRT Guide: [http://zsnes-docs.sf.net/nsrt]
* ZSNES Home Page: [ZSNES.com]
================================================================================
~ I n d e x
================================================================================
* Index [Index.txt]
* Readme [Readme.txt]
1. Disclaimer
2. Current Progress
3. Extra Features
4. System Requirements
5. Installation
6. Basic Usage
7. Default Keys
8. Save States
9. Movies
10. IPS Patching
11. Cheat Codes
12. Files
* GUI [GUI.txt]
1. Game Menu
2. Quick Menu
3. Config Menu
4. Cheat Menu
5. Netplay Menu
6. Misc Menu
7. F1 Menu
8. Save Slot Chooser
* Netplay [Netplay.txt]
1. Things To Know
2. Recommendations
3. Simple Instructions
4. Loading a Game
5. Configuring
6. Troubleshooting
7. Links and Utilities
* Advanced Usage [Advanced.txt]
1. Movie Dumping
2. Configuration Files
3. Debugger
4. KitchenSync
5. Command-Line
* Games [Games.txt]
1. ROMs
2. Compatibility
3. Special-Chip Games
4. Special Cartridges
- BS-X (Satellaview)
- Super Gameboy
5. Individual Game Issues
6. Games Supported by ManyMouse
7. Multiplayer List
* FAQ [FAQ.txt]
1. Universal
2. Win Port
3. SDL Port
4. DOS Port
- - - - - - - - - - - - - - - - - -
* Getting Support [Support.txt]
1. APIs and Utilities
2. Contact Information
3. Known Issues
4. Filing a Bug Report
* History [History.txt]
* About [About.txt]
1. ZSNES
2. Documentation
3. Credits
* License [License.txt]
. . . . . . . . . . . . . . . .
This documentation is best viewed in a fixed-width font such as "Courier New".
Copyright (C) ZSNES Team & ZSNES Documentation Team [License.txt]

View File

@@ -0,0 +1,341 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.

View File

@@ -0,0 +1,230 @@
ZSNES v1.51 Documentation
================================
N a v i g a t i o n
================================
* Index [Index.txt]
* Readme [Readme.txt]
* GUI [GUI.txt]
* Netplay [Netplay.txt]
1. Things To Know
2. Recommendations
3. Simple Instructions
4. Loading a Game
5. Configuring
6. Troubleshooting
7. Links and Utilities
* Advanced Usage [Advanced.txt]
* Games [Games.txt]
* FAQ [FAQ.txt]
- - - - - - - - - - - - - - - - - -
* Getting Support [Support.txt]
* History [History.txt]
* About [About.txt]
* License [License.txt]
- - - - - - - - - - - - - - - - - -
* NSRT Guide: [http://zsnes-docs.sf.net/nsrt]
* ZSNES Home Page: [ZSNES.com]
================================================================================
~ N e t p l a y
================================================================================
Netplay has been disabled for the indefinite future, until the core becomes more
accurate and/or non-random. We recommend using ZSNES v1.36 or v1.42n
[http://nsrt.edgeemu.com/forum/viewtopic.php?t=448] until this is resolved.
The Netplay dialog is only accessible if a game is loaded.
............................................................
1. Things To Know
............................................................
- ZSNES currently limits Netplay to two computers. Up to five players can
still play, however (by having more than one player at either of the two
computers).
- A game must be on each computer in order to have it available for Netplay.
- You cannot use cheat codes, key combinations, or turbo keys in Netplay.
............................................................
2. System Recommendations for Smooth Netplay
............................................................
- Both users must use the *same version* of ZSNES (e.g. Both users should be
using v1.36).
- Both users should be using reasonably fast computers (about 800mhz). If
one user has a slow computer (e.g. 200mhz) while the other has a fast one,
the slow computer's low framerate will bog down the fast computer, causing
poor framerates on the fast computer.
- Both users should be using the same setting for sound (either enabled or
disabled; see the Config-->Sound menu in the GUI or the ZSNES
configuration file).
- Back Buffer must be enabled and the latency value must be 3 or 2 (reduce
it to 2 for fast-paced platform games).
- The games have to run at least 50 FPS on BOTH computers without Netplay.
This can completely depend on factors such as CPU, video card, video mode,
and the game you are running. (See System Requirements [Readme.txt]).
- Both users must use the same protocol setting (either UDP or TCP). If both
players are on the same LAN, you should use UDP (it has lower overhead).
Otherwise, use TCP (no packet loss).
- You will also need an Internet connection with ping times of less than
400ms between both connections. The higher than ping time, the worse the
Netplay experience, since ping times measure the time it takes for data to
get to the other side and back. You can expect a not-so-great performance
if you have a ping time of 400 or greater.
............................................................
3. Simple Instructions
............................................................
1. Go to Netplay -> Internet.
2. Decide who will be the server and who will be the client.
(Neither has the gameplay advantage since ZSNES treats both the same
after a connection is established).
3. If you are the server, send the IP that is shown on the connection window
to your friend (e.g. through any chat program (ICQ, AIM, IRC, etc.)).
Then click on 'Start Server'.
4. If you are the client, type in the IP address that your friend has given
you and then click on 'Connect to Server'.
5. Chat with your friend on what game to play.
6. Once decided, make sure that the filename on both sides are the same and
that the load window points to the directory where the filename is.
7. Load the game.
8. Have fun! (If it worked)
9. If it said 'Checksum Mismatch', try uncompressing the file if it is
compressed. If not, then both sides have a different version of that ROM
(e.g. One side has the Japanese version while the other has the English,
or both versions are English, but are different version releases of the
same game).
10. If you want to chat in-game, press 'T' and type in your line. You can
change this key in the Misc -> Misc Keys options from the GUI.
............................................................
4. Loading a Game
............................................................
Once successfully connected, the chat window should open up.
From there, you can load a game as you normally would. But in order to load a
game, both sides must have their load window pointing to the directory where
the game is located and also have identical filenames for the game. Only one
side has to load the game; after that, the other side will automatically load
the game without the user's interaction.
If an error pops up saying 'ROM data mismatch', then it means that either side
has a different version of the ROM. This sometimes happens with compressed files
even when both files are the same, so it is recommended that you uncompress the
games and try again if this error occurs.
............................................................
5. Configuring Options
............................................................
The default settings are recommended.
However, if your computer is slower than 266 MHz, then it is recommended that
both sides play with back buffer disabled. Note that disabling this will degrade
controller response.
You can increase the latency value if the average ping time between both
connections is high (you can tell if the gameplay runs too jerky).
Reducing the latency value when back buffer is enabled will improve controller
response time. However, this will cause the remote player to jump around more
in order to keep both sides in sync.
For controller options (PL1, PL2, PL3,..), the first checkmarked player would be
using Input #1 of the local side. The second checkmarked player would be using
Input #2 and so on. Players marked with an 'X' are checkmarked on the remote
side.
............................................................
6. Troubleshooting
............................................................
- If you are the client, and it failed to connect, check to make sure that
the IP you entered is correct and that you are properly connected to the
Internet.
- If you are the server, and the IP provided in the connection window
doesn't seem to be the correct one, you can visit
[http://www.whatismyipaddress.com] to determine the correct one. Then tell
your client what it is so he or she can connect. Alternatively, if you're
using mIRC, just type /dns <nick>.
- If the client says 'Found Client' and nothing else happens, chances are
that your net connection does not support UDP. If this is the case, both
sides will need to deselect 'Use UDP Instead of TCP'. However, it is
strongly recommended that you use UDP if possible since it is much faster
than TCP.
- If you have Windows 95 and you are getting a init failed error, you should
download and install the Winsock 2.0 update for Windows 95:
[http://www.microsoft.com/Windows95/downloads/contents/WUAdminTools
/S_WUNetworkingTools/W95Sockets2/Default.asp].
Warning: Do not install this if you do not have Windows 95.
- You may need to disable your firewall (or just disable it for UDP port
7845) in order to get the UDP protocol that ZSNES's Netplay uses to work.
- Internet Connection Sharing users (Win9x systems) may need to download an
ICS Configuration utility to get the connection to work and map UDP port
7845. You can use "ICS Configuration", found here:
[http://www.practicallynetworked.com/sharing/ics/icsconfiguration.htm].
- If you need help forwarding your router port, you may refer to AntoineWG's
Router Port Forwarding Guide. You should be able to find this guide at the
ZSNES board [http://board.zsnes.com].
- Tips for reducing general slowdown can be found under "Why is ZSNES slow?"
in the Speed section of the FAQ page [FAQ.txt].
............................................................
7. Links and Utilities
............................................................
The following websites provide a way to find and connect to other players in
order to use Netplay. Some of the sites provide a program, while one provides an
IRC script.
Please note that these websites are in no way officially affiliated with ZSNES.
We make no warranty as to their usefulness or safety. If you have problems with
these utilities, please seek help from their respective web sites, NOT from the
ZSNES web site.
ZSNES Online [http://www.zsnesonline.com] - This is an excellent program with
several features, including a centralized chat server, that allows you to
setup a Netplay session easily.
zbattle.net [http://www.zbattle.net] - A service that allows ZSNES users to
easily find others who want to take advantage of the emulator's built-in
Netplay support. zbattle.net currently runs on Windows 9x/ME/NT/2k/XP and
Linux.
Z-Net [http://www.z-net.tk] - This is an active IRC channel with a custom script
for ZSNES Netplay.
zConnector [http://420666.net/z/] - A utility with a nice GUI that allows you to
find players and play SNES games using ZSNES Netplay.
. . . . . . . . . . . . . . . .
This documentation is best viewed in a fixed-width font such as "Courier New".
Copyright (C) ZSNES Team & ZSNES Documentation Team [License.txt]

View File

@@ -0,0 +1,976 @@
ZSNES v1.51 Documentation
================================
N a v i g a t i o n
================================
* Index [Index.txt]
* Readme [Readme.txt]
1. Disclaimer
2. Current Progress
3. Extra Features
4. System Requirements
5. Installation
6. Basic Usage
7. Default Keys
8. Save States
9. Movies
10. IPS Patching
11. Cheat Codes
12. Files
* GUI [GUI.txt]
* Netplay [Netplay.txt]
* Advanced Usage [Advanced.txt]
* Games [Games.txt]
* FAQ [FAQ.txt]
- - - - - - - - - - - - - - - - - -
* Getting Support [Support.txt]
* History [History.txt]
* About [About.txt]
* License [License.txt]
- - - - - - - - - - - - - - - - - -
* NSRT Guide: [http://zsnes-docs.sf.net/nsrt]
* ZSNES Home Page: [ZSNES.com]
================================================================================
~ R e a d m e
================================================================================
ZSNES is an open-source Super Nintendo Entertainment System emulator written in
x86 assembly, C, and C++. Bleeding with cutting edge SNES emulation, ZSNES is
easily comparable to other leading SNES emulators, such as Snes9x
[http://www.snes9x.com], SNEeSe [http://sneese.sourceforge.net], Super Sleuth
[http://users.tpg.com.au/advlink/spx/], and bsnes [http://byuu.org].
Special thanks to the Snes9x team for all of their help and also for the
excellent SNES emulator they have developed. We wish them the very best of luck!
............................................................
1. Disclaimer
............................................................
The ZSNES Development Team, including all developers and contributors, is in no
way responsible for any damage caused by the use of this software. Please read
the license [License.txt] for more details.
Due to legal issues, the ZSNES Development Team can provide you neither with
ROMs nor links to them. In addition, ZSNES may not be distributed with ROM
images. However, as with many cases like this, Google [http://www.google.com]
is your friend.
There are still many bugs left in ZSNES, so don't expect it to run all your
favorite games. If ZSNES doesn't work for you, then don't use it. Use Snes9x,
SNEeSe, Super Sleuth, or bsnes instead! In fact, even if you use ZSNES, use
those emulators too!
............................................................
2. Current Progress
............................................................
- - - - - - - - - - - - - - - - -
The following are implemented:
- - - - - - - - - - - - - - - - -
- Complete 65816 instruction set
- SRAM support
- LoROM and HiROM support
- SlowROM and FastROM support
- Full DMA support
- HIRQ/VIRQ/NMI Interrupts
- Support for several SNES file formats (SMC, SFC, SWC, FIG, MGD, MGH, UFO,
BIN, GD3, GD7, DX2, USA, EUR, JAP, AUS, ST, BS, 048, 058, 078,), including
split files (1, 2, 3; A, B, C)
- Interleaved format support (except SuperFX games)
- PAL/NTSC timing support
- - - - - - - - - - - - -
Graphics engines (PPUs)
- - - - - - - - - - - - -
The following are implemented in both graphics engines, all color modes:
- Graphic modes 0,1,2,3,4,5,6,7
- 8x8, 16x16, 32x32, and 64x64 sprite support (flipped in all directions)
- 8x8 and 16x16 tiles
- 32x32,64x32,32x64,64x64 tile modes
- Full HDMA effects for wavy backgrounds, interesting mode 7 effects, etc.
- Mode 7 rotating and scaling effects
- BG priorities
- Sprite priorities
- Add/sub of back area
- Mosaic effects
About the old graphics engine:
- Line engine
- Missing lots of windowing and DMA effects
- More accurate at drawing some things
- 13-bit color rendering. (This is a compromise between color accuracy and
speed. Not all transparencies will work correctly with this engine.)
What's available in the old graphics engine when using an 8-bit color video
mode:
- Offset per tile mode (mode 2/vertical only)
- High-res 512 horizontal resolution (missing in 16x16)
- Single and dual windowing routines
What's available in the old graphics engine when using a 16-bit color video
mode:
- Palette changing in the middle of a screen
- Screen addition (full and half)
- Screen subtraction (full)
- Fixed color addition/subtraction
- Window clipping for fixed color
About the new graphics engine:
- Tile engine
- Nearly complete engine with a few bugs
- Can draw mostly everything on the SNES
- 15-bit coloring
What's available in the new graphics engine when using an 8-bit color video
mode:
- Offset per tile mode (mode 2/vertical only, mode 4)
- High res 512 resolution and 448/478 vertical resolution
- Windowing effects
- High resolution mode 7 (only in 640x480x256 video mode; active when all
other video filters are disabled)
What's available in the new graphics engine when using a 16-bit color video
mode:
- All of old graphics engine 16-bit
- High resolution mode 7
- High resolution 16x16 tiles for mode 5
- Full 15-bit color transparencies for improved picture quality (MMX
compatible CPUs only)
- - - - - - - - - - - - - - - - - - -
The following are present in sound:
- - - - - - - - - - - - - - - - - - -
- 16-bit digital stereo sound
- SPC700 Sound CPU
- DSP Sound Processor
- Echo effects
- FIR filter
- ADSR volume effects
- GAIN volume effects
- Noise effects
- Pitch modulation
- - - - - - - - - - - - - - - - - - - - - - - - - -
The following special input devices are emulated:
- - - - - - - - - - - - - - - - - - - - - - - - - -
- MultiTap (5-player support)
- Super NES Mouse (missing some features, such as speed settings)
- Super NES Super Scope
- Konami Lethal Enforcer Gun
- Automatic configuration via NSRT headers
(See APIs and Utilities section [Readme.txt])
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
The following special cartridge processors are emulated, in whole or in part:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| Special Chip | Progress |
----------------|-----------
C4 | 100%
Nintendo DSP-1 | 100%
Nintendo DSP-2 | 100%
Nintendo DSP-3 | 80%
Nintendo DSP-4 | 95%
OBC-1 | 100%
SA-1 | 90%
S-DD1 | 100%
Seta DSP 10 | 99%
Seta DSP 11 | 80%
SPC7110 | 100% except decompression
S-RTC | 95%
SuperFX | 90%
- - - - - - - - - - - - - - - - - - - - - - -
The following add-on devices are emulated:
- - - - - - - - - - - - - - - - - - - - - - -
| Special Cartridge / Add-On | Progress |
------------------------------|-----------
Broadcast Satellaview (BS-X) | 50%
Nintendo Super System | 100% except the menus
Same Game, SD Gundam G-Next | 100%
Sufami Turbo | 95%
- - - - - - - - - - - - - - - - - - -
The following features are missing:
- - - - - - - - - - - - - - - - - - -
- Pseudo 512 SNES horizontal resolution (no games are known to use this)
- Some modes in offset per tile mode
- Some direct color modes (no games are known to use this)
- Seta RISC chip
- True SPC7110 decompression
- Super GameBoy emulation
- - - - - - - - - - - - - - - - - - - - - -
What will not run (or not play properly):
- - - - - - - - - - - - - - - - - - - - - -
Please read our statement on game compatibility [Games.txt].
- Some SuperFX games (regardless of interleave status)
- Interleaved SuperFX games (deinterleave them with NSRT
[http://nsrt.edgeemu.com])
- Some Broadcast Satellaview (BS-X) games
- Games with unknown co-processors
- Games that don't have a valid header
- Games that hit a severe bug in the 65816/PPU/SPC700/DSP routines
- Games that require special timing
............................................................
3. Extra Features
............................................................
- Support for save states, including rewinding
- Extensive movie recording and dumping features
- Many emulation speed options, including automatic frame skipping to
compensate for slower machines
- Full cheat code support (including Game Genie, Pro Action Replay, and
GoldFinger)
- Automatic IPS soft-patching (including up to 11 sequential patches)
- Custom-built GUI with many time-saving features
- Support for loading Zip, gZip, and JMA-compressed ROMs
- Randomized ROM loading
- Support for input from keyboards, joysticks, and gamepads,
as well as a key combination editor
- Many video output options, including graphics-enhancing filters
- Highly configurable sound output options
- Netplay (currently disabled)
- User-editable configuration files
- Debugger
- Accepts command-line arguments
............................................................
4. System Requirements
............................................................
- - - - - - - - - - - - - - -
Supported operating systems
- - - - - - - - - - - - - - -
Official Ports
- Win port: Microsoft Windows 95/98/ME/2000/XP/2003/Vista
- SDL port: Linux, BSD, Mac OS X, or Xbox running Linux
- DOS port: Microsoft DOS (may work on other non-MS DOSes)
Un-Official Ports
- ZsnexBox: Microsoft Xbox (native)
ZSNES Board thread about the Xbox port:
[http://board.zsnes.com/phpBB2/viewtopic.php?t=6933]
- - - - - - - - - -
CPU requirements
- - - - - - - - - -
ZSNES absolutely requires a 100% x86-compatible processor. You probably
already meet this requirement. Most consumer-grade processors sold by Intel
and AMD use the x86 instruction set.
Because much of ZSNES' source code is written in x86 assembly, it will only
run on processors that are 100% x86 compatible. "Ports" to other architectures
are impossible; we recommend Snes9x [http://www.snes9x.com] as the SNES
emulator of choice for portability.
Playing a special chip game will significantly increase CPU usage. For these
games, you may require a processor faster than those listed below.
- - - - - - - - - - - - -
Free space requirements
- - - - - - - - - - - - -
The program files alone require about 1MB. The amount of disk space required
for other files varies greatly. For example, uncompressed ROMs (not included!)
require 256KB-6144KB each. Save states typically require about 270KB each;
however, this can increase up to an additional 200KB for special chip games.
- - - - - -
Win Port
- - - - - -
OS: Windows 95/98/ME
- CPU: Pentium II (or equivalent) 233MHz (500MHz recommended)
- RAM: 32MB (64MB recommended)
OS: Windows 2000/XP/2003/Vista
- CPU: Pentium II (or equivalent) 266MHz (500MHz recommended)
- RAM: 64MB of RAM (128MB recommended)
API: DirectX v8.0a or later must be installed
Video: any video card that supports DirectDraw (acceleration recommended)
Sound: any sound card that supports DirectSound (acceleration recommended)
System Requirements for Microsoft Windows Operating Systems:
[http://support.microsoft.com/kb/304297/]
System Requirements for Windows XP Operating Systems:
[http://support.microsoft.com/kb/314865/]
- - - - - -
SDL Port
- - - - - -
OS: Linux, BSD, or Mac OS X
CPU: 266MHz (500MHz recommended, especially if using X)
RAM: 32MB (64MB recommended; more if SDL is compiled to use X)
API: SDL v1.20 or later
Video: almost any video card will work (hardware OpenGL support and
acceleration highly recommended)
Sound: any sound card supported by SDL (using ALSA or OSS)
- - - - - -
DOS Port
- - - - - -
OS: Microsoft DOS (some non-MS DOSes may work)
CPU: Pentium II (or equivalent) 233MHz
RAM: 32MB (minimum of 17MB free, required for loading 48mbit ROMs)
Video: VGA card
- For 16-bit color and therefore proper support of transparencies, an SVGA
card with VESA 2 and Linear Frame Buffer support is required.
- You may be able to use Scitech Display Doctor to enable VESA 2 support on
some cards that don't already support it.
Sound: Sound Blaster Pro or 100% compatible (SB16 or 100% compatible
recommended)
These system requirements assume you are running the DOS port under pure DOS.
If you are using the DOS port from within Windows, the CPU and RAM
requirements will be the same as for the Win port.
............................................................
5. Installation
............................................................
- - - - - - - - - -
Win / DOS Ports
- - - - - - - - - -
Installation:
1. Download the latest version of ZSNES from [ZSNES.com].
The file you download is an archive containing the ZSNES binary file and
documentation.
2. Extract the contents of the archive into a new folder on your hard drive.
Do not simply overwrite an older version of ZSNES.
3. You can now run ZSNES by executing the ZSNES binary, named zsnesw.exe
(Windows) or zsnes.exe (DOS). ZSNES is not packaged with an installer, so
there will be no entry in the Windows Start Menu.
Note: In Windows, you can create a shortcut to ZSNES to make it easier to open
the program. Right-click on the zsnesw.exe icon to bring up the context menu,
and left-click "Create Shortcut". A shortcut to the executable file will
appear in the folder. You can now move the newly-created shortcut to your
Desktop or Start Menu. Opening the shortcut will run ZSNES from its original
location.
Re-Installation / Reset to default settings:
If you find that you are experiencing a number of unexplained errors in ZSNES,
or if you wish to reset all settings back to their defaults, simply delete the
configuration files that were generated by ZSNES the first time you ran the
program. See the Configuration Files section [Advanced.txt] for details.
Un-Installation:
If you wish to uninstall ZSNES, simply delete the entire folder (and thus, all
files contained within) into which you installed ZSNES (as described in Step 2
of Installation, above).
-or-
If you have since put additional files (such as ROMs) into your ZSNES install
folder, and do not wish to delete or move them, you will have to delete the
individual ZSNES files. Please refer to the Files section [Readme.txt] for
information on individual files and file types related to ZSNES. You will also
need to delete the docs folder.
Note: ZSNES does not use the Windows registry*, nor does it generate "hidden"
configuration files all over your system.
*Description of the Windows registry: [http://support.microsoft.com/kb/256986]
- - - - - - - - - - - - - - - - - -
SDL Port / Compiling from source
- - - - - - - - - - - - - - - - - -
* Download the latest source release of ZSNES from [ZSNES.com].
* After unpacking, navigate to the src directory and run the following
commands:
./configure --enable-release
make
And as root:
make install
* Other, more detailed instructions are provided in the docs/install.txt
file.
Un-Installation:
If you wish to uninstall ZSNES, you can run "make uninstall" as root if you
still have your Makefile.
Otherwise, you will need to navigate to /usr/local/bin and delete zsnes. Then
navigate to /usr/local/man/man1 and delete zsnes.1. Or just delete the man1
directory if you have nothing else in it.
You will need root access to perform the above actions.
You will also need to delete "~/.zsnes" or "~/Library/Application Support/ZSNES"
in Mac OS X. Do note that various files are saved in here by default (such as
game saves); be sure to back them up if you want to keep them.
............................................................
6. Basic Usage
............................................................
1. Install ZSNES (see above).
2. Run ZSNES.
* If you're using Windows, double-click on the executable file.
* If you're using DOS, navigate to the ZSNES installation folder and type
zsnes.exe at the command line.
3. Configure the input settings (Config Menu -> Input) as desired, or use the
default settings.
4. Configure the video settings (Config Menu -> Video) as desired, or use the
default settings.
5. Configure path settings (Config Menu -> Paths) if you don't want all the
automatically generated files going into the same directories as your ROMs.
6. Load a game (Game Menu -> Load) and start playing.
7. When you are ready to stop playing, you have a number of choices to save
your game.
* If your game has its own native save function, just use it.
* If your game does not have a save function, or you are at a point in
the game where you can't save, you can create a save state. Do this by
pressing F2.
8. After you save your game:
* You can load a new game using the same steps as above, or
* Exit the emulator by going to Game Menu -> Quit.
9. When you are ready to return to a previously saved game, just re-load that
game.
* Load an in-game save in the normal way.
* If you saved a state, you can load that state by pressing F4.
This section only covers very basic usage. Please read the entire documentation
for more information.
............................................................
7. Default Keys
............................................................
- - - - - - - - - - - - - - - -
. . . . Game . . Keys . . . .
- - - - - - - - - - - - - - - -
You can change the default keys for the standard SNES controller under
Config->Input [GUI.txt].
|SNES Button| |Player 1 Key| |Player 2 Key|
- - - - - - - - - - - - - - - - - - - - - - - - -
D-Pad Up Arrow Up J
D-Pad Down Arrow Down M
D-Pad Left Arrow Left N
D-Pad Right Arrow Right ,
Start Return/Enter Left Ctrl
Select Right Shift Left Alt
A X Home
B Z End
X S Insert
Y A Delete
L (Left Shoulder) D Page Up
R (Right Shoulder) C Page Down
You can change the default keys for special input devices under
Config->Devices. [GUI.txt].
The special input devices just use input from your mouse for movement and
aiming.
|Super Scope Button | Computer/Mouse Button|
- - - - - - - - - - -|- - - - - - - - - - - -
Fire | Left mouse button
Cursor Mode Button | Right mouse button
Toggle Auto-fire | =
Pause | Backspace
- - - - - - - - - - - - - - - - -
. . . Emulator . . Keys . . . .
- - - - - - - - - - - - - - - - -
[Where to Customize]
|Key| |Function|
= = = = = = = = = =
[Cannot be changed]
Esc When a game is loaded, toggle the GUI
(pauses emulation while GUI visible).
F1 Open the F1 Quick Menu.
- - - - - - - - - -
[Config->Saves]
F2 Save a state to current slot.
F3 Open the save state slot chooser.
F4 Load a save state from the current slot.
- - - - - - - - - -
[Misc->Misc Keys]
F5 <--> F12 Toggle sound channels 1 through 8, respectively
1, 2, 3, 4 Toggle background layers 1, 2, 3, and 4, respectively
5 Toggle sprite/object layer
6 Panic Key: Reset all switches to default (enable Offset Mode,
Windowing, all background layers, sprite/object layer, and sound
channels; disable Add-on Devices; reset Emulation Speed Throttle)
8 Toggle New Graphics Engine
9 Toggle Windowing
0 Toggle Offset Mode
T While using Netplay, press to open the Chat window
- - - - - - - - - -
[Config->Speed]
~ Fast Forward
P Pause Emulation
Note: Besides these default keys, there are many other keys that you can
configure in the GUI.
............................................................
8. Save States
............................................................
** Warning: If you care about your progress in a game, remember to use
in-game saves regularly! Do not rely solely on save states! **
When you "save a state," ZSNES creates a file that contains the values of all
the variables that change while ZSNES is emulating a game. These values are
specific to the exact moment that you saved the state. You can then load a save
state at a later time, thus returning ZSNES to the exact point in the game when
you saved the state originally. This allows you to save your progress at a point
that might not normally be possible with in-game saves, or in games that don't
have in-game saves at all.
Save states are typically not compatible between emulators, and sometimes not
even between different versions of the same emulator, often due to internal core
changes. In fact, it should be noted that save states created prior to v0.600 of
ZSNES will not work in current versions.
To remedy this problem, first load the state in any version of ZSNES from v0.600
to v1.42. Then, immediately after loading, save another state. The new state you
just created should (hopefully) load correctly in ZSNES v1.50 and higher.
Since ZSNES does not support save states created by any other SNES emulator,
you can instead use the emulator-independent SRAM (.srm) data to transfer game
progress from one emulator to another.
Each ZSNES save state is approximately 270KB in size. Special chip games may
require an additional 200KB, however.
- - - - - - - - - - - - -
How to Use Save States
- - - - - - - - - - - - -
You can create and load save states using the GUI [GUI.txt].
It's much easier to just use the default quick keys for these features. Press F2
to save, F4 to load, and F3 to open the save state slot chooser (with graphical
preview). However, if you don't like that method, many other save and load
techniques are available.
Configure general save behavior under Config->Saves. Configure save paths under
Config->Paths.
............................................................
9. Movies
............................................................
Warning: Playing back a previously recorded movie will overwrite any SRAM data
for the current game with the SRAM data contained in the ZMV file. This means
you should enable Do Not Save SRAM [GUI.txt] when playing around with movies!!
Note that these new features will not work with movies recorded in the old ZMV
format (movies made prior to ZSNES v1.50).
For descriptions of the Movie Options dialog, please refer to the GUI page
[GUI.txt].
- - - - - - - -
About Movies
- - - - - - - -
The ZSNES movie format (ZMV) has been completely rewritten and is now better and
more feature-rich than before, with the most capabilities yet implemented in an
emulator. Three of the most notable new features are re-recording, dumping ZMVs
to AVI, and movie subtitles, described below.
A movie file consists of a save state, SRAM data (when applicable), and the
recorded controller data, as well as any chapters (states) that have been
inserted. It also keeps track of a few other things which are negligible with
regard to the overall filesize. Movie files should record at less than
1KB/minute (60KB/hour).
ZSNES should be able to record most actions you can do with a real SNES,
including resetting. During playback, the game will reset just as you did during
recording.
- - - - - - -
Limitations
- - - - - - -
You cannot record games that use the Konami Justifier special input device.
Lethal Enforcers is the only game known to require this device.
You cannot record games while using Netplay.
You should be able to record ZSNES movies for all game types; however, ZMVs are
heavily dependant on save states, so any games that exhibit problems while using
save states will also exhibit problems when recording and playing movies.
For best results, you should play back movies with the same version of ZSNES
that was used to record them. Otherwise, keypresses may become desynchronized
from the emulation playback.
- - - - - - - -
Re-recording
- - - - - - - -
You do not have to do everything perfectly the first time you record a movie.
ZSNES allows you to re-record parts of a movie, inserting the newly recorded
parts seamlessly into the previously recorded parts. You can accomplish this
in a number of ways:
* While playing back a movie, start recording again.
* Use save states while recording movies. Loading the states will allow you to
re-record.
* You can use the rewind key to go back in movies. The rewind key can be
configured under the Config->Saves menu.
- - - - - -
Chapters
- - - - - -
You can insert chapters into your movies, to which you can seek during movie
playback.
You are limited to 65535 (2^16 - 1) chapters created during recording, in
addition to 65535 (2^16 - 1) created during playback.
- - - - - -
Subtitles
- - - - - -
Subtitles allow you to create a short message that will be visible on-screen
during playback of a movie.
1. Create an empty file in your save directory (or wherever your movies are
saved).
2. The subtitle file must be named in the following manner:
- Subtitle file name = ZMV file name = ROM file name.
(Example: smw.sfc (Super Mario World ROM), smw.zmv, smw.sub).
- If you are using movie slot 0, file extension = .sub.
- If you are using movie slot 1 through 9, change the last letter of the
extension to match the movie slot you are using.
(Example: slot 1 = .su1, slot 5 = .su5, slot 9 = .su9).
3. For each subtitle you want in the movie, add a new line to the subtitle
file, with the following information:
- Start Frame:Frame Duration:Message
- For example: "10:100:Beating the Last Boss" without the quotes. In this
example, the message "Beating the Last Boss" will appear in the tenth
frame and stay visible for 100 frames (thus, until the 110th frame).
- ZSNES can display only one subtitle at a time. So make sure that the
start frame for the next subtitle is not during the duration time of
the previous subtitle. You must also list your subtitles sequentially
for all of them to be played (they cannot be out of order).
- ZSNES can display a maximum of 34 characters (of a subtitle message)
across the width of the screen.
4. Now save your new subtitle file. Open ZSNES, play a movie, and you should
see your subtitles appear!
- - - - - - - -
Movie Dumping
- - - - - - - -
See the Movie Dumping section of the Advanced Usage page [Advanced.txt] for more
information.
............................................................
10. IPS Patching
............................................................
IPS ("International Patching System") patches are files that are applied to an
original ROM, which change the programming of the ROM in some way. They are
primarily used to translate ROMs into another language; however, they can be
used for a variety of purposes. Visit [Romhacking.net] for more information
about translations and ROM hacks.
ZSNES has the ability to automatically "soft-patch" a ROM. This means that after
ZSNES loads a ROM into its memory, it will apply the IPS patch to the in-memory
ROM data, *not* the ROM file on your hard disk. This eliminates the need to keep
two copies of a ROM: the original, and the patched.
- - - - - - - - - - - - - - - - - - - -
Applying a single IPS file to a ROM:
- - - - - - - - - - - - - - - - - - - -
1. Make sure Enable Auto-Patch is checked in Config->Options.
2. The IPS file must be either in your Saves directory or in the same
directory as the ROM.
3. The IPS file and the ROM file must have matching filenames. For example,
SD3.sfc and SD3.ips. If your ROM file is compressed, the IPS file must
match the *compressed* filename. For example, if you have the file
SD3.sfc compressed inside the file Seiken Densetsu 3 (J).zip, the IPS
file must be named Seiken Densetsu 3 (J).ips.
4. If you meet the above three conditions, just load your ROM file as
normal, and ZSNES should automatically patch the IPS file to the
in-memory ROM. Remember, your original ROM file will *not* be changed.
5. If you have done everything outlined in the steps above, and your game
does not appear to be working, refer to the related FAQ [FAQ.txt].
- - - - - - - - - - - - - - - - - - - -
Applying multiple IPS files to a ROM:
- - - - - - - - - - - - - - - - - - - -
ZSNES has the ability to apply up to eleven separate IPS files to the same ROM
file. You must give each IPS file a specific extension to tell ZSNES in what
order to apply them. Aside from changing the extension of the IPS files, just
follow the directions above.
| IPS file | Applied |
| extension | When? |
- - - - - - - - - - - - -
ips | First
ip0 | Second
ip1 | Third
ip2 | Fourth
ip3 | Fifth
ip4 | Sixth
ip5 | Seventh
ip6 | Eighth
ip7 | Ninth
ip8 | Tenth
ip9 | Eleventh
ZSNES will *not* apply non-sequentially extensioned IPS files. This means that
if you have three IPS files, named patch.ips, patch.ip0, and patch.ip6, ZSNES
will only apply the first two.
Please remember that the *order* in which you apply the IPS patches may be
important. Applying the patches in the wrong order may result in strange bugs,
or even an unplayable game. Please refer to the documentation that accompanied
your IPS file.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Alternative method of applying IPS files to Compressed ROMs:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
The simplest method of applying an IPS file to a compressed ROM is to simply
place the IPS file in the same archive as the ROM. The filename of the IPS file
does not have to match the compressed or uncompressed filename of the ROM.
Do *not* add more than one IPS file of a given extension to an archive. Results
can be unpredictable as to which of the same-extension IPS files will be applied
to the ROM.
If your ROM is compressed, ZSNES will first look for IPS files inside the
archive. If it finds any, it will only load IPS files from inside the archive,
and will not look anywhere else. Otherwise, ZSNES looks in the Saves directory
and the same directory as the ROM.
............................................................
11. Cheat Codes
............................................................
Currently, ZSNES supports Game Genie, Pro Action Replay, and GoldFinger codes.
- - - - - - - - - - - - -
How to use cheat codes:
- - - - - - - - - - - - -
1. Load the ROM to which you want to apply cheats.
2. Press ESC to toggle the GUI. Open the Add Code dialog from the Cheat
Menu. You can enter up to 255 codes for each game.
3. After adding your codes, press ESC until you are back to your game.
** To use a multi-line cheat code, just enter each line as a separate code! **
- - - - - - - - - - - - -
How to use .cht files:
- - - - - - - - - - - - -
Place the .cht file into the same directory as the ROM, or into your Saves
folder. The .cht file must be named according to the normal naming rules (see
the Files section [Readme.txt] for details).
- - - - - - - - - - - - - - -
Troubleshooting Cheat Codes
- - - - - - - - - - - - - - -
* Try using the Fix button in the Browse Cheats dialog [GUI.txt].
* Some cheat codes are meant to be used with different versions of the same
game. If a cheat code doesn't work and there is one for both Game Genie and
Pro Action Replay, try them both.
* Remember that Game Genie codes require the - (dashes).
* Try resetting the game. Any code for a game that mentions a term similar to
"Start with" means that the game must be reset in order to take effect.
* If you are having a hard time with comparative searches, make sure to delete
the tmpchtsr.___ file in your ZSNES directory.
............................................................
12. Files
............................................................
This section attempts to explain the various files that are created, loaded, or
used by ZSNES.
Most of the data files that are specific to individual ROMs are named in the
following manner:
- The filename of the data file is the same as the filename of the ROM from
which it was created.
- The file extension of the data file changes, depending on the following:
* If there are no "slots" for the data file, then it is just the
normal file extension (srm, bmp, png, raw, cht, cmb, cfg, txt).
* If you are using slot 0, then it is just the normal file extension
(zst, zmv, sub, ips, spc).
* If you are using slots 1-9, then the last letter of the file
extension changes to match the slot number (zs1-zs9).
* If you are using slots 10-99, then the last two letters of the file
extension change to match the slot number (z10-z99).
[Where Created?]
|File Name| |File Extension| |File Type Name|
|Description|
= = = = = = = = = = = = = = = = = = = = = = =
[Wherever you put them.]
Whatever you want, or have them smc, sfc, swc, ... ROM (Game)
automatically named by NSRT.
These are common extensions for ROMs, which are computer files of the game
data on real SNES cartridges. Read the full list of supported ROM file
extensions in the Current Progress section [Readme.txt].
- - - - - - - - - - - - - - - - - - - - - - -
[Saves folder]
romname srm Static RAM
This is the *in-game* save file. It is automatically generated by ZSNES
when you use the in-game save function. Some games use Static RAM as
working RAM rather than to save a game. This format *should* be compatible
among all emulators.
romname zst, zs1-zs9, ZSNES Save State
z10-z99, zss
See the Save States section for more information [Readme.txt].
romname zmv, zm1-zm9 ZSNES Movie
See the Movies section for more information [Readme.txt].
romname mzt, mz1-mz9 ZSNES Movie States
Directories which contain the various save state data for that particular
movie. See the Movies section for more information [Readme.txt].
romname sub, su1-su9 ZSNES Subtitle
See the Subtitles sub-section of the Movies section for more information
[Readme.txt].
romname cht Cheat Data
This file contains cheat codes that you entered using the Cheat Code
Editor [GUI.txt]. These files are generally compatible between different
versions of the same emulator, but not necessarily between different
emulators.
romname cmb Key Combination Data
These files contain key combination data, created when you use the Key
Combination Editor [GUI.txt].
romname inp ZSNES Input
These files contain input configuration for the specific game.
- - - - - - - - - - - - - - - - - - - - - - -
[Saves folder, Same folder as ROM]
romname ips, ip0-ip9 International Patching System
See the IPS Patching section for more information [Readme.txt].
- - - - - - - - - - - - - - - - - - - - - - -
[Snapshots folder]
romname_***** bmp, png Images
/img*****
These are snapshots of the game screen, created by ZSNES when you use the
F1 Menu [GUI.txt]. The file name is appended by a number, up to 99999.
- - - - - - - - - - - - - - - - - - - - - - -
[SPCs folder]
romname spc, sp1-sp9, SPC Sound
s10-s99
These files are created by ZSNES when you dump the SPC data of the game
you are playing by using the F1 Menu [GUI.txt]. Note: In Windows, the .spc
extension is sometimes used for PKCS Certificates.
sounddmp raw Sound Buffer Dump
This is a dump of sound buffer data, created when you use the appropriate
F1 Menu option [GUI.txt].
- - - - - - - - - - - - - - - - - - - - - - -
[ZSNES folder (Win/DOS) / "~/.zsnes" (SDL) /
"~/Library/Application Support/ZSNES" (SDL - Mac OS X)]
zsnes/zsnesw exe (Win/DOS) ZSNES executable
This is the main ZSNES executable binary file. "ZSNES Folder" means the
location of this executable.
zsnes/zsnesw cfg ZSNES Configuration File
/zsnesl
User-editable configuration file where you can set almost any option in
ZSNES [Advanced.txt].
zmovie cfg ZSNES Movie Configuration File
User-editable configuration file where you can change advanced movie
dumping features [Advanced.txt].
zinput cfg ZSNES Input Configuration File
User-editable configuration file where you can change settings for
controllers and extra SNES devices. This is the same as the files with the
.inp extension, but is used globally.
zfont txt ZSNES Font Configuration File
This is where the appearance of text in the ZSNES GUI is configured
[Advanced.txt].
rominfo txt ROM Information
This contains information about the ROM you most recently ran. You can
configure this behavior under Config->Options.
data cmb Key Combination Data
This file contains key combination data, created when you use the Key
Combination Editor for an unspecific game.
. . . . . . . . . . . . . . . .
This documentation is best viewed in a fixed-width font such as "Courier New".
Copyright (C) ZSNES Team & ZSNES Documentation Team [License.txt]

View File

@@ -0,0 +1,231 @@
ZSNES v1.51 Documentation
================================
N a v i g a t i o n
================================
* Index [Index.txt]
* Readme [Readme.txt]
* GUI [GUI.txt]
* Netplay [Netplay.txt]
* Advanced Usage [Advanced.txt]
* Games [Games.txt]
* FAQ [FAQ.txt]
- - - - - - - - - - - - - - - - - -
* Getting Support [Support.txt]
1. APIs and Utilities
2. Contact Information
3. Known Issues
4. Filing a Bug Report
* History [History.txt]
* About [About.txt]
* License [License.txt]
- - - - - - - - - - - - - - - - - -
* NSRT Guide: [http://zsnes-docs.sf.net/nsrt]
* ZSNES Home Page: [ZSNES.com]
================================================================================
~ G e t t i n g S u p p o r t
================================================================================
............................................................
1. APIs and Utilities
............................................................
The following utilities are referenced throughout this documentation to help
accomplish various tasks. There is a link to each utility and a short
description of its purpose.
- - - - - - - - - - - - - - - -
. . . DirectX . . .
- - - - - - - - - - - - - - - -
[http://www.microsoft.com/directx]
DirectX is an API ("Application Programming Interface") required for running
ZSNES in Windows.
- - - - - - - - - - - - - - - -
. . . .SDL. . . .
- - - - - - - - - - - - - - - -
[http://www.libsdl.org]
SDL (Simple DirectMedia Layer) is an API required for running ZSNES on
UNIX-like operating systems.
- - - - - - - - - - - - - - - -
. Scitech . Display . Doctor.
- - - - - - - - - - - - - - - -
[http://www.scitechsoft.com/ftp/sdd]
Scitech Display Doctor (SDD) is a utility that provides drivers for many VGA
and SVGA video cards. It can provide support for VESA VBE 2 on some video
cards that may not normally support it.
The link above directs you to Scitech's FTP site. "regcodes.txt" provides
registration codes for the two different versions of SDD offered, v5.3 and
v6.53. The newer version supports hardware acceleration and more cards. If you
are in a DOS-only environment, you should use one of the "-d.zip" versions.
If you are in a Windows+DOS environment, use one of the "-w.exe" versions.
"univbe67.exe" is a stand-alone VESA VBE driver, and does not provide any of
the other SDD utilities.
Note: SciTech Software no longer offers support for this software.
- - - - - - - - - - - - - - - -
. . . NSRT. . . .
- - - - - - - - - - - - - - - -
[http://nsrt.edgeemu.com]
NSRT - Nach's SNES ROM Tools. <20>NSRT, the most advanced SNES ROM tool to date,
provides the ability to check, alter, retrieve info from, verify, fix, and
organize SNES ROMs.<2E>
NSRT has several important uses in relation to ZSNES:
* You can use it to scan your ROMs and show detailed information about them.
This information will tell you whether or not the ROM is a good dump.
* It can deinterleave your SuperFX ROMs so that ZSNES can load them.
* It can add special NSRT headers to your ROMs, which will allow ZSNES to
automatically enable special controllers for games that need them.
* You can use NSRT to compress your ROMs using a special, custom-built
compression format called JMA. <20>This is an archive format designed by Nach
based on LZMA. When used on SNES ROMs it is faster, and creates smaller
files than 7Zip.<2E>
NSRT is primarily a command-line program, although a graphical front-end is
available. The ZSNES Documentation Team has written a supplementary guide to
NSRT [http://zsnes-docs.sourceforge.net/nsrt] that covers some of the
functions listed above.
............................................................
2. Contact Information and Links
............................................................
The following is a list of all official ZSNES websites and resources:
ZSNES Home Page [http://www.zsnes.com]
ZSNES Project Page hosted by BountySource. [http://zsnes.bountysource.com]
ZSNES Documentation on the Web [http://zsnes-docs.sourceforge.net]
ZSNES Documentation Project Page hosted by SourceForge.net.
[http://sourceforge.net/projects/zsnes-docs/]
ZSNES Documentation Wiki [http://zsnes.game-host.org/wiki/]
ZSNES Bug Tracker [http://zsnes.game-host.org/bugzilla/]
ZSNES Message Board [http://board.zsnes.com]
In your quest to solve whatever problem you may be having with ZSNES, or to
learn more about ZSNES, please first read all of this official documentation.
The ZSNES Message Board is the primary place to receive help about ZSNES, after
you have read through this entire documentation. It is also an interesting
Internet community in its own right. Asking for ROMs (or asking for games, a
link to a ROM site, or where to find ROMs/games) is forbidden! Be sure to also
read the RULES!
............................................................
3. Known Issues
............................................................
* 65816 lacks correct timing. Although ZSNES bases the timing on a variable
cycle/instruction, it does not deduct correct values (such as 16-bit
instructions should deduct 1 more cycle than 8-bit instructions). 100%
cycles of ZSNES isn't 100% cycles of a SNES because of that. This means
that a lot of games either won't run or will produce horrible displays.
Sometimes, adjusting the % of execution can fix those problems. This is all
due to inaccurate documentation used when the ZSNES 65816 core was written.
Fortunately, there are currently ongoing efforts to rewrite the ZSNES core.
* Some games sometimes tend to not display things properly because of
graphic features that aren't implemented yet.
* The Sound DSP chip still has its bugs (not many though). Additionally,
no one knows the exact timing of the SPC700 chip.
............................................................
4. Filing a Bug Report
............................................................
- - - - - - - - - - - - - - - -
Before you file a bug report:
- - - - - - - - - - - - - - - -
* Please verify that you have a good ROM. You should use NSRT
[http://nsrt.edgeemu.com] to do this. You can find detailed instructions on
how to use NSRT to verify your ROM(s) in this section
[http://zsnes-docs.sourceforge.net/nsrt#verifying] of our NSRT Guide
[http://zsnes-docs.sourceforge.net/nsrt].
* Make sure you are using the -current- release of ZSNES.
You can download the latest version from the ZSNES home page
[http://www.zsnes.com/index.php?page=files]
or from the ZSNES SourceForge Project Files page
[http://sourceforge.net/project/showfiles.php?group_id=19677].
If you *were* using an old version of ZSNES, and the problem goes away when
you use the new version, please do not report the bug.
* If the bug still exists in the latest official release of ZSNES, please try
again with the latest WIP release of ZSNES. These are unofficial versions,
compiled from SVN source, and are updated somewhat frequently. They are
available at ipher's WIP Page [http://zsnes.ipherswipsite.com].
* If you want to check against the latest development code, go obtain it from
SVN at BountySource [https://svn.bountysource.com/zsnes/trunk/]. You are
warned, however, that frequent changes are made to the code, so ZSNES may
not always be able to compile when using code obtained from there.
* If possible, confirm whether the bug occurs on real hardware (as in, play
the game on a real console).
Bug reports should be submitted in the Bug Reports/Feature Requests section of
the ZSNES Message Board [http://board.zsnes.com]. Before reporting, please use
the board's search function to see if your bug has already been reported.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
When making a bug report, please include the following information:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* Version (i.e., v1.51) and port (i.e., Windows, DOS, or SDL) of ZSNES you are
using. Make sure to specify the revision if you obtained ZSNES from SVN.
* Detailed ROM information:
- You *must* post the NSRT information about your ROM when reporting a
bug. Please see the "Verifying a ROM to make a Bug Report" section of
our NSRT Guide for detailed instructions.
[http://zsnes-docs.sourceforge.net/nsrt#verifying_bug_reports]
Alternatively, you can use the "Log Rom Info" option in ZSNES [GUI.txt]
to generate the file "rominfo.txt", which also provides the necessary
information.
* Detailed system specifications:
- At minimum, you must tell us what operating system you are using and
what version of DirectX or SDL you are using.
- If your issue is related to performance (as in, ZSNES is too slow),
also include the specs for your processor, RAM, video card, etc.
* Detailed description of the bug:
- A detailed description of the bug is important so that others can try to
reproduce it.
- Screenshots are highly recommended, and save states made before (or in
some cases, during) the bug's occurrence are also greatly appreciated.
- If you know of a previous version of ZSNES that ran the game properly,
or if you know of another game that acts similarly, please let us know.
- It may also be helpful to test the game in other SNES emulators and tell
us the resulting behavior.
. . . . . . . . . . . . . . . .
This documentation is best viewed in a fixed-width font such as "Courier New".
Copyright (C) ZSNES Team & ZSNES Documentation Team [License.txt]

170
zsnes/docs/srcinfo.txt Normal file
View File

@@ -0,0 +1,170 @@
(this part was written by zsKnight)
File List/Information
---------------------
; Porting Routine Files
-DOS-
ZLOADER.C ; Start-up C routines for DOS (Commandline parser, etc.)
DOSINTRF.ASM ; DOS Interface routines (File,video,timers,etc.)
-WINDOWS-
ZLOADERW.C ; Start-up C routines for Windows (Commandline parser, etc.)
Winintrf.asm ; Windows Interface routines (File,video,timers,etc.)
winlink.cpp ; Win32 routines (DirectX, Win32 functions)
ztcp.c ; TCP/IP & UDP driver
copyvwin.asm ; Video Blitter for D modes
-LINUX-
copyvwin.asm ; Video Blitter for D modes
gl_draw.c ; OpenGL routines for drawing the video buffer
gl_draw.h ;
protect.c ;
sdllink.c ; SDL routines (video, input, sound init)
sdlintrf.asm ; Interface routines
sw_draw.c ; Software (via SDL) drawing routines
sw_draw.h ;
zfilew.c ;
zipxw.c ;
zloaderw.c ;
zsnes.1 ; man page for zsnes
ztcp.c ; TCP/IP (Netplay)
; ----------------------------------------------------------------
; The following are generally compiled for both ports, but they
; are not necessarily used by both
; ----------------------------------------------------------------
; General Stuff
MACROS.MAC ; Global Macro file (NEWSYM/EXTSYM global var control macros)
UI.ASM ; Start-up/initialization routines (env variables, cfg
; loader, memory allocation, etc.)
INIT.ASM ; Emulation initialization routines (eg. memory map, emu
; variables, etc.)
CFGLOAD.ASM ; ZSNES.CFG/ZSNESW.CFG file loading/parsing routines
PROCVID.ASM ; In-game video initialization/text displays/mouse routines/
; 8-bit palette/F3 menu routines
TABLE.ASM ; Generates the SNES CPU tables (but in an inefficient way)
TABLEB.ASM
TABLEC.ASM
STABLE.ASM
VCACHE.ASM ; Performs tile caching and also vframe initialization stuff
MENU.ASM ; F1 Menu routines
ENDMEM.ASM ; Where those large arrays go
ZFILE.C ; File Access Routines
GBLHDR.H ; Global Header Stuff
; ZSNES GUI Stuff
GUI.ASM ; Main GUI file
GUITOOLS.INC ; Simple tools for the GUI
GUIWINDP.INC ; GUI Window Display Routines
GUINETPL INC ; GUI Netplay Routines
GUILOAD INC ; GUI File Load Routines
GUIKEYS INC ; GUI Keyboard Input Routines
GUIMOUSE INC ; GUI Mouse Input Routines
GUICHEAT INC ; GUI Cheat Code Routines (search + regular codes)
GUICOMBO INC ; GUI Key Combo Routines
GUIMISC INC ; Misc GUI Stuff (Movie, Joystick setting (display) routines,
; SNES Reset Function
; DOS Specific stuff
VESA2.ASM ; VESA2 DOS Routines
VESA12.ASM ; VESA1.2 DOS Routines
ZSIPX.ASM ; IPX routines (DOS)
JOY.ASM ; DOS Joystick Drivers
COPYVID.INC ; Graphics blitter routines for DOS (copys screen to display)
INITVID.ASM ; Video Initialization routines (DOS)
DEBUG.ASM ; SNES Debugger routines
SW.ASM ; Sidewinder routines
SW32.ASM ; More Sidewinder routines (not sure which file is the real
; one)
GPPRO.ASM ; Gamepad Pro routines (non-USB)
MODEMRTN.ASM ; DOS Modem routines
; Graphics Enhancers
2XSAIMMX.INC ; Kreed's 2xSaI routines
2xSaI.cpp ; Kreed's Super 2xSaI routines
2xsaiw.asm ; 2xSaI for windows (without selector usage)
water.c ; Water Effect
; SNES CPU Emulation routines
execute.asm ; Main emulation execution loop routines (includes save
; states and in-game netplay routines)
SPC700.ASM ; SNES SPC700 Sound CPU emulation routine files
SPCADDR.INC
SPCDEF.INC
DSPPROC.ASM ; SNES Digital Sound Processor main emulation routines
DSP.ASM ; SNES Digital Sound Processor register routines
DMA.ASM ; SNES PPU DMA/HDMA routines
IRQ.ASM ; SNES 65816 IRQ routines (VIRQ/NMI)
MEMORY.ASM ; SNES Memory access routines + C4 routines (Sorry that I
; didn't have these in a separate file since a small memory
; hack of the C4 originated on this file and just grew and
; grew)
E65816.INC ; 65816 emulation routines (w/o SPC700)
65816D.INC
E65816B.INC ; 65816 emulation routines (Debugger I think)
65816DB.INC
E65816C.INC ; 65816 emulation routines (w/ SPC700) - Sorry about these
; 3 files. They used to be just 1 until I removed the
; self-modifying code routines
65816DC.INC
SE65816.INC ; 65816 emulation routines (SA-1)
S65816D.INC
ADDRNI.ASM ; 65816 Non-incrementing addressing modes
ADDRNI.INC
SADDRNI.INC
ADDRESS.INC ; 65816 Incrementing addressing modes
ADDRESS2.INC
SADDRESS.INC
REGS.INC ; SNES I/O register emulation
REGS.MAC
REGSW.INC
REGSW.MAC
; SNES PPU Emulation Routines
MAKEVID.ASM ; 8-bit old graphics engine
MAKEV16B.ASM ; 16-bit old graphics engine
MAKEV16T.ASM ; 16-bit old graphics engine (transparencies)
MV16TMS.ASM ; 16-bit old graphics engine (transp w/ Main+Sub enabled)
MODE7.ASM ; 8-bit mode 7 routines
MODE7.MAC
MODE7EXT.ASM ; 8-bit mode 7 EXTBG routines
MODE716B.ASM ; 16-bit mode 7 routines
MODE716T.ASM ; 16-bit mode 7 routines (transparencies)
MODE716E.ASM ; 16-bit mode 7 EXTBG routines
M716TEXT.ASM ; 16-bit mode 7 EXTBG routines (transparencies)
MODE716D.ASM ; 16-bit mode 7 Direct routines
mode716.asm ; Mode 7 16-bit new graphics engine routines
mode716.mac
NEWGFX.ASM ; 8-bit new graphics engine files
NEWGFX.MAC
NEWGFX2.ASM
NEWGFX2.MAC
NEWGFXB.MAC
NEWGFXWN.MAC
newgfx16.asm ; 16-bit new graphics engine files
newgfx16.mac
NEWG162.ASM
newg162.mac
NEWG163.MAC
NEWG16WN.MAC
VIDMACRO.MAC ; Generic Video Macros File
VIDMACRB.MAC
; Special Chip Emulation Routines
FXEMU2.ASM ; Super FX emulation files
FXEMU2.MAC
FXEMU2B.ASM
FXEMU2B.MAC
FXEMU2C.ASM
FXEMU2C.MAC
FXTABLE.ASM
SFXPROC.ASM
DSP1PROC.ASM ; DSP1 communication routines
DSP1EMU.C ; DSP1 C routines (also includes some C4 C routines)
SA1PROC.ASM ; SA-1 processing routines
SA1REGS.ASM ; SA-1 registers, also includes S-DD1 and SPC7110 routines

3
zsnes/docs/stdards.txt Normal file
View File

@@ -0,0 +1,3 @@
Guidelines for hacking ZSNES:
* Always run minwhite on your file before committing

32
zsnes/docs/support.txt Normal file
View File

@@ -0,0 +1,32 @@
** NOTE ** If you are looking to submit a bug report to the ZSNES
development team, this is the wrong document to be reading.
Please read the 'BUGINFO.TXT' that came with your distribution.
=========================
Getting help with ZSNES
=========================
To get help with ZSNES you can visit the ZSNES message boards.
Please, read the rules thoroughly before posting anything.
http://board.zsnes.com/phpBB2/
There are also several mailing lists devoted to ZSNES which are
kindly hosted by SourceForge. They are usually low-traffic.
http://sourceforge.net/mail/?group_id=19677
And last, but not least, there are several IRC channels which
have been created for the sole purpose of worshiping ZSNES. :)
=================
#ZSNES on irc.freenode.net
=================
This is where all of the old developers of ZSNES used to hangout
(and probably where they met). Some of the developers such as
_Demo_, pagefault, and stainless, and tons of ZSNES fans hangout
here. Be warned that this channel is usually plagued with adult
humor, links and requests for warez and ROMs, and always off-topic.

1
zsnes/docs/thanks.txt Normal file
View File

@@ -0,0 +1 @@
Someone needs to edit this file.

37
zsnes/docs/todo.txt Normal file
View File

@@ -0,0 +1,37 @@
Some Issues :
All Ports:
- Recode netplay feature, once core is not random anymore.
SDL Port:
- Low performance due to differences in surface sizes (internal and
SDL), make both the same size.
- OpenGL code is awful, uncomprehensible, stupid and awful again.
We must fix it.
- Support overscan in games like DQ5.
Windows Port:
- 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?)
- Windows port should be converted to Direct3D from DirectDraw 7.0.
- Windows sound code needs to be rewritten to reflect the SDL port.
Compatibility
- Game not working - Guikuden 1, Cu-On-Pa (and loads more)
- Graphics Glitches - Killer Instinct (black background), FF3 (Range Time Over
and other sprite trouble), Tactic Ogre (Menus),
Super Aleste (incorrect opt in stage 5),
Top Gear 3000 (DSP-4), lots of others...
- Special Chips - DSP1 (95% done), DSP3 (50% done), DSP4 (95% done)
SA-1 (95% done), SPC7110 (Needs some core fixes and decompression)
SFX1/2 (done?), Seta 11 (0% done),
Seta 18 (0% done), BS-X (50% done).
Timing engine
- Convert counter to 32-bit. (assigned to pagefault).
- Fix 65816 timing and take into consideration cycle differences in
8/16-bit mode, branches etc.
Graphics Engine
- Fix some windowing/subscreen sprite problems that are still present in
the new graphics engine. Probably pagefault will have to do this.

33
zsnes/src/Makefile.check Normal file
View File

@@ -0,0 +1,33 @@
##############################################################################
# Makes sure that a system is capable of running ZSNES, errors out with
# an informative message if it is not.
##############################################################################
##############################################################################
# VARIABLES
##############################################################################
NASMMINVER=0.98.36
##############################################################################
# CHECKS
##############################################################################
# NASM version check
NASMVER=$(word 3, $(shell nasm -v))
ifeq ($(strip $(NASMVER)),)
$(error Could not find NASM executable. Please install NASM)
endif
ifneq ($(word 1, $(sort $(NASMMINVER) $(NASMVER))),$(NASMMINVER))
$(error ZSNES needs at least NASM version $(NASMMINVER) to compile. You have version $(NASMVER) installed)
endif
# OpenGL check
USE_OPENGL=true
ifeq ($(strip $(wildcard /usr/lib/libGL.so* /usr/local/lib/libGL.so*)),)
$(warning Could not find OpenGL libraries. Continuing without OpenGL support)
USE_OPENGL=false
endif
ifeq ($(strip $(wildcard /usr/include/GL/gl.h /usr/local/include/GL/gl.h)),)
$(warning Could not find OpenGL headers. Continuing without OpenGL support)
USE_OPENGL=false
endif

158
zsnes/src/Makefile.in Normal file
View File

@@ -0,0 +1,158 @@
#Copyright (C) 1997-2007 ZSNES Team ( zsKnight, _Demo_, pagefault, Nach )
#
#http://www.zsnes.com
#http://sourceforge.net/projects/zsnes
#https://zsnes.bountysource.com
#
#This program is free software; you can redistribute it and/or
#modify it under the terms of the GNU General Public License
#version 2 as published by the Free Software Foundation.
#
#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#GNU General Public License for more details.
#
#You should have received a copy of the GNU General Public License
#along with this program; if not, write to the Free Software
#Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
CHIP_D=chips
CPU_D=cpu
DOS_D=dos
EFF_D=effects
GUI_D=gui
JMA_D=jma
MMLIB_D=mmlib
NET_D=net
PORT_D=linux
TOOL_D=tools
VID_D=video
ZIP_D=zip
PSR=parsegen
PSR_H=cfg.h md.h input.h
CHIP_O=$(CHIP_D)/c4emu.o $(CHIP_D)/c4proc.o $(CHIP_D)/dsp1emu.o\
$(CHIP_D)/dsp1proc.o $(CHIP_D)/dsp2proc.o $(CHIP_D)/dsp3emu.o\
$(CHIP_D)/dsp3proc.o $(CHIP_D)/dsp4emu.o $(CHIP_D)/dsp4proc.o\
$(CHIP_D)/fxemu2.o $(CHIP_D)/fxemu2b.o $(CHIP_D)/fxemu2c.o\
$(CHIP_D)/fxtable.o $(CHIP_D)/obc1emu.o $(CHIP_D)/obc1proc.o\
$(CHIP_D)/sa1proc.o $(CHIP_D)/sa1regs.o $(CHIP_D)/sdd1emu.o\
$(CHIP_D)/seta10.o $(CHIP_D)/sfxproc.o $(CHIP_D)/st10proc.o\
$(CHIP_D)/7110proc.o $(CHIP_D)/seta11.o $(CHIP_D)/st11proc.o
CPU_O=$(CPU_D)/dma.o $(CPU_D)/dsp.o $(CPU_D)/dspproc.o $(CPU_D)/execute.o\
$(CPU_D)/executec.o $(CPU_D)/irq.o $(CPU_D)/memory.o $(CPU_D)/memtable.o\
$(CPU_D)/spc700.o $(CPU_D)/stable.o $(CPU_D)/table.o $(CPU_D)/tablec.o
DEBUG_O=@DEBUGGER_FILES@
EFF_O=$(EFF_D)/burn.o $(EFF_D)/smoke.o $(EFF_D)/water.o
GUI_O=$(GUI_D)/gui.o $(GUI_D)/guifuncs.o $(GUI_D)/menu.o
JMA_O=@JMA_FILES@
MAIN_O=cfg.o endmem.o init.o initc.o input.o md.o patch.o ui.o vcache.o\
version.o zloader.o zmovie.o zpath.o zstate.o ztime.o ztimec.o
MMLIB_O=@MMLIB_FILES@
NET_O=
#$(NET_D)/ztcp.o
PORT_O=$(PORT_D)/audio.o $(PORT_D)/battery.o\
$(PORT_D)/sdlintrf.o $(PORT_D)/sdllink.o @GL_DRAW@ $(PORT_D)/sw_draw.o\
$(PORT_D)/safelib.o
TOOL_O=$(TOOL_D)/fileutil.o $(TOOL_D)/strutil.o
VID_O=$(VID_D)/makev16b.o $(VID_D)/makev16t.o $(VID_D)/makevid.o\
$(VID_D)/mode716.o $(VID_D)/mode716b.o $(VID_D)/mode716d.o\
$(VID_D)/mode716e.o $(VID_D)/mode716t.o $(VID_D)/mode7.o\
$(VID_D)/mode7ext.o $(VID_D)/mv16tms.o $(VID_D)/m716text.o\
$(VID_D)/newg162.o $(VID_D)/newgfx.o $(VID_D)/newgfx16.o\
$(VID_D)/newgfx2.o $(VID_D)/procvid.o $(VID_D)/procvidc.o\
$(VID_D)/sw_draw.o $(VID_D)/2xsaiw.o $(VID_D)/hq2x16.o $(VID_D)/hq2x32.o\
$(VID_D)/hq3x16.o $(VID_D)/hq3x32.o $(VID_D)/hq4x16.o $(VID_D)/hq4x32.o\
$(VID_D)/ntsc.o $(VID_D)/copyvwin.o
ZIP_O=$(ZIP_D)/unzip.o $(ZIP_D)/zpng.o
Z_OBJS=$(MAIN_O) $(CHIP_O) $(CPU_O) $(DEBUG_O) $(GUI_O) $(EFF_O) $(JMA_O)\
$(MMLIB_O) $(NET_O) $(VID_O) $(PORT_O) $(ZIP_O)
.PHONY: default main tools all install clean tclean distclean
.SUFFIXES: .asm .c .cpp .psr
%: %.cpp
@CXX@ @CXXFLAGS@ -o $@ $<
%.o: %.asm
@NASMPATH@ @NFLAGS@ -o $@ $<
%.o: %.c
@CC@ @CFLAGS@ -o $@ -c $<
%.o: %.cpp
@CXX@ @CXXFLAGS@ -o $@ -c $<
%.o %.h: %.psr $(PSR)
./$(PSR) @PSRFLAGS@ -gcc @CC@ -compile -flags "@CFLAGS@ -O1" -cheader $*.h -fname $* $*.o $<
default: main
all: main tools
main: makefile.dep $(Z_OBJS)
@ZC@ -o @ZSNESEXE@ $(Z_OBJS) @ZCFLAGS@ @LDFLAGS@
rm -f version.o
$(PSR): parsegen.cpp
@CXX@ @CXXFLAGS@ -o $@ $< -lz
TOOLSEXE=$(TOOL_D)/archopt $(TOOL_D)/cutrtype $(TOOL_D)/extraext\
$(TOOL_D)/macroll $(TOOL_D)/minwhite $(TOOL_D)/nreplace\
$(TOOL_D)/sec-test $(TOOL_D)/srccount $(TOOL_D)/varrep
tools: $(TOOLSEXE) $(TOOL_D)/depbuild
$(TOOL_D)/archopt: $(TOOL_D)/archopt.c
@CC@ @CFLAGS@ -m32 -o $@ $@.c
$(TOOL_D)/cutrtype: $(TOOL_D)/cutrtype.cpp $(TOOL_O)
@CXX@ @CXXFLAGS@ -o $@ $@.cpp $(TOOL_O)
$(TOOL_D)/depbuild: $(TOOL_D)/depbuild.cpp $(TOOL_O)
@CXX@ @CXXFLAGS@ -o $@ $@.cpp $(TOOL_O)
$(TOOL_D)/extraext: $(TOOL_D)/extraext.cpp $(TOOL_O)
@CXX@ @CXXFLAGS@ -o $@ $@.cpp $(TOOL_O)
$(TOOL_D)/macroll: $(TOOL_D)/macroll.cpp $(TOOL_O)
@CXX@ @CXXFLAGS@ -o $@ $@.cpp $(TOOL_O)
$(TOOL_D)/minwhite: $(TOOL_D)/minwhite.cpp $(TOOL_O)
@CXX@ @CXXFLAGS@ -o $@ $@.cpp $(TOOL_D)/fileutil.o
$(TOOL_D)/nreplace: $(TOOL_D)/nreplace.cpp $(TOOL_O)
@CXX@ @CXXFLAGS@ -o $@ $@.cpp $(TOOL_D)/fileutil.o
$(TOOL_D)/sec-test: $(TOOL_D)/sec-test.cpp $(TOOL_O)
@CXX@ @CXXFLAGS@ -o $@ $@.cpp $(TOOL_O)
$(TOOL_D)/srccount: $(TOOL_D)/srccount.cpp $(TOOL_O)
@CXX@ @CXXFLAGS@ -o $@ $@.cpp $(TOOL_D)/fileutil.o
$(TOOL_D)/varrep: $(TOOL_D)/varrep.cpp $(TOOL_O)
@CXX@ @CXXFLAGS@ -o $@ $@.cpp $(TOOL_O)
include makefile.dep
makefile.dep: $(TOOL_D)/depbuild Makefile
$(TOOL_D)/depbuild @CC@ "@CFLAGS@" @NASMPATH@ "@NFLAGS@" $(Z_OBJS) > makefile.dep
Makefile: Makefile.in config.status
./config.status
config.status: configure.in
./autogen.sh --recheck
install:
@INSTALL@ -d -m 0755 $(DESTDIR)/@prefix@/bin
@INSTALL@ -m 0755 @ZSNESEXE@ $(DESTDIR)/@prefix@/bin
@INSTALL@ -d -m 0755 $(DESTDIR)/@prefix@/man/man1
@INSTALL@ -m 0644 linux/zsnes.1 $(DESTDIR)/@prefix@/man/man1
uninstall:
rm -f @prefix@/bin/$(notdir @ZSNESEXE@) @prefix@/man/man1/zsnes.1
clean:
rm -f $(Z_OBJS) $(PSR) $(PSR_H) @ZSNESEXE@
tclean:
rm -f $(TOOL_O) $(TOOLSEXE)
distclean: clean tclean
rm -f Makefile makefile.dep aclocal.m4 configure config.log \
config.status config.h $(TOOL_D)/depbuild

310
zsnes/src/SConstruct Normal file
View File

@@ -0,0 +1,310 @@
# SConstruct file for ZSNES
# Run 'scons' in this directory to build.
# Run 'scons -c' in this directory to cleanup.
import os
env = Environment ()
platform = env['PLATFORM']
parsegen_tool = env.Program(target= 'parsegen', source = 'parsegen.cpp')
def parsegen_emitter(target,source,env):
env.Depends(target,parsegen_tool)
return (target,source)
if platform == 'posix':
os.system('rm cfgparse.c version.o')
print 'cfgparse.c and version.o removed'
psrbld = Builder(action ='./parsegen -D__UNIXSDL__ $TARGET $SOURCE',
emitter = parsegen_emitter,
suffix = '.c', src_suffix = '.psr')
env['BUILDERS']['PARSEGEN'] = psrbld
env.PARSEGEN('cfgparse.c', 'cfgparse.psr')
objfix_tool = env.Program(target= 'objfix.exe', source= 'objfix.c')
def objfix_emitter(target,source,env):
env.Depends(target,objfix_tool)
return (target,source)
objbld = Builder(action = 'objfix $TARGET',
emitter = objfix_emitter,
suffix = '.obj', src_suffix = '.obj')
env['BUILDERS']['OBJFIX'] = objbld
chipssrc = Split('''
chips/c4emu.c
chips/dsp1emu.c
chips/dsp1proc.asm
chips/dsp2proc.asm
chips/dsp4emu.c
chips/dsp4proc.asm
chips/fxemu2.asm
chips/fxemu2b.asm
chips/fxemu2c.asm
chips/fxtable.asm
chips/sa1proc.asm
chips/sa1regs.asm
chips/sdd1emu.c
chips/seta10.c
chips/sfxproc.asm
chips/st10proc.asm
''')
#ztcp is no longer used
netsrc = Split('''
net/ztcp.c
''')
cpusrc = Split('''
cpu/dma.asm
cpu/dsp.asm
cpu/dspproc.asm
cpu/execute.asm
cpu/executec.c
cpu/irq.asm
cpu/memory.asm
cpu/memtable.c
cpu/spc700.asm
cpu/stable.asm
cpu/table.asm
cpu/tableb.asm
cpu/tablec.asm
''')
dossrc = Split('''
dos/debug.asm
dos/joy.asm
dos/vesa2.asm
''')
effectssrc = Split('''
effects/burn.c
effects/water.c
effects/smoke.c
''')
guisrc = Split('''
gui/gui.asm
gui/guifuncs.c
gui/menu.asm
''')
videosrc = Split('''
video/makev16b.asm
video/makev16t.asm
video/makevid.asm
video/mode716.asm
video/mode716b.asm
video/mode716d.asm
video/mode716e.asm
video/mode716t.asm
video/mode7.asm
video/mode7ext.asm
video/mv16tms.asm
video/newg162.asm
video/newgfx16.asm
video/newgfx2.asm
video/newgfx.asm
video/m716text.asm
video/2xsaiw.asm
video/procvid.asm
video/procvidc.c
video/sw_draw.asm
video/hq2x16.asm
video/hq2x32.asm
video/hq3x16.asm
video/hq3x32.asm
video/hq4x16.asm
video/hq4x32.asm
''')
zipsrc = Split('''
zip/unzip.c
zip/zpng.c
''')
jmasrc = Split('''
jma/7zlzma.cpp
jma/crc32.cpp
jma/iiostrm.cpp
jma/inbyte.cpp
jma/zsnesjma.cpp
jma/jma.cpp
jma/lzma.cpp
jma/lzmadec.cpp
jma/winout.cpp
''')
basesrc = Split('''
cfgparse.c
cfgload.c
endmem.asm
init.asm
initc.c
uic.c
patch.c
ui.asm
vcache.asm
version.c
zmovie.c
zstate.c
zloader.c
''')
linuxsrc = Split('''
linux/copyvwin.asm
linux/sdlintrf.asm
linux/sdllink.c
linux/sw_draw.c
linux/zfilew.c
''')
winsrc = Split('''
win/copyvwin.asm
win/winintrf.asm
win/winlink.cpp
win/zfilew.c
win/zipxw.c
''')
platform = env['PLATFORM']
# Setup environment for nasm
env.Replace (AS = 'nasm')
env.Replace (ASFLAGS = '-f elf ')
#sdl_config = Builder (action = 'sdl-config --include')
# Run config tests.
conf = Configure (env)
# Must have SDL to compile
if not conf.CheckLib ('SDL', 'SDL_Init'):
print 'SDL not found! Please install SDL and try again.'
Exit (1)
if not conf.CheckLib ('png'):
print 'libpng not found! Please install libpng and try again.'
Exit (1)
if not conf.CheckLib ('z'):
print 'zlib not found! Please install zlib and try again.'
Exit (1)
# Check for nasm's existence
if not conf.TryCompile ('db __NASM_VER__', '.asm'):
print 'NASM not found! Please install NASM and try again.'
Exit (1)
env = conf.Finish ()
# Perform any platform-specific initialization
if platform == 'posix':
src = chipssrc + cpusrc + dossrc + effectssrc + guisrc + videosrc + zipsrc + jmasrc + linuxsrc + basesrc
env.Append (CCFLAGS = '-D__UNIXSDL__')
env.Append (ASFLAGS = '-DELF -D__UNIXSDL__')
env.Append (CCFLAGS = '-I.')
env.Append (CCFLAGS = '-I/usr/include/SDL')
#Build ZSNES
env.Program('zsnes',src)
if platform == 'win32':
if env['CC'] == 'cl':
def freeMSVCHack(env, vclibs):
# SCons automatically finds full versions of msvc via the registry, so
# if it can't find 'cl', it may be because we're trying to use the
# free version
def isMicrosoftSDKDir(dir):
return os.path.exists(dir+os.sep+'Include'+os.sep+'Windows.h') and os.path.exists(dir+os.sep+'Lib'+os.sep+'WinMM.lib')
def findMicrosoftSDK():
import SCons.Platform.win32
import SCons.Util
import re
if not SCons.Util.can_read_reg:
return None
HLM = SCons.Util.HKEY_LOCAL_MACHINE
K = r'Software\Microsoft\.NETFramework\AssemblyFolders\PSDK Assemblies'
try:
k = SCons.Util.RegOpenKeyEx(HLM, K)
p = SCons.Util.RegQueryValueEx(k,'')[0]
# this should have \include at the end, so chop that off
p = re.sub(r'(?i)\\+Include\\*$','',p)
if isMicrosoftSDKDir(p): return p
except SCons.Util.RegError:
pass
K = r'SOFTWARE\Microsoft\MicrosoftSDK\InstalledSDKs'
try:
k = SCons.Util.RegOpenKeyEx(HLM, K)
i=0
while 1:
p = SCons.Util.RegEnumKey(k,i)
i+=1
subk = SCons.Util.RegOpenKeyEx(k, p)
try:
p = SCons.Util.RegQueryValueEx(subk,'Install Dir')[0]
# trim trailing backslashes
p = re.sub(r'\\*$','',p)
if isMicrosoftSDKDir(p): return p
except SCons.Util.RegError:
pass
except SCons.Util.RegError:
pass
return None
# End of local defs. Actual freeMSVCHack begins here
if not env['MSVS'].get('VCINSTALLDIR'):
if os.environ.get('VCToolkitInstallDir'):
vcdir=os.environ['VCToolkitInstallDir']
env.PrependENVPath('INCLUDE', vcdir+os.sep+'Include')
env.PrependENVPath('LIB', vcdir+os.sep+'Lib')
env.PrependENVPath('PATH', vcdir+os.sep+'Bin')
env['MSVS']['VERSION'] = '7.1'
env['MSVS']['VERSIONS'] = ['7.1']
if not env['MSVS'].get('PLATFORMSDKDIR'):
sdkdir = findMicrosoftSDK()
if sdkdir:
env.PrependENVPath('INCLUDE', sdkdir+os.sep+'Include')
env.PrependENVPath('LIB', sdkdir+os.sep+'Lib')
env.PrependENVPath('PATH', sdkdir+os.sep+'Bin')
env['MSVS']['PLATFORMSDKDIR']=sdkdir
# FREE MSVC7 only allows
# /ML(libc) /MT(libcmt) or /MLd(libcd)
# Full IDE versions also have
# /MD(msvcrtd) /MTd(libcmtd) and /MDd(msvcrtd)
# So if you want to debug with the freever, the only option is
# the single-threaded lib, /MLd
vclibs['Debug']='/MLd'
vclibs['Release']='/MT'
# MSVC SETUP
# MDd is for multithreaded debug dll CRT (msvcrtd)
# MD is for multithreaded dll CRT (msvcrt)
# These are just my preferences
vclibs = {'Debug':'/MDd','Release':'/MD'}
freeMSVCHack(env, vclibs)
env.Append(CCFLAGS=[vclibs[variant]])
if debug:
env.Append(CCFLAGS=Split('/Zi /Fd${TARGET}.pdb'))
env.Append(LINKFLAGS = ['/DEBUG'])
# env.Clean('.', '${TARGET}.pdb')
# Need to clean .pdbs somehow! The above line doesn't work!
else:
env.Append(CCFLAGS=Split('/Og /Ot /Ob1 /Op /G6'))
env.Append(CCFLAGS=Split('/EHsc /J /W3 /Gd'))
env.Append(CPPDEFINES=Split('WIN32 _WINDOWS'))
src = chipssrc + cpusrc + dossrc + effectssrc + guisrc + videosrc + zipsrc + jmasrc + winsrc
env.Append (CCFLAGS = '-D__WIN32__')
env.Append (ASFLAGS = '-f win32')
#Build ZSNESW
env.Program('zsnesw.exe',src)
else:
if debug:
env.Append (CCFLAGS = '-g -D__WIN32__')
env.Append (CCFLAGS = '-D__WIN32__')
env.Append (ASFLAGS = '-f win32 -O0')
else:
env.Append (CCFLAGS = '-D__WIN32__')
env.Append (CCFLAGS = '-f win32')
#Build ZSNESW
env.Program('zsnesw.exe',src)

314
zsnes/src/acinclude.m4 Normal file
View File

@@ -0,0 +1,314 @@
#Copyright (C) 1997-2007 ZSNES Team ( theoddone33, grinvader, Nach )
#
#http://www.zsnes.com
#http://sourceforge.net/projects/zsnes
#https://zsnes.bountysource.com
#
#This program is free software; you can redistribute it and/or
#modify it under the terms of the GNU General Public License
#version 2 as published by the Free Software Foundation.
#
#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#GNU General Public License for more details.
#
#You should have received a copy of the GNU General Public License
#along with this program; if not, write to the Free Software
#Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
dnl -- Begin zlib autoconf macro
dnl When copying, include from Begin to End zlib autoconf macro, including
dnl those tags, so others can easily copy it too. (Maybe someday this will
dnl become zlib.m4?)
dnl
dnl AM_PATH_ZLIB([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
dnl Tests for zlib, outputs ZLIB_VERSION, ZLIB_LIBS, and ZLIB_CFLAGS
AC_DEFUN([AM_PATH_ZLIB],
[dnl
dnl
dnl
AC_ARG_WITH(zlib-prefix,
[ --with-zlib-prefix=PFX Prefix where zlib is installed (optional)],
zlib_prefix="$withval",
zlib_prefix="")
min_zlib_version=ifelse([$1],,1.1.0,$1)
AC_MSG_CHECKING(for zlib - version >= $min_zlib_version)
tempLIBS="$LIBS"
tempCFLAGS="$CFLAGS"
if test x$zlib_prefix != x ; then
ZLIB_LIBS="-L$zlib_prefix"
ZLIB_CFLAGS="-I$zlib_prefix"
fi
ZLIB_LIBS="$ZLIB_LIBS -lz"
LIBS="$LIBS $ZLIB_LIBS"
CFLAGS="$CFLAGS $ZLIB_CFLAGS"
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <zlib.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
char* my_strdup (char *str)
{
char *new_str;
if (str)
{
new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char));
strcpy (new_str, str);
}
else new_str = NULL;
return new_str;
}
int main (int argc, char *argv[])
{
int major, minor, micro, zlib_major_version, zlib_minor_version, zlib_micro_version;
char *zlibver, *tmp_version;
zlibver = ZLIB_VERSION;
FILE *fp = fopen("conf.zlibtest", "a");
if ( fp ) {
fprintf(fp, "%s", zlibver);
fclose(fp);
}
/* HP/UX 9 (%@#!) writes to sscanf strings */
tmp_version = my_strdup("$min_zlib_version");
if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
printf("%s, bad version string for\n\tmin_zlib_version... ", "$min_zlib_version");
exit(1);
}
if (sscanf(zlibver, "%d.%d.%d", &zlib_major_version, &zlib_minor_version, &zlib_micro_version) != 3) {
printf("%s, bad version string given\n", zlibver);
puts("\tby zlib, sometimes due to very old zlibs that didnt correctly");
printf("\tdefine their version. Please upgrade if you are running an\n\told zlib... ");
exit(1);
}
if ((zlib_major_version > major) ||
((zlib_major_version == major) && (zlib_minor_version > minor)) ||
((zlib_major_version == major) && (zlib_minor_version == minor) && (zlib_micro_version >= micro)))
{
return 0;
}
else
{
return 1;
}
}
]])],
with_zlib=yes,
with_zlib=no,
[AC_MSG_RESULT(cross-compiling)
with_zlib=""
AC_MSG_WARN(Assuming zlib is available)])
if test x$with_zlib != x; then
AC_MSG_RESULT($with_zlib)
fi
if test x$with_zlib = xyes; then
ZLIB_VERSION=$(<conf.zlibtest)
ifelse([$2], , :, [$2])
else
ZLIB_CFLAGS=""
ZLIB_LIBS=""
ZLIB_VERSION=""
ifelse([$3], , :, [$3])
fi
LIBS="$tempLIBS"
CFLAGS="$tempCFLAGS"
rm conf.zlibtest
AC_SUBST(ZLIB_CFLAGS)
AC_SUBST(ZLIB_VERSION)
AC_SUBST(ZLIB_LIBS)
])
dnl -- End zlib autoconf macro
dnl ----
dnl -- Begin libpng autoconf macro
dnl When copying, include from Begin to End libpng autoconf macro, including
dnl those tags, so others can easily copy it too. (Maybe someday this will
dnl become libpng.m4?)
dnl
dnl AM_PATH_LIBPNG([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
dnl Tests for libpng, outputs LIBPNG_VERSION, LIBPNG_LIBS, and LIBPNG_CFLAGS
AC_DEFUN([AM_PATH_LIBPNG],
[dnl
dnl
dnl
dnl Comment out this section, and the other labled parts to disable the user
dnl having a choice about being able to disable libpng or not. Recommended
dnl you use AC_MSG_ERROR(LIBPNG >= 1.0.0 is required) for the
dnl ACTION-IF-NOT-FOUND if you plan on disabling user choice.
dnl <--- disable for no user choice part #1
AC_ARG_ENABLE(libpng,
[ --disable-libpng Build without libpng support ],
,
enable_libpng=yes)
dnl --->
AC_ARG_WITH(libpng-prefix,
[ --with-libpng-prefix=PFX Prefix where libpng is installed (optional)],
libpng_prefix="$withval",
libpng_prefix="")
min_libpng_version=ifelse([$1], ,1.2.0,$1)
tempLIBS="$LIBS"
tempCFLAGS="$CFLAGS"
if test x$libpng_prefix != x ; then
LIBPNG_LIBS="-L$libpng_prefix"
LIBPNG_CFLAGS="-I$libpng_prefix"
fi
LIBPNG_LIBS="$LIBPNG_LIBS -lpng -lm"
LIBS="$LIBS $LIBPNG_LIBS"
CFLAGS="$CFLAGS $LIBPNG_CFLAGS"
AC_MSG_CHECKING(for libpng - version >= $min_libpng_version)
dnl <--- disable for no user choice part #2
if test x$enable_libpng != xno; then
dnl --->
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <png.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
char* my_strdup (char *str)
{
char *new_str;
if (str)
{
new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char));
strcpy (new_str, str);
}
else new_str = NULL;
return new_str;
}
int main (int argc, char *argv[])
{
int major, minor, micro, libpng_major_version, libpng_minor_version, libpng_micro_version;
char *libpngver, *tmp_version;
libpngver = PNG_LIBPNG_VER_STRING;
FILE *fp = fopen("conf.libpngtest", "a");
if ( fp ) {
fprintf(fp, "%s", libpngver);
fclose(fp);
}
/* HP/UX 9 (%@#!) writes to sscanf strings */
tmp_version = my_strdup("$min_libpng_version");
if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
printf("%s, bad version string for\n\tmin_libpng_version... ", "$min_libpng_version");
exit(1);
}
if (sscanf(libpngver, "%d.%d.%d", &libpng_major_version, &libpng_minor_version, &libpng_micro_version) != 3) {
printf("%s, bad version string given\n", libpngver);
puts("\tby libpng, sometimes due to very old libpngs that didnt correctly");
printf("\tdefine their version. Please upgrade if you are running an\n\told libpng... ");
exit(1);
}
if ((libpng_major_version > major) ||
((libpng_major_version == major) && (libpng_minor_version > minor)) ||
((libpng_major_version == major) && (libpng_minor_version == minor) && (libpng_micro_version >= micro)))
{
return 0;
}
else
{
return 1;
}
}
]])],
with_libpng=yes,
with_libpng=no,
[AC_MSG_RESULT(cross-compiling)
with_libpng=""
AC_MSG_WARN(Assuming libpng is available)])
if test x$with_libpng != x; then
AC_MSG_RESULT($with_libpng)
fi
if test x$with_libpng = xyes; then
LIBPNG_VERSION=$(<conf.libpngtest)
ifelse([$2], , :, [$2])
else
LIBPNG_CFLAGS=""
LIBPNG_LIBS=""
LIBPNG_VERSION=""
ifelse([$3], , :, [$3])
fi
LIBS="$tempLIBS"
CFLAGS="$tempCFLAGS"
rm conf.libpngtest
AC_SUBST(LIBPNG_CFLAGS)
AC_SUBST(LIBPNG_VERSION)
AC_SUBST(LIBPNG_LIBS)
dnl <--- disable for no user choice part #3
else
AC_MSG_RESULT(disabled by user)
fi
dnl --->
])
dnl -- End libpng autoconf macro
dnl ----
dnl -- Begin custom tools use
dnl
AC_DEFUN([AM_ARCH_DETECT],
[
AC_MSG_CHECKING(for cpu info)
AC_ARG_ENABLE(cpucheck,
[ --disable-cpucheck Do not try to autodetect cpu architecture ],
,
enable_cpucheck=yes)
if test x$enable_cpucheck != xno; then
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <stdlib.h>
int main()
{
int check;
system("$CC -O3 -o tools/archopt tools/archopt.c");
check = system("tools/archopt > conf.archchk");
return((check) ? 1:0);
}
]])],
cpu_test=found,
cpu_test=failed,
[AC_MSG_RESULT(cross-compiling)
cpu_test=""
AC_MSG_WARN(You should use --target)])
if test x$cpu_test != x; then
AC_MSG_RESULT($cpu_test)
fi
if test x$cpu_test = xfound; then
ARCH_INFO=$(<conf.archchk)
fi
rm -f conf.archchk tools/archopt
AC_SUBST(ARCH_INFO)
else
AC_MSG_RESULT(disabled by user)
fi
])
dnl -- End custom tools use

154
zsnes/src/argv.h Normal file
View File

@@ -0,0 +1,154 @@
#ifndef ARGV_H
#define ARGV_H
static char *decode_string(char *str)
{
size_t str_len = strlen(str), i = 0;
char *dest = str;
if ((str_len > 1) && ((*str == '\"') || (*str == '\'')) && (str[str_len-1] == *str))
{
memmove(str, str+1, str_len-2);
str[str_len-2] = 0;
}
while (*str)
{
if (*str == '\\')
{
str++;
}
dest[i++] = *str++;
}
dest[i] = 0;
return(dest);
}
static char *find_next_match(char *str, char match_char)
{
char *pos = 0;
while (*str)
{
if (*str == match_char)
{
pos = str;
break;
}
if (*str == '\\')
{
if (str[1])
{
str++;
}
else
{
break;
}
}
str++;
}
return(pos);
}
static char *get_param(char *str)
{
static char *pos = 0;
char *token = 0;
if (str) //Start a new string?
{
pos = str;
}
if (pos)
{
//Skip delimiters
while (*pos == ' ') { pos++; }
if (*pos)
{
token = pos;
//Skip non-delimiters
while (*pos && (*pos != ' '))
{
//Skip quoted characters
if ((*pos == '\"') || (*pos == '\''))
{
char *match_pos = 0;
if ((match_pos = find_next_match(pos+1, *pos)))
{
pos = match_pos;
}
}
//Skip escaped spaces
if (*pos == '\\') { pos++; }
pos++;
}
if (*pos) { *pos++ = '\0'; }
}
}
return(token);
}
static size_t count_param(char *str)
{
size_t i = 0;
while (*str)
{
//Skip delimiters
while (*str == ' ') { str++; }
//Skip non-delimiters
while (*str && (*str != ' '))
{
//Skip quoted characters
if ((*str == '\"') || (*str == '\''))
{
char *match_str = 0;
if ((match_str = find_next_match(str+1, *str)))
{
str = match_str;
}
}
//Skip escaped spaces
if (*str == '\\') { str++; }
str++;
}
i++;
}
return(i);
}
static char **build_argv(char *str)
{
size_t argc = count_param(str);
char **argv = (char **)malloc(sizeof(char *)*(argc+1));
if (argv)
{
char *p, **argp = argv;
for (p = get_param(str); p; p = get_param(0), argp++)
{
*argp = decode_string(p);
}
*argp = 0;
return(argv);
}
return(0);
}
/*
static void argv_print(char **argv)
{
char **argp = argv;
while (*argp)
{
printf("argv[%u]: %s\n", argp-argv, *argp);
argp++;
}
printf("argv[%u]: NULL\n", argp-argv);
}
*/
#endif

95
zsnes/src/asm_call.h Normal file
View File

@@ -0,0 +1,95 @@
/*
Copyright (C) 1997-2007 ZSNES Team ( zsKnight, _Demo_, pagefault, Nach )
http://www.zsnes.com
http://sourceforge.net/projects/zsnes
https://zsnes.bountysource.com
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/*
Introducing 'the "DJGPP/MinGW/MSVC/GCC on *nix compatible" call asm function
safely from C/C++' macro function!
Usage:
asm_call( func_name );
That's all there is to it!!!
Note: Make sure this is used on a line by itself if the file will ever be
compiled with MSVC, since it's preproccessor won't parse the inline
assembly correctly if other stuff are on the line
Note: This will not work with GCC when using the parameter -MASM=intel
I'd fix that if anyone knows if that parameter defines something I can check
-Nach
*/
#ifndef ASM_CALL_H
#define ASM_CALL_H
////////////////////////////////////////////////////////
#ifdef __GNUC__
#define ASM_COMMAND(line) #line"\n\t"
#ifdef __x86_64__
#define PUSHAD ASM_COMMAND(pushq %rax) \
ASM_COMMAND(pushq %rcx) \
ASM_COMMAND(pushq %rdx) \
ASM_COMMAND(pushq %rbx) \
ASM_COMMAND(pushq %rsp) \
ASM_COMMAND(pushq %rbp) \
ASM_COMMAND(pushq %rsi) \
ASM_COMMAND(pushq %rdi)
#define POPAD ASM_COMMAND(popq %rdi) \
ASM_COMMAND(popq %rsi) \
ASM_COMMAND(popq %rbp) \
ASM_COMMAND(popq %rsp) \
ASM_COMMAND(popq %rbx) \
ASM_COMMAND(popq %rdx) \
ASM_COMMAND(popq %rcx) \
ASM_COMMAND(popq %rax)
#else
#define PUSHAD ASM_COMMAND(pushal)
#define POPAD ASM_COMMAND(popal)
#endif
#ifdef __ELF__
#define ASM_CALL(func) ASM_COMMAND(call func)
#else
#define ASM_CALL(func) ASM_COMMAND(call _ ## func)
#endif
#define asm_call(func) __asm__ __volatile__ ( \
PUSHAD \
ASM_CALL(func) \
POPAD \
);
#else //MSVC
#define asm_call(func) { _asm pushad \
_asm call func \
_asm popad };
#endif
////////////////////////////////////////////////////////
#endif

17
zsnes/src/autogen.sh Executable file
View File

@@ -0,0 +1,17 @@
#!/bin/sh
echo "Generating build information using aclocal and autoconf..."
# Regenerate configuration files
aclocal --acdir=`sdl-config --prefix`/share/aclocal # thanks asfand
autoconf
# Run configure for this platform, or simply update Makefile
case $1 in
--noconf )
break ;;
--recheck )
./config.status --recheck; break ;;
* )
./configure $*; break ;;
esac

1011
zsnes/src/cfg.psr Normal file

File diff suppressed because it is too large Load Diff

1375
zsnes/src/chips/7110proc.asm Normal file

File diff suppressed because it is too large Load Diff

345
zsnes/src/chips/c4emu.c Normal file
View File

@@ -0,0 +1,345 @@
/*
Copyright (C) 1997-2007 ZSNES Team ( zsKnight, _Demo_, pagefault, Nach )
http://www.zsnes.com
http://sourceforge.net/projects/zsnes
https://zsnes.bountysource.com
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifdef __UNIXSDL__
#include "../gblhdr.h"
#else
#include <math.h>
#include <stdlib.h>
#endif
#ifdef PI
#undef PI
#endif
#define PI 3.1415926535897932384626433832795
#define Cos(a) ((double) CosTable[a])
#define Sin(a) ((double) SinTable[a])
#define Tan(a) (CosTable[a]?((((int)SinTable[a])<<16)/CosTable[a]):(int)0x80000000)
short SinTable[512] = {
0, 402, 804, 1206, 1607, 2009, 2410, 2811,
3211, 3611, 4011, 4409, 4808, 5205, 5602, 5997,
6392, 6786, 7179, 7571, 7961, 8351, 8739, 9126,
9512, 9896, 10278, 10659, 11039, 11416, 11793, 12167,
12539, 12910, 13278, 13645, 14010, 14372, 14732, 15090,
15446, 15800, 16151, 16499, 16846, 17189, 17530, 17869,
18204, 18537, 18868, 19195, 19519, 19841, 20159, 20475,
20787, 21097, 21403, 21706, 22005, 22301, 22594, 22884,
23170, 23453, 23732, 24007, 24279, 24547, 24812, 25073,
25330, 25583, 25832, 26077, 26319, 26557, 26790, 27020,
27245, 27466, 27684, 27897, 28106, 28310, 28511, 28707,
28898, 29086, 29269, 29447, 29621, 29791, 29956, 30117,
30273, 30425, 30572, 30714, 30852, 30985, 31114, 31237,
31357, 31471, 31581, 31685, 31785, 31881, 31971, 32057,
32138, 32214, 32285, 32351, 32413, 32469, 32521, 32568,
32610, 32647, 32679, 32706, 32728, 32745, 32758, 32765,
32767, 32765, 32758, 32745, 32728, 32706, 32679, 32647,
32610, 32568, 32521, 32469, 32413, 32351, 32285, 32214,
32138, 32057, 31971, 31881, 31785, 31685, 31581, 31471,
31357, 31237, 31114, 30985, 30852, 30714, 30572, 30425,
30273, 30117, 29956, 29791, 29621, 29447, 29269, 29086,
28898, 28707, 28511, 28310, 28106, 27897, 27684, 27466,
27245, 27020, 26790, 26557, 26319, 26077, 25832, 25583,
25330, 25073, 24812, 24547, 24279, 24007, 23732, 23453,
23170, 22884, 22594, 22301, 22005, 21706, 21403, 21097,
20787, 20475, 20159, 19841, 19519, 19195, 18868, 18537,
18204, 17869, 17530, 17189, 16846, 16499, 16151, 15800,
15446, 15090, 14732, 14372, 14010, 13645, 13278, 12910,
12539, 12167, 11793, 11416, 11039, 10659, 10278, 9896,
9512, 9126, 8739, 8351, 7961, 7571, 7179, 6786,
6392, 5997, 5602, 5205, 4808, 4409, 4011, 3611,
3211, 2811, 2410, 2009, 1607, 1206, 804, 402,
0, -402, -804, -1206, -1607, -2009, -2410, -2811,
-3211, -3611, -4011, -4409, -4808, -5205, -5602, -5997,
-6392, -6786, -7179, -7571, -7961, -8351, -8739, -9126,
-9512, -9896, -10278, -10659, -11039, -11416, -11793, -12167,
-12539, -12910, -13278, -13645, -14010, -14372, -14732, -15090,
-15446, -15800, -16151, -16499, -16846, -17189, -17530, -17869,
-18204, -18537, -18868, -19195, -19519, -19841, -20159, -20475,
-20787, -21097, -21403, -21706, -22005, -22301, -22594, -22884,
-23170, -23453, -23732, -24007, -24279, -24547, -24812, -25073,
-25330, -25583, -25832, -26077, -26319, -26557, -26790, -27020,
-27245, -27466, -27684, -27897, -28106, -28310, -28511, -28707,
-28898, -29086, -29269, -29447, -29621, -29791, -29956, -30117,
-30273, -30425, -30572, -30714, -30852, -30985, -31114, -31237,
-31357, -31471, -31581, -31685, -31785, -31881, -31971, -32057,
-32138, -32214, -32285, -32351, -32413, -32469, -32521, -32568,
-32610, -32647, -32679, -32706, -32728, -32745, -32758, -32765,
-32767, -32765, -32758, -32745, -32728, -32706, -32679, -32647,
-32610, -32568, -32521, -32469, -32413, -32351, -32285, -32214,
-32138, -32057, -31971, -31881, -31785, -31685, -31581, -31471,
-31357, -31237, -31114, -30985, -30852, -30714, -30572, -30425,
-30273, -30117, -29956, -29791, -29621, -29447, -29269, -29086,
-28898, -28707, -28511, -28310, -28106, -27897, -27684, -27466,
-27245, -27020, -26790, -26557, -26319, -26077, -25832, -25583,
-25330, -25073, -24812, -24547, -24279, -24007, -23732, -23453,
-23170, -22884, -22594, -22301, -22005, -21706, -21403, -21097,
-20787, -20475, -20159, -19841, -19519, -19195, -18868, -18537,
-18204, -17869, -17530, -17189, -16846, -16499, -16151, -15800,
-15446, -15090, -14732, -14372, -14010, -13645, -13278, -12910,
-12539, -12167, -11793, -11416, -11039, -10659, -10278, -9896,
-9512, -9126, -8739, -8351, -7961, -7571, -7179, -6786,
-6392, -5997, -5602, -5205, -4808, -4409, -4011, -3611,
-3211, -2811, -2410, -2009, -1607, -1206, -804, -402
};
short CosTable[512] = {
32767, 32765, 32758, 32745, 32728, 32706, 32679, 32647,
32610, 32568, 32521, 32469, 32413, 32351, 32285, 32214,
32138, 32057, 31971, 31881, 31785, 31685, 31581, 31471,
31357, 31237, 31114, 30985, 30852, 30714, 30572, 30425,
30273, 30117, 29956, 29791, 29621, 29447, 29269, 29086,
28898, 28707, 28511, 28310, 28106, 27897, 27684, 27466,
27245, 27020, 26790, 26557, 26319, 26077, 25832, 25583,
25330, 25073, 24812, 24547, 24279, 24007, 23732, 23453,
23170, 22884, 22594, 22301, 22005, 21706, 21403, 21097,
20787, 20475, 20159, 19841, 19519, 19195, 18868, 18537,
18204, 17869, 17530, 17189, 16846, 16499, 16151, 15800,
15446, 15090, 14732, 14372, 14010, 13645, 13278, 12910,
12539, 12167, 11793, 11416, 11039, 10659, 10278, 9896,
9512, 9126, 8739, 8351, 7961, 7571, 7179, 6786,
6392, 5997, 5602, 5205, 4808, 4409, 4011, 3611,
3211, 2811, 2410, 2009, 1607, 1206, 804, 402,
0, -402, -804, -1206, -1607, -2009, -2410, -2811,
-3211, -3611, -4011, -4409, -4808, -5205, -5602, -5997,
-6392, -6786, -7179, -7571, -7961, -8351, -8739, -9126,
-9512, -9896, -10278, -10659, -11039, -11416, -11793, -12167,
-12539, -12910, -13278, -13645, -14010, -14372, -14732, -15090,
-15446, -15800, -16151, -16499, -16846, -17189, -17530, -17869,
-18204, -18537, -18868, -19195, -19519, -19841, -20159, -20475,
-20787, -21097, -21403, -21706, -22005, -22301, -22594, -22884,
-23170, -23453, -23732, -24007, -24279, -24547, -24812, -25073,
-25330, -25583, -25832, -26077, -26319, -26557, -26790, -27020,
-27245, -27466, -27684, -27897, -28106, -28310, -28511, -28707,
-28898, -29086, -29269, -29447, -29621, -29791, -29956, -30117,
-30273, -30425, -30572, -30714, -30852, -30985, -31114, -31237,
-31357, -31471, -31581, -31685, -31785, -31881, -31971, -32057,
-32138, -32214, -32285, -32351, -32413, -32469, -32521, -32568,
-32610, -32647, -32679, -32706, -32728, -32745, -32758, -32765,
-32767, -32765, -32758, -32745, -32728, -32706, -32679, -32647,
-32610, -32568, -32521, -32469, -32413, -32351, -32285, -32214,
-32138, -32057, -31971, -31881, -31785, -31685, -31581, -31471,
-31357, -31237, -31114, -30985, -30852, -30714, -30572, -30425,
-30273, -30117, -29956, -29791, -29621, -29447, -29269, -29086,
-28898, -28707, -28511, -28310, -28106, -27897, -27684, -27466,
-27245, -27020, -26790, -26557, -26319, -26077, -25832, -25583,
-25330, -25073, -24812, -24547, -24279, -24007, -23732, -23453,
-23170, -22884, -22594, -22301, -22005, -21706, -21403, -21097,
-20787, -20475, -20159, -19841, -19519, -19195, -18868, -18537,
-18204, -17869, -17530, -17189, -16846, -16499, -16151, -15800,
-15446, -15090, -14732, -14372, -14010, -13645, -13278, -12910,
-12539, -12167, -11793, -11416, -11039, -10659, -10278, -9896,
-9512, -9126, -8739, -8351, -7961, -7571, -7179, -6786,
-6392, -5997, -5602, -5205, -4808, -4409, -4011, -3611,
-3211, -2811, -2410, -2009, -1607, -1206, -804, -402,
0, 402, 804, 1206, 1607, 2009, 2410, 2811,
3211, 3611, 4011, 4409, 4808, 5205, 5602, 5997,
6392, 6786, 7179, 7571, 7961, 8351, 8739, 9126,
9512, 9896, 10278, 10659, 11039, 11416, 11793, 12167,
12539, 12910, 13278, 13645, 14010, 14372, 14732, 15090,
15446, 15800, 16151, 16499, 16846, 17189, 17530, 17869,
18204, 18537, 18868, 19195, 19519, 19841, 20159, 20475,
20787, 21097, 21403, 21706, 22005, 22301, 22594, 22884,
23170, 23453, 23732, 24007, 24279, 24547, 24812, 25073,
25330, 25583, 25832, 26077, 26319, 26557, 26790, 27020,
27245, 27466, 27684, 27897, 28106, 28310, 28511, 28707,
28898, 29086, 29269, 29447, 29621, 29791, 29956, 30117,
30273, 30425, 30572, 30714, 30852, 30985, 31114, 31237,
31357, 31471, 31581, 31685, 31785, 31881, 31971, 32057,
32138, 32214, 32285, 32351, 32413, 32469, 32521, 32568,
32610, 32647, 32679, 32706, 32728, 32745, 32758, 32765
};
short C4WFXVal;
short C4WFYVal;
short C4WFZVal;
short C4WFX2Val;
short C4WFY2Val;
short C4WFDist;
short C4WFScale;
double tanval;
double c4x,c4y,c4z;
double c4x2,c4y2,c4z2;
void C4TransfWireFrame()
{
c4x=(double)C4WFXVal;
c4y=(double)C4WFYVal;
c4z=(double)C4WFZVal-0x95;
// Rotate X
tanval=-(double)C4WFX2Val*PI*2/128;
c4y2=c4y*cos(tanval)-c4z*sin(tanval);
c4z2=c4y*sin(tanval)+c4z*cos(tanval);
// Rotate Y
tanval=-(double)C4WFY2Val*PI*2/128;
c4x2=c4x*cos(tanval)+c4z2*sin(tanval);
c4z=c4x*-sin(tanval)+c4z2*cos(tanval);
// Rotate Z
tanval=-(double)C4WFDist*PI*2/128;
c4x=c4x2*cos(tanval)-c4y2*sin(tanval);
c4y=c4x2*sin(tanval)+c4y2*cos(tanval);
// Scale
C4WFXVal=(short)(c4x*C4WFScale/(0x90*(c4z+0x95))*0x95);
C4WFYVal=(short)(c4y*C4WFScale/(0x90*(c4z+0x95))*0x95);
}
void C4TransfWireFrame2()
{
c4x=(double)C4WFXVal;
c4y=(double)C4WFYVal;
c4z=(double)C4WFZVal;
// Rotate X
tanval=-(double)C4WFX2Val*PI*2/128;
c4y2=c4y*cos(tanval)-c4z*sin(tanval);
c4z2=c4y*sin(tanval)+c4z*cos(tanval);
// Rotate Y
tanval=-(double)C4WFY2Val*PI*2/128;
c4x2=c4x*cos(tanval)+c4z2*sin(tanval);
c4z=c4x*-sin(tanval)+c4z2*cos(tanval);
// Rotate Z
tanval=-(double)C4WFDist*PI*2/128;
c4x=c4x2*cos(tanval)-c4y2*sin(tanval);
c4y=c4x2*sin(tanval)+c4y2*cos(tanval);
// Scale
C4WFXVal=(short)(c4x*C4WFScale/0x100);
C4WFYVal=(short)(c4y*C4WFScale/0x100);
}
void C4CalcWireFrame()
{
C4WFXVal=C4WFX2Val-C4WFXVal;
C4WFYVal=C4WFY2Val-C4WFYVal;
if (abs(C4WFXVal)>abs(C4WFYVal)){
C4WFDist=abs(C4WFXVal)+1;
C4WFYVal=(short)((256*(long)C4WFYVal)/abs(C4WFXVal));
if (C4WFXVal<0) C4WFXVal=-256;
else C4WFXVal=256;
}
else
if (C4WFYVal!=0) {
C4WFDist=abs(C4WFYVal)+1;
C4WFXVal=(short)((256*(long)C4WFXVal)/abs(C4WFYVal));
if (C4WFYVal<0) C4WFYVal=-256;
else C4WFYVal=256;
}
else C4WFDist=0;
}
short C41FXVal;
short C41FYVal;
short C41FAngleRes;
short C41FDist;
short C41FDistVal;
void C4Op1F()
{
if (C41FXVal == 0) {
if (C41FYVal>0) C41FAngleRes=0x80;
else C41FAngleRes=0x180;
}
else {
tanval = ((double)C41FYVal)/((double)C41FXVal);
C41FAngleRes=(short)(atan(tanval)/(PI*2)*512);
C41FAngleRes=C41FAngleRes;
if (C41FXVal<0) C41FAngleRes+=0x100;
C41FAngleRes&=0x1FF;
}
}
void C4Op15()
{
tanval=sqrt(((double)C41FYVal)*((double)C41FYVal)+((double)C41FXVal)*
((double)C41FXVal));
C41FDist=(short)tanval;
}
void C4Op0D()
{
tanval=sqrt(((double)C41FYVal)*((double)C41FYVal)+((double)C41FXVal)*
((double)C41FXVal));
tanval=(double)C41FDistVal/tanval;
C41FYVal=(short)(((double)C41FYVal*tanval)*0.99);
C41FXVal=(short)(((double)C41FXVal*tanval)*0.98);
}
#define READ_WORD(s) (*(unsigned short *) (s))
void C4Op22()
{
extern unsigned char *C4Ram;
short angle1 = READ_WORD(C4Ram+0x1f8c) & 0x1ff;
short angle2 = READ_WORD(C4Ram+0x1f8f) & 0x1ff;
int tan1 = Tan(angle1);
int tan2 = Tan(angle2);
short y = READ_WORD(C4Ram+0x1f83) - READ_WORD(C4Ram+0x1f89);
short left, right;
int j;
for (j = 0; j < 225; j++, y++)
{
if (y >= 0)
{
left = (((int)tan1*y) >> 16) - READ_WORD(C4Ram+0x1f80) + READ_WORD(C4Ram+0x1f86);
right = (((int)tan2*y) >> 16) - READ_WORD(C4Ram+0x1f80) + READ_WORD(C4Ram+0x1f86) + READ_WORD(C4Ram+0x1f93);
if(left<0 && right<0)
{
left = 1;
right = 0;
}
else if (left < 0)
{
left = 0;
}
else if (right < 0)
{
right = 0;
}
if (left > 255 && right > 255)
{
left = 255;
right = 254;
}
else if (left > 255)
{
left = 255;
}
else if (right > 255)
{
right = 255;
}
}
else
{
left = 1;
right = 0;
}
C4Ram[j+0x800] = (unsigned char)left;
C4Ram[j+0x900] = (unsigned char)right;
}
}

2205
zsnes/src/chips/c4proc.asm Normal file

File diff suppressed because it is too large Load Diff

1216
zsnes/src/chips/dsp1emu.c Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,879 @@
;Copyright (C) 1997-2007 ZSNES Team ( zsKnight, _Demo_, pagefault, Nach )
;
;http://www.zsnes.com
;http://sourceforge.net/projects/zsnes
;https://zsnes.bountysource.com
;
;This program is free software; you can redistribute it and/or
;modify it under the terms of the GNU General Public License
;version 2 as published by the Free Software Foundation.
;
;This program is distributed in the hope that it will be useful,
;but WITHOUT ANY WARRANTY; without even the implied warranty of
;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;GNU General Public License for more details.
;
;You should have received a copy of the GNU General Public License
;along with this program; if not, write to the Free Software
;Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
%include "macros.mac"
EXTSYM regaccessbankr8,regaccessbankr16,regaccessbankw8,regaccessbankw16
EXTSYM DSPOp0A,Op0AA,Op0AB,Op0AC,Op0AD,Op0AVS,DSPOp10,DSPOp00,Op00Multiplicand
EXTSYM Op00Multiplier,Op00Result,DSPOp0F,Op0FPass
EXTSYM DSPOp04,Op04Angle,Op04Cos,Op04Radius,Op04Sin
EXTSYM DSPOp28,Op28R,Op28X,Op28Y,Op28Z
EXTSYM DSPOp0C,Op0CA,Op0CX1,Op0CX2,Op0CY1,Op0CY2
EXTSYM DSPOp02,Op02AAS,Op02AZS,Op02CX,Op02CY,Op02FX,Op02FY
EXTSYM Op02FZ,Op02LES,Op02LFE,Op02VOF,Op02VVA
EXTSYM DSPOp06,Op06X,Op06Y,Op06Z,Op06H,Op06V,Op06M
EXTSYM DSPOp0E,Op0EH,Op0EV,Op0EX,Op0EY
EXTSYM Op01m,Op01Zr,Op01Xr,Op01Yr,DSPOp01
EXTSYM Op11m,Op11Zr,Op11Xr,Op11Yr,DSPOp11
EXTSYM Op21m,Op21Zr,Op21Xr,Op21Yr,DSPOp21
EXTSYM Op0DX,Op0DY,Op0DZ,Op0DF,Op0DL,Op0DU,DSPOp0D
EXTSYM Op1DX,Op1DY,Op1DZ,Op1DF,Op1DL,Op1DU,DSPOp1D
EXTSYM Op2DX,Op2DY,Op2DZ,Op2DF,Op2DL,Op2DU,DSPOp2D
EXTSYM Op03X,Op03Y,Op03Z,Op03F,Op03L,Op03U,DSPOp03
EXTSYM Op13X,Op13Y,Op13Z,Op13F,Op13L,Op13U,DSPOp13
EXTSYM Op23X,Op23Y,Op23Z,Op23F,Op23L,Op23U,DSPOp23
EXTSYM Op14Zr,Op14Xr,Op14Yr,Op14U,Op14F,Op14L
EXTSYM Op14Zrr,Op14Xrr,Op14Yrr,DSPOp14
EXTSYM Op0BX,Op0BY,Op0BZ,Op0BS,DSPOp0B
EXTSYM Op1BX,Op1BY,Op1BZ,Op1BS,DSPOp1B
EXTSYM Op2BX,Op2BY,Op2BZ,Op2BS,DSPOp2B
EXTSYM Op08X,Op08Y,Op08Z,Op08Ll,Op08Lh,DSPOp08
EXTSYM Op18X,Op18Y,Op18Z,Op18R,Op18D,DSPOp18
EXTSYM Op1CX,Op1CY,Op1CZ,Op1CXBR,Op1CYBR,Op1CZBR,Op1CXAR,Op1CYAR,Op1CZAR,DSPOp1C
EXTSYM Op10Exponent,Op10ExponentR,Op10Coefficient,Op10CoefficientR
SECTION .bss
NEWSYM dsp1ptr, resd 1
NEWSYM dsp1array, resb 4096
SECTION .text
;*******************************************************
; DSP1 Read Functions
;*******************************************************
NEWSYM DSP1Read8b3F
test ecx,8000h
jnz .dsp1area
cmp bl,0E0h
je .dsp1area
jmp regaccessbankr8
.dsp1area
mov al,80h
ret
NEWSYM DSP1Read16b3F
test ecx,8000h
jnz .dsp1area
cmp bl,0E0h
je .dsp1area
jmp regaccessbankr16
.dsp1area
or ecx,08000h
cmp ecx,0C000h
jae .doC000
cmp byte[DSP1RLeft],0
jne .movestuff
xor ax,ax
ret
.doC000
mov ax,08000h
cmp byte[DSP1WLeft],0
je .notwleft
mov ax,0C000h
.notwleft
ret
.movestuff
push ebx
xor ebx,ebx
mov bl,[DSP1CPtrR]
mov ax,[DSP1RET+ebx*2]
pop ebx
inc byte[DSP1CPtrR]
dec byte[DSP1RLeft]
jz .nomore
.goback
ret
.nomore
cmp byte[DSP1COp],0Ah
jne .goback
push eax
pushad
call DSPOp0A
popad
mov ax,[Op0AA]
mov [DSP1RET],ax
mov ax,[Op0AB]
mov [DSP1RET+2],ax
mov ax,[Op0AC]
mov [DSP1RET+4],ax
mov ax,[Op0AD]
mov [DSP1RET+6],ax
mov byte[DSP1RLeft],4
mov byte[DSP1CPtrR],0
pop eax
ret
NEWSYM DSP1Read8b
; mov byte[debstop],1
cmp ecx,7000h
jae .do7000
xor al,al
ret
.do7000
mov al,80h
test ecx,1
jz .no1
mov al,80h
.no1
ret
NEWSYM DSP1Read16b
; mov byte[debstop],1
cmp ecx,7000h
jae .do7000
cmp byte[DSP1RLeft],0
jne .movestuff
xor ax,ax
ret
.do7000
mov ax,8000h
cmp byte[DSP1WLeft],0
je .notwleft
mov ax,0C000h
.notwleft
; test ecx,01h
; jz .norev
; mov ax,0080h
;.norev
ret
.movestuff
push ebx
xor ebx,ebx
mov bl,[DSP1CPtrR]
mov ax,[DSP1RET+ebx*2]
pop ebx
inc byte[DSP1CPtrR]
dec byte[DSP1RLeft]
jz .nomore
.goback
ret
.nomore
cmp byte[DSP1COp],0Ah
jne .goback
push eax
pushad
call DSPOp0A
popad
mov ax,[Op0AA]
mov [DSP1RET],ax
mov ax,[Op0AB]
mov [DSP1RET+2],ax
mov ax,[Op0AC]
mov [DSP1RET+4],ax
mov ax,[Op0AD]
mov [DSP1RET+6],ax
mov byte[DSP1RLeft],4
mov byte[DSP1CPtrR],0
pop eax
ret
%macro DSP1WriteInit 2
cmp al,%1
jne %%no
mov byte[DSP1WLeft],%2
%%no
%endmacro
NEWSYM DSP1Write8b3F
test ecx,8000h
jnz .dsp1area
cmp bl,0E0h
je .dsp1area
jmp regaccessbankw8
.dsp1area
call DSP1Write8b
ret
NEWSYM DSP1Write16b3F
test ecx,8000h
jnz .dsp1area
cmp bl,0E0h
je .dsp1area
jmp regaccessbankw16
.dsp1area
call DSP1Write16b
ret
NEWSYM DSP1Write8b
push ebx
xor ebx,ebx
mov bl,al
mov byte[DSPFuncUsed+ebx],1
pop ebx
mov [DSP1COp],al
mov byte[DSP1CPtrW],0
DSP1WriteInit 00h, 2 ; 16-bit multiply
DSP1WriteInit 10h, 2 ; Inverse
DSP1WriteInit 04h, 2 ; Trigonometric
DSP1WriteInit 08h, 3 ; Vector Size
DSP1WriteInit 18h, 4 ; Vector Size Comparison
DSP1WriteInit 28h, 3 ; Vector Absolute Value
DSP1WriteInit 0Ch, 3 ; Coordinate Rotation
DSP1WriteInit 1Ch, 6 ; 3D Coordinate Rotation
DSP1WriteInit 02h, 7 ; Vector Size
DSP1WriteInit 0Ah, 1 ; Raster Data Calculation via DMA
DSP1WriteInit 1Ah, 1 ; Raster Data Calculation w/o DMA
DSP1WriteInit 06h, 3 ; Object Projection Calculation
DSP1WriteInit 0Eh, 2 ; Coordinate Calculation of a point onscreen
DSP1WriteInit 01h, 4 ; Set Attitude Matrix A
DSP1WriteInit 11h, 4 ; Set Attitude Matrix B
DSP1WriteInit 21h, 4 ; Set Attitude Matrix C
DSP1WriteInit 0Dh, 3 ; Convert from global to object coords Matrix A
DSP1WriteInit 1Dh, 3 ; Convert from global to object coords Matrix B
DSP1WriteInit 2Dh, 3 ; Convert from global to object coords Matrix C
DSP1WriteInit 03h, 3 ; Convert from object to global coords Matrix A
DSP1WriteInit 13h, 3 ; Convert from object to global coords Matrix B
DSP1WriteInit 23h, 3 ; Convert from object to global coords Matrix C
DSP1WriteInit 0Bh, 3 ; Calculation of inner product Matrix A
DSP1WriteInit 1Bh, 3 ; Calculation of inner product Matrix B
DSP1WriteInit 2Bh, 3 ; Calculation of inner product Matrix C
DSP1WriteInit 14h, 6 ; 3D angle rotation
DSP1WriteInit 0Fh, 1 ; DSP RAM Check
ret
%macro DSP1WriteProc 2
cmp byte[DSP1COp],%1
jne %%no
pushad
call %2
popad
%%no
%endmacro
NEWSYM DSP1Write16b
; mov byte[debstop],1
cmp byte[DSP1WLeft],0
jne .yesleft
ret
.yesleft
push ebx
xor ebx,ebx
mov bl,[DSP1CPtrW]
mov [DSP1VARS+ebx*2],ax
pop ebx
inc byte[DSP1CPtrW]
dec byte[DSP1WLeft]
jz .ProcessDSP1
ret
.ProcessDSP1
mov byte[DSP1CPtrR],0
mov byte[DSP1RLeft],0
DSP1WriteProc 00h, DSP1_00 ; 16-bit multiply
DSP1WriteProc 10h, DSP1_10 ; Inverse
DSP1WriteProc 04h, DSP1_04 ; Trigonometric
DSP1WriteProc 08h, DSP1_08 ; Vector Size
DSP1WriteProc 18h, DSP1_18 ; Vector Size Comparison
DSP1WriteProc 28h, DSP1_28 ; Vector Absolute Value
DSP1WriteProc 0Ch, DSP1_0C ; Coordinate Rotation
DSP1WriteProc 1Ch, DSP1_1C ; 3D Coordinate Rotation
DSP1WriteProc 02h, DSP1_02 ; Vector Size
DSP1WriteProc 0Ah, DSP1_0A ; Raster Data Calculation via DMA
DSP1WriteProc 1Ah, DSP1_0A ; Raster Data Calculation w/o DMA
DSP1WriteProc 06h, DSP1_06 ; Object Projection Calculation
DSP1WriteProc 0Eh, DSP1_0E ; Coordinate Calculation of a point onscreen
DSP1WriteProc 01h, DSP1_01 ; Set Attitude Matrix A
DSP1WriteProc 11h, DSP1_11 ; Set Attitude Matrix B
DSP1WriteProc 21h, DSP1_21 ; Set Attitude Matrix C
DSP1WriteProc 0Dh, DSP1_0D ; Convert from global to object coords Matrix A
DSP1WriteProc 1Dh, DSP1_1D ; Convert from global to object coords Matrix B
DSP1WriteProc 2Dh, DSP1_2D ; Convert from global to object coords Matrix C
DSP1WriteProc 03h, DSP1_03 ; Convert from object to global coords Matrix A
DSP1WriteProc 13h, DSP1_13 ; Convert from object to global coords Matrix B
DSP1WriteProc 23h, DSP1_23 ; Convert from object to global coords Matrix C
DSP1WriteProc 0Bh, DSP1_0B ; Calculation of inner product Matrix A
DSP1WriteProc 1Bh, DSP1_1B ; Calculation of inner product Matrix B
DSP1WriteProc 2Bh, DSP1_2B ; Calculation of inner product Matrix C
DSP1WriteProc 14h, DSP1_14 ; 3D angle rotation
DSP1WriteProc 0Fh, DSP1_0F ; DSP RAM Check
ret
SECTION .bss
NEWSYM DSP1COp, resb 1
NEWSYM DSP1RLeft, resb 1
NEWSYM DSP1WLeft, resb 1
NEWSYM DSP1CPtrW, resb 1
NEWSYM DSP1CPtrR, resb 1
NEWSYM DSP1VARS, resw 16
NEWSYM DSP1RET, resw 16
NEWSYM DSPDet, resb 1
NEWSYM DSPFuncUsed, resb 256
SECTION .text
;*******************************************************
; DSP1 Conversion Functions
;*******************************************************
DSP1_00: ; 16-bit multiply
or byte[DSPDet],01h
push eax
mov ax,[DSP1VARS]
mov [Op00Multiplicand],ax
mov ax,[DSP1VARS+2]
mov [Op00Multiplier],ax
pushad
call DSPOp00
popad
mov ax,[Op00Result]
mov [DSP1RET],ax
mov byte[DSP1RLeft],1
pop eax
ret
DSP1_10: ; Inverse
push eax
mov ax,[DSP1VARS]
mov [Op10Coefficient],ax
mov ax,[DSP1VARS+2]
mov [Op10Exponent],ax
pushad
call DSPOp10
popad
mov ax,[Op10CoefficientR]
mov [DSP1RET],ax
mov ax,[Op10ExponentR]
mov [DSP1RET+2],ax
mov byte[DSP1RLeft],2
pop eax
ret
DSP1_04: ; Trigonometric
or byte[DSPDet],02h
push eax
mov ax,[DSP1VARS]
mov [Op04Angle],ax
mov ax,[DSP1VARS+2]
mov [Op04Radius],ax
pushad
call DSPOp04
popad
mov ax,[Op04Sin]
mov [DSP1RET],ax
mov ax,[Op04Cos]
mov [DSP1RET+2],ax
mov byte[DSP1RLeft],2
pop eax
ret
DSP1_08: ; Vector Size
push eax
mov ax,[DSP1VARS]
mov [Op08X],ax
mov ax,[DSP1VARS+2]
mov [Op08Y],ax
mov ax,[DSP1VARS+4]
mov [Op08Z],ax
pushad
call DSPOp08
popad
mov ax,[Op08Ll]
mov [DSP1RET],ax
mov ax,[Op08Lh]
mov [DSP1RET+2],ax
mov byte[DSP1RLeft],2
pop eax
ret
DSP1_18: ; Vector Size Comparison
push eax
mov ax,[DSP1VARS]
mov [Op18X],ax
mov ax,[DSP1VARS+2]
mov [Op18Y],ax
mov ax,[DSP1VARS+4]
mov [Op18Z],ax
mov ax,[DSP1VARS+6]
mov [Op18R],ax
pushad
call DSPOp18
popad
mov ax,[Op18D]
mov [DSP1RET],ax
mov byte[DSP1RLeft],1
pop eax
ret
DSP1_28: ; Vector Absolute Value
or byte[DSPDet],04h
push eax
mov ax,[DSP1VARS]
mov [Op28X],ax
mov ax,[DSP1VARS+2]
mov [Op28Y],ax
mov ax,[DSP1VARS+4]
mov [Op28Z],ax
pushad
call DSPOp28
popad
mov ax,[Op28R]
mov [DSP1RET],ax
mov byte[DSP1RLeft],1
pop eax
ret
DSP1_0C: ; Coordinate Rotation
or byte[DSPDet],08h
push eax
mov ax,[DSP1VARS]
mov [Op0CA],ax
mov ax,[DSP1VARS+2]
mov [Op0CX1],ax
mov ax,[DSP1VARS+4]
mov [Op0CY1],ax
pushad
call DSPOp0C
popad
mov ax,[Op0CX2]
mov [DSP1RET],ax
mov ax,[Op0CY2]
mov [DSP1RET+2],ax
mov byte[DSP1RLeft],2
pop eax
ret
DSP1_1C: ; 3D Coordinate Rotation
push eax
mov ax,[DSP1VARS]
mov [Op1CZ],ax
mov ax,[DSP1VARS+2]
mov [Op1CY],ax
mov ax,[DSP1VARS+4]
mov [Op1CX],ax
mov ax,[DSP1VARS+6]
mov [Op1CXBR],ax
mov ax,[DSP1VARS+8]
mov [Op1CYBR],ax
mov ax,[DSP1VARS+10]
mov [Op1CZBR],ax
pushad
call DSPOp1C
popad
mov ax,[Op1CXAR]
mov [DSP1RET],ax
mov ax,[Op1CYAR]
mov [DSP1RET+2],ax
mov ax,[Op1CZAR]
mov [DSP1RET+4],ax
mov byte[DSP1RLeft],3
pop eax
ret
DSP1_02: ; Vector Size
or byte[DSPDet],10h
push eax
mov ax,[DSP1VARS]
mov [Op02FX],ax
mov ax,[DSP1VARS+2]
mov [Op02FY],ax
mov ax,[DSP1VARS+4]
mov [Op02FZ],ax
mov ax,[DSP1VARS+6]
mov [Op02LFE],ax
mov ax,[DSP1VARS+8]
mov [Op02LES],ax
mov ax,[DSP1VARS+10]
mov [Op02AAS],ax
mov ax,[DSP1VARS+12]
mov [Op02AZS],ax
pushad
call DSPOp02
popad
mov ax,[Op02VOF]
mov [DSP1RET],ax
mov ax,[Op02VVA]
mov [DSP1RET+2],ax
mov ax,[Op02CX]
mov [DSP1RET+4],ax
mov ax,[Op02CY]
mov [DSP1RET+6],ax
mov byte[DSP1RLeft],4
pop eax
ret
mov eax,dsp1array
add eax,[dsp1ptr]
push ebx
mov byte[eax],02h
mov bx,[Op02FX]
mov [eax+1],bx
mov bx,[Op02FY]
mov [eax+3],bx
mov bx,[Op02FZ]
mov [eax+5],bx
mov bx,[Op02LFE]
mov [eax+7],bx
mov bx,[Op02LES]
mov [eax+9],bx
mov bx,[Op02AAS]
mov [eax+11],bx
mov bx,[Op02AZS]
mov [eax+13],bx
mov bx,[Op02VOF]
mov [eax+15],bx
mov bx,[Op02VVA]
mov [eax+17],bx
mov bx,[Op02CX]
mov [eax+19],bx
mov bx,[Op02CY]
mov [eax+21],bx
pop ebx
add dword[dsp1ptr],23
DSP1_0A: ; Raster Data Calculation via DMA
mov byte[DSP1COp],0Ah
or byte[DSPDet],20h
push eax
mov ax,[DSP1VARS]
mov [Op0AVS],ax
pushad
call DSPOp0A
popad
mov ax,[Op0AA]
mov [DSP1RET],ax
mov ax,[Op0AB]
mov [DSP1RET+2],ax
mov ax,[Op0AC]
mov [DSP1RET+4],ax
mov ax,[Op0AD]
mov [DSP1RET+6],ax
mov byte[DSP1RLeft],4
pop eax
ret
DSP1_06: ; Object Projection Calculation
or byte[DSPDet],40h
push eax
mov ax,[DSP1VARS]
mov [Op06X],ax
mov ax,[DSP1VARS+2]
mov [Op06Y],ax
mov ax,[DSP1VARS+4]
mov [Op06Z],ax
pushad
call DSPOp06
popad
mov ax,[Op06H]
mov [DSP1RET],ax
mov ax,[Op06V]
mov [DSP1RET+2],ax
mov ax,[Op06M]
mov [DSP1RET+4],ax
mov byte[DSP1RLeft],3
pop eax
ret
mov eax,dsp1array
add eax,[dsp1ptr]
push ebx
mov byte[eax],06h
mov bx,[Op06X]
mov [eax+1],bx
mov bx,[Op06Y]
mov [eax+3],bx
mov bx,[Op06Z]
mov [eax+5],bx
mov bx,[Op06H]
mov [eax+7],bx
mov bx,[Op06V]
mov [eax+9],bx
mov bx,[Op06M]
mov [eax+11],bx
pop ebx
add dword[dsp1ptr],13
DSP1_0E: ; Coordinate Calculation of a point onscreen
push eax
mov ax,[DSP1VARS]
mov [Op0EH],ax
mov ax,[DSP1VARS+2]
mov [Op0EV],ax
pushad
call DSPOp0E
popad
mov ax,[Op0EX]
mov [DSP1RET],ax
mov ax,[Op0EY]
mov [DSP1RET+2],ax
mov byte[DSP1RLeft],2
pop eax
ret
DSP1_01: ; Set Attitude Matrix A
push eax
mov ax,[DSP1VARS]
mov [Op01m],ax
mov ax,[DSP1VARS+2]
mov [Op01Zr],ax
mov ax,[DSP1VARS+4]
mov [Op01Yr],ax
mov ax,[DSP1VARS+6]
mov [Op01Xr],ax
pushad
call DSPOp01
popad
pop eax
ret
DSP1_11: ; Set Attitude Matrix B
push eax
mov ax,[DSP1VARS]
mov [Op11m],ax
mov ax,[DSP1VARS+2]
mov [Op11Zr],ax
mov ax,[DSP1VARS+4]
mov [Op11Yr],ax
mov ax,[DSP1VARS+6]
mov [Op11Xr],ax
pushad
call DSPOp11
popad
pop eax
ret
DSP1_21: ; Set Attitude Matrix C
push eax
mov ax,[DSP1VARS]
mov [Op21m],ax
mov ax,[DSP1VARS+2]
mov [Op21Zr],ax
mov ax,[DSP1VARS+4]
mov [Op21Yr],ax
mov ax,[DSP1VARS+6]
mov [Op21Xr],ax
pushad
call DSPOp21
popad
pop eax
ret
DSP1_0D: ; Convert from global to object coords Matrix A
push eax
mov ax,[DSP1VARS]
mov [Op0DX],ax
mov ax,[DSP1VARS+2]
mov [Op0DY],ax
mov ax,[DSP1VARS+4]
mov [Op0DZ],ax
pushad
call DSPOp0D
popad
mov ax,[Op0DF]
mov [DSP1RET],ax
mov ax,[Op0DL]
mov [DSP1RET+2],ax
mov ax,[Op0DU]
mov [DSP1RET+4],ax
mov byte[DSP1RLeft],3
pop eax
ret
DSP1_0F: ; DSP RAM Test
push eax
mov ax,[DSP1VARS]
pushad
call DSPOp0F
popad
mov ax,[Op0FPass]
mov [DSP1RET],ax
mov byte[DSP1RLeft],1
pop eax
ret
DSP1_1D: ; Convert from global to object coords Matrix B
push eax
mov ax,[DSP1VARS]
mov [Op1DX],ax
mov ax,[DSP1VARS+2]
mov [Op1DY],ax
mov ax,[DSP1VARS+4]
mov [Op1DZ],ax
pushad
call DSPOp1D
popad
mov ax,[Op1DF]
mov [DSP1RET],ax
mov ax,[Op1DL]
mov [DSP1RET+2],ax
mov ax,[Op1DU]
mov [DSP1RET+4],ax
mov byte[DSP1RLeft],3
pop eax
ret
DSP1_2D: ; Convert from global to object coords Matrix C
push eax
mov ax,[DSP1VARS]
mov [Op2DX],ax
mov ax,[DSP1VARS+2]
mov [Op2DY],ax
mov ax,[DSP1VARS+4]
mov [Op2DZ],ax
pushad
call DSPOp2D
popad
mov ax,[Op2DF]
mov [DSP1RET],ax
mov ax,[Op2DL]
mov [DSP1RET+2],ax
mov ax,[Op2DU]
mov [DSP1RET+4],ax
mov byte[DSP1RLeft],3
pop eax
ret
DSP1_03: ; Convert from object to global coords Matrix A
push eax
mov ax,[DSP1VARS]
mov [Op03F],ax
mov ax,[DSP1VARS+2]
mov [Op03L],ax
mov ax,[DSP1VARS+4]
mov [Op03U],ax
pushad
call DSPOp03
popad
mov ax,[Op03X]
mov [DSP1RET],ax
mov ax,[Op03Y]
mov [DSP1RET+2],ax
mov ax,[Op03Z]
mov [DSP1RET+4],ax
mov byte[DSP1RLeft],3
pop eax
ret
DSP1_13: ; Convert from object to global coords Matrix B
push eax
mov ax,[DSP1VARS]
mov [Op13F],ax
mov ax,[DSP1VARS+2]
mov [Op13L],ax
mov ax,[DSP1VARS+4]
mov [Op13U],ax
pushad
call DSPOp13
popad
mov ax,[Op13X]
mov [DSP1RET],ax
mov ax,[Op13Y]
mov [DSP1RET+2],ax
mov ax,[Op13Z]
mov [DSP1RET+4],ax
mov byte[DSP1RLeft],3
pop eax
ret
DSP1_23: ; Convert from object to global coords Matrix C
push eax
mov ax,[DSP1VARS]
mov [Op23F],ax
mov ax,[DSP1VARS+2]
mov [Op23L],ax
mov ax,[DSP1VARS+4]
mov [Op23U],ax
pushad
call DSPOp23
popad
mov ax,[Op23X]
mov [DSP1RET],ax
mov ax,[Op23Y]
mov [DSP1RET+2],ax
mov ax,[Op23Z]
mov [DSP1RET+4],ax
mov byte[DSP1RLeft],3
pop eax
ret
DSP1_0B: ; Calculation of inner product Matrix A
push eax
mov ax,[DSP1VARS]
mov [Op0BX],ax
mov ax,[DSP1VARS+2]
mov [Op0BY],ax
mov ax,[DSP1VARS+4]
mov [Op0BZ],ax
pushad
call DSPOp0B
popad
mov ax,[Op0BS]
mov [DSP1RET],ax
mov byte[DSP1RLeft],1
pop eax
ret
DSP1_1B: ; Calculation of inner product Matrix B
push eax
mov ax,[DSP1VARS]
mov [Op1BX],ax
mov ax,[DSP1VARS+2]
mov [Op1BY],ax
mov ax,[DSP1VARS+4]
mov [Op1BZ],ax
pushad
call DSPOp1B
popad
mov ax,[Op1BS]
mov [DSP1RET],ax
mov byte[DSP1RLeft],1
pop eax
ret
DSP1_2B: ; Calculation of inner product Matrix C
push eax
mov ax,[DSP1VARS]
mov [Op2BX],ax
mov ax,[DSP1VARS+2]
mov [Op2BY],ax
mov ax,[DSP1VARS+4]
mov [Op2BZ],ax
pushad
call DSPOp2B
popad
mov ax,[Op2BS]
mov [DSP1RET],ax
mov byte[DSP1RLeft],1
pop eax
ret
DSP1_14: ; 3D angle rotation
push eax
mov ax,[DSP1VARS]
mov [Op14Zr],ax
mov ax,[DSP1VARS+2]
mov [Op14Xr],ax
mov ax,[DSP1VARS+4]
mov [Op14Yr],ax
mov ax,[DSP1VARS+6]
mov [Op14U],ax
mov ax,[DSP1VARS+8]
mov [Op14F],ax
mov ax,[DSP1VARS+10]
mov [Op14L],ax
pushad
call DSPOp14
popad
mov ax,[Op14Zrr]
mov [DSP1RET],ax
mov ax,[Op14Xrr]
mov [DSP1RET+2],ax
mov ax,[Op14Yrr]
mov [DSP1RET+4],ax
mov byte[DSP1RLeft],3
pop eax
ret

View File

@@ -0,0 +1,608 @@
;Copyright (C) 1997-2007 ZSNES Team ( zsKnight, _Demo_, pagefault, Nach )
;
;http://www.zsnes.com
;http://sourceforge.net/projects/zsnes
;https://zsnes.bountysource.com
;
;This program is free software; you can redistribute it and/or
;modify it under the terms of the GNU General Public License
;version 2 as published by the Free Software Foundation.
;
;This program is distributed in the hope that it will be useful,
;but WITHOUT ANY WARRANTY; without even the implied warranty of
;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;GNU General Public License for more details.
;
;You should have received a copy of the GNU General Public License
;along with this program; if not, write to the Free Software
;Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
; Apr 29, 2004
; DSP2 support code written by kentaro-k.21 <danmasu-lj@infoseek.jp>
; coding hints are based on DSP2 function overview at http://users.tpg.com.au/trauma/dsp/dsp2.html maintained by Overload.
; i have stolen the useful technical info there to implement DSP2 codes without any permission from its author.
; i do NOT know and peep the s9x source codes for either DSP2 or any purpose.
; May 02, 2004
; bug fix for Dungeon Master.
; Command 05h fixed.
; when you got the magic missile damage such as fireball, DSP2 support in prior version entered halt state.
%include "macros.mac"
DSP2F_HALT equ 1
DSP2F_AUTO_BUFFER_SHIFT equ 2
DSP2F_NO_ADDR_CHK equ 4
;*******************************************************
; .bss section
;*******************************************************
SECTION .bss
NEWSYM dsp2buffer, resb 256
NEWSYM dsp2enforcerQueue, resb 8*512
NEWSYM dsp2enforcer, resb 8
;*******************************************************
; .data section
;*******************************************************
SECTION .data
NEWSYM dsp2f03KeyLo, db 0 ; Current transparent-color in lower-byte
NEWSYM dsp2f03KeyHi, db 0 ; Current transparent-color in higher-byte
NEWSYM dsp2enforcerReaderCursor, dd 0 ; T/O
NEWSYM dsp2enforcerWriterCursor, dd 1 ; T/O
NEWSYM dsp2state, dd 1 ; Flags: 1=HALT, 2=AUTO_BUFFER_SHIFT, 4=NO_ADDR_CHK
NEWSYM dsp2input, dd 0 ; Saving input 8-bit data
NEWSYM dsp2inputTemp, dd 0 ; Temporary variable
NEWSYM dsp2f0dSizeOrg, dd 0 ; Command 0D, Original BMP width
NEWSYM dsp2f0dSizeNew, dd 0 ; Command 0D, New BMP width
NEWSYM dsp2f01TblByte ; Conversion table for Command 01
db 0, 1,16,17, 0, 1,16,17
db 0, 1,16,17, 0, 1,16,17
db 0, 1,16,17, 0, 1,16,17
db 0, 1,16,17, 0, 1,16,17
db 2, 3,18,19, 2, 3,18,19
db 2, 3,18,19, 2, 3,18,19
db 2, 3,18,19, 2, 3,18,19
db 2, 3,18,19, 2, 3,18,19
db 4, 5,20,21, 4, 5,20,21
db 4, 5,20,21, 4, 5,20,21
db 4, 5,20,21, 4, 5,20,21
db 4, 5,20,21, 4, 5,20,21
db 6, 7,22,23, 6, 7,22,23
db 6, 7,22,23, 6, 7,22,23
db 6, 7,22,23, 6, 7,22,23
db 6, 7,22,23, 6, 7,22,23
db 8, 9,24,25, 8, 9,24,25
db 8, 9,24,25, 8, 9,24,25
db 8, 9,24,25, 8, 9,24,25
db 8, 9,24,25, 8, 9,24,25
db 10,11,26,27,10,11,26,27
db 10,11,26,27,10,11,26,27
db 10,11,26,27,10,11,26,27
db 10,11,26,27,10,11,26,27
db 12,13,28,29,12,13,28,29
db 12,13,28,29,12,13,28,29
db 12,13,28,29,12,13,28,29
db 12,13,28,29,12,13,28,29
db 14,15,30,31,14,15,30,31
db 14,15,30,31,14,15,30,31
db 14,15,30,31,14,15,30,31
db 14,15,30,31,14,15,30,31
NEWSYM dsp2f01TblBitMask ; Conversion table for Command 01
db 64, 64, 64, 64,128,128,128,128
db 16, 16, 16, 16, 32, 32, 32, 32
db 4, 4, 4, 4, 8, 8, 8, 8
db 1, 1, 1, 1, 2, 2, 2, 2
db 64, 64, 64, 64,128,128,128,128
db 16, 16, 16, 16, 32, 32, 32, 32
db 4, 4, 4, 4, 8, 8, 8, 8
db 1, 1, 1, 1, 2, 2, 2, 2
db 64, 64, 64, 64,128,128,128,128
db 16, 16, 16, 16, 32, 32, 32, 32
db 4, 4, 4, 4, 8, 8, 8, 8
db 1, 1, 1, 1, 2, 2, 2, 2
db 64, 64, 64, 64,128,128,128,128
db 16, 16, 16, 16, 32, 32, 32, 32
db 4, 4, 4, 4, 8, 8, 8, 8
db 1, 1, 1, 1, 2, 2, 2, 2
db 64, 64, 64, 64,128,128,128,128
db 16, 16, 16, 16, 32, 32, 32, 32
db 4, 4, 4, 4, 8, 8, 8, 8
db 1, 1, 1, 1, 2, 2, 2, 2
db 64, 64, 64, 64,128,128,128,128
db 16, 16, 16, 16, 32, 32, 32, 32
db 4, 4, 4, 4, 8, 8, 8, 8
db 1, 1, 1, 1, 2, 2, 2, 2
db 64, 64, 64, 64,128,128,128,128
db 16, 16, 16, 16, 32, 32, 32, 32
db 4, 4, 4, 4, 8, 8, 8, 8
db 1, 1, 1, 1, 2, 2, 2, 2
db 64, 64, 64, 64,128,128,128,128
db 16, 16, 16, 16, 32, 32, 32, 32
db 4, 4, 4, 4, 8, 8, 8, 8
db 1, 1, 1, 1, 2, 2, 2, 2
;*******************************************************
; .text section
;*******************************************************
SECTION .text
;*******************************************************
;
;*******************************************************
%macro CommandJmp 2
cmp al,%1
je near %2
%endmacro
%macro DevWriteX 1
%ifdef _USE_DEV
pushad
mov dword[_DSP2Dev_arg],%1
call _DevWriteX
popad
%endif
%endmacro
%macro EnterInsideCommand 1
DevWriteX %1
%endmacro
%macro QueueInsideCommand 1
DevWriteX %1+0ffff0000h
%endmacro
%macro LeaveInsideCommand 0
%ifdef _USE_DEV
pushad
call _Leave
popad
%endif
%endmacro
;*******************************************************
;
;*******************************************************
NEWSYM InitDSP2
.enter
mov dword[dsp2state],0
mov dword[dsp2enforcerQueue+8*0+0],0
mov dword[dsp2enforcerQueue+8*0+4],8000h
mov dword[dsp2enforcerReaderCursor],0
mov dword[dsp2enforcerWriterCursor],1
.leave
ret
;*******************************************************
;
;*******************************************************
NEWSYM DSP2Read8b
.enter
test byte[dsp2state],DSP2F_HALT
jnz .halt
test cx,8000h
jz .undef
test cx,7000h
jnz .undef
and ecx,255
mov al,[dsp2buffer+ecx]
xor ecx,ecx
test byte[dsp2state],DSP2F_AUTO_BUFFER_SHIFT
jnz .shiftbuffer
jmp .leave
.shiftbuffer
sar dword[dsp2buffer],8
jmp .leave
.halt
.undef
xor eax,eax
.leave
ret
NEWSYM DSP2Read16b
.enter
xor eax,eax
.leave
ret
;*******************************************************
;
;*******************************************************
NEWSYM _DSP2Add2Queue
.enter
push eax
push ebx
; *** Locates the write cursor
mov eax,[dsp2enforcerWriterCursor]
lea ebx,[dsp2enforcerQueue+eax*8]
inc eax
and eax,511
mov [dsp2enforcerWriterCursor],eax
; *** Copies the local inside command into his queue
mov eax,[dsp2enforcer]
mov [ebx],eax
mov eax,[dsp2enforcer+4]
mov [ebx+4],eax
pop ebx
pop eax
.leave
ret
NEWSYM DSP2Write8b
.enter
; Tests halt flag
test byte[dsp2state],DSP2F_HALT
jnz near .halt
; *** Locates current predicator store
mov [dsp2input],al
mov eax,[dsp2enforcerReaderCursor]
lea ebx,[dsp2enforcerQueue+8*eax]
; *** Copies inside command box into box in order to spare indirection cost
mov eax,[ebx]
mov [dsp2enforcer],eax
mov eax,[ebx+4]
mov [dsp2enforcer+4],eax
xor ebx,ebx
; *** About some commands need to be relaxed the write address check
test byte[dsp2state],DSP2F_NO_ADDR_CHK
jnz .noaddrchk
; *** Tests whether cx points expected address
cmp [dsp2enforcer+4],cx
jne near .gohalt
.noaddrchk
; *** Reads next inside command should be proceeded
mov al,[dsp2enforcer]
; *** Branches to inside commands respectively
CommandJmp 00h,.w00
CommandJmp 01h,.w01
CommandJmp 02h,.w02
CommandJmp 03h,.w03
CommandJmp 04h,.w04
CommandJmp 05h,.w05
CommandJmp 06h,.w06
CommandJmp 07h,.w07
CommandJmp 08h,.w08
CommandJmp 09h,.w09
CommandJmp 0Ah,.w0A
CommandJmp 0Bh,.w0B
jmp .gohalt
.w0B ; ---
EnterInsideCommand 0Bh
mov al,[dsp2input]
xor ecx,ecx
mov cl,[dsp2enforcer+1]
mov [dsp2buffer+ecx],al
jmp .done
.w0A ; ---
EnterInsideCommand 0Ah
mov al,[dsp2input]
sar al,1
mov [dsp2f0dSizeNew],al
test al,al
jz near .gohalt
xor ecx,ecx
xor eax,eax
mov bl,[dsp2f0dSizeNew]
mov bh,[dsp2f0dSizeOrg]
.w0Aploop
mov al,cl
mul bl
div bh
mov dword[dsp2enforcer+0],0Bh
mov dword[dsp2enforcer+4],8000h
mov [dsp2enforcer+1],al
mov [dsp2enforcer+4],cl
call _DSP2Add2Queue
inc cl
cmp cl,[dsp2f0dSizeOrg]
jne .w0Aploop
xor ebx,ebx
jmp .queueincoming
.w09 ; ---
EnterInsideCommand 9
mov al,[dsp2input]
sar al,1
mov [dsp2f0dSizeOrg],al
test al,al
jz near .gohalt
mov dword[dsp2enforcer+0],0Ah
mov dword[dsp2enforcer+4],8000h
call _DSP2Add2Queue
jmp .done
.w08 ; ---
EnterInsideCommand 8
xor eax,eax
mov al,[dsp2enforcer+1]
mov cl,[dsp2input]
mov [dsp2buffer+eax],cl
cmp al,3
jne .w08done
mov al,[dsp2buffer]
mul byte[dsp2buffer+2]
mov [dsp2buffer],eax
or byte[dsp2state],DSP2F_AUTO_BUFFER_SHIFT
.w08done
jmp .done
.w07 ; ---
EnterInsideCommand 7
mov cl,[dsp2input]
rol cl,4
xor eax,eax
mov al,[dsp2enforcer+1]
mov [dsp2buffer+eax],cl
jmp .done
.w06 ; ---
EnterInsideCommand 6
cmp byte[dsp2input],0
je near .gohalt
xor eax,eax
xor ecx,ecx
mov cl,[dsp2input]
.w06ploop
dec cl
mov dword[dsp2enforcer+0],7
mov dword[dsp2enforcer+4],8000h
mov [dsp2enforcer+1],cl
mov [dsp2enforcer+4],al
call _DSP2Add2Queue
inc al
test cl,cl
jnz .w06ploop
jmp .queueincoming
.w05 ; ---
EnterInsideCommand 5
xor eax,eax
mov al,[dsp2enforcer+4]
mov cl,[dsp2buffer+eax]
mov ch,[dsp2input]
and ch,0f0h
cmp ch,[dsp2f03KeyHi]
je .w05pnohi
and cl,0fh
or cl,ch
.w05pnohi
mov ch,[dsp2input]
and ch,0fh
cmp ch,[dsp2f03KeyLo]
je .w05pnolo
and cl,0f0h
or cl,ch
.w05pnolo
mov [dsp2buffer+eax],cl
jmp .done
.w04 ; ---
EnterInsideCommand 4
xor eax,eax
mov al,[dsp2enforcer+4]
mov cl,[dsp2input]
mov [dsp2buffer+eax],cl
xor ecx,ecx
jmp .done
.w03 ; ---
EnterInsideCommand 3
cmp byte[dsp2input],0
je near .gohalt
xor eax,eax
.w03aloop
mov dword[dsp2enforcer+0],4
mov dword[dsp2enforcer+4],8000h
mov [dsp2enforcer+4],al
call _DSP2Add2Queue
inc al
cmp al,[dsp2input]
jne .w03aloop
xor eax,eax
.w03bloop
mov dword[dsp2enforcer+0],5
mov dword[dsp2enforcer+4],8000h
mov [dsp2enforcer+4],al
call _DSP2Add2Queue
inc al
cmp al,[dsp2input]
jne .w03bloop
xor ecx,ecx
jmp .queueincoming
.w02 ; ---
EnterInsideCommand 2
mov al,[dsp2input]
and al,0fh
mov [dsp2f03KeyLo],al
sal al,4
mov [dsp2f03KeyHi],al
jmp .done
.w01 ; ---
EnterInsideCommand 1
xor ecx,ecx
mov cl,[dsp2enforcer+4]
sal ecx,3
mov al,[dsp2input]
mov [dsp2inputTemp],al
xor ebx,ebx
.w01ploop
mov bl,[dsp2f01TblByte+ecx]
mov al,[dsp2f01TblBitMask+ecx]
test byte[dsp2inputTemp],1h
jz .w01pclear
or [dsp2buffer+ebx],al
jmp .w01pok
.w01pclear
not al
and [dsp2buffer+ebx],al
.w01pok
sar byte[dsp2inputTemp],1
inc ecx
test cl,7
jnz .w01ploop
xor ebx,ebx
xor ecx,ecx
jmp .done
.w00 ; ---
EnterInsideCommand 0
and byte[dsp2state],~(DSP2F_AUTO_BUFFER_SHIFT|DSP2F_NO_ADDR_CHK)
mov al,[dsp2input]
CommandJmp 01h,.w00p01
CommandJmp 03h,.w00p03
CommandJmp 05h,.w00p05
CommandJmp 06h,.w00p06
CommandJmp 09h,.w00p09
CommandJmp 0Dh,.w00p0D
CommandJmp 0Fh,.w00p0F
jmp .gohalt
.w00p0D ; ----
QueueInsideCommand 0Dh
mov dword[dsp2enforcer+0],9
mov dword[dsp2enforcer+4],8000h
call _DSP2Add2Queue
jmp .done
.w00p09 ; ----
QueueInsideCommand 09h
xor eax,eax
mov al,4
.w00p09loop
mov dword[dsp2enforcer+0],8
mov dword[dsp2enforcer+4],8000h
mov [dsp2enforcer+1],ah
call _DSP2Add2Queue
inc ah
dec al
jnz .w00p09loop
jmp .queueincoming
.w00p06 ; ----
QueueInsideCommand 06h
mov dword[dsp2enforcer+0],6
mov dword[dsp2enforcer+4],8000h
call _DSP2Add2Queue
jmp .done
.w00p05 ; ----
or byte[dsp2state],DSP2F_NO_ADDR_CHK
QueueInsideCommand 05h
mov dword[dsp2enforcer+0],3
mov dword[dsp2enforcer+4],8000h
call _DSP2Add2Queue
jmp .done
.w00p03 ; ----
QueueInsideCommand 03h
mov dword[dsp2enforcer+0],2
mov dword[dsp2enforcer+4],8000h
call _DSP2Add2Queue
jmp .queueincoming
.w00p01 ; ----
QueueInsideCommand 01h
xor eax,eax
.w00p01loop
mov dword[dsp2enforcer+0],1
mov dword[dsp2enforcer+4],8000h
mov [dsp2enforcer+4],al
call _DSP2Add2Queue
inc al
cmp al,32
jne .w00p01loop
xor ecx,ecx
jmp .queueincoming
.w00p0F ; ----
QueueInsideCommand 0Fh
.queueincoming
mov dword[dsp2enforcer+0],0
mov dword[dsp2enforcer+4],8000h
call _DSP2Add2Queue
jmp .done
.done
LeaveInsideCommand
mov eax,[dsp2enforcerReaderCursor]
inc eax
and eax,511
mov [dsp2enforcerReaderCursor],eax
xor eax,eax
jmp .leave
.gohalt
QueueInsideCommand 0ffh
or byte[dsp2state],DSP2F_HALT
.halt
xor eax,eax
.leave
ret
NEWSYM DSP2Write16b
.enter
xor eax,eax
.leave
ret

1174
zsnes/src/chips/dsp3emu.c Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,79 @@
;Copyright (C) 1997-2007 ZSNES Team ( zsKnight, _Demo_, pagefault, Nach )
;
;http://www.zsnes.com
;http://sourceforge.net/projects/zsnes
;https://zsnes.bountysource.com
;
;This program is free software; you can redistribute it and/or
;modify it under the terms of the GNU General Public License
;version 2 as published by the Free Software Foundation.
;
;This program is distributed in the hope that it will be useful,
;but WITHOUT ANY WARRANTY; without even the implied warranty of
;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;GNU General Public License for more details.
;
;You should have received a copy of the GNU General Public License
;along with this program; if not, write to the Free Software
;Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
%include "macros.mac"
EXTSYM dsp3_address,dsp3_byte,DSP3GetByte,DSP3SetByte
EXTSYM regaccessbankr16,regaccessbankr8,regaccessbankw16,regaccessbankw8
SECTION .text
%macro RouteAccess 1
test ecx,8000h
jz %1
%endmacro
NEWSYM DSP3Read8b
RouteAccess regaccessbankr8
mov [dsp3_address],cx
pushad
call DSP3GetByte
popad
mov al,[dsp3_byte]
ret
NEWSYM DSP3Write8b
RouteAccess regaccessbankw8
mov [dsp3_address],cx
mov [dsp3_byte],al
pushad
call DSP3SetByte
popad
ret
NEWSYM DSP3Read16b
RouteAccess regaccessbankr16
mov [dsp3_address],cx
pushad
call DSP3GetByte
mov al,[dsp3_byte]
mov [dsp3temp],al
inc word[dsp3_address]
call DSP3GetByte
popad
mov al,[dsp3temp]
mov ah,[dsp3_byte]
ret
NEWSYM DSP3Write16b
RouteAccess regaccessbankw16
mov [dsp3_address],cx
mov [dsp3_byte],al
mov [dsp3temp],ah
pushad
call DSP3SetByte
mov ah,[dsp3temp]
mov [dsp3_byte],ah
inc word[dsp3_address]
call DSP3SetByte
popad
ret
SECTION .bss
NEWSYM dsp3temp, resb 1

2172
zsnes/src/chips/dsp4emu.c Normal file

File diff suppressed because it is too large Load Diff

111
zsnes/src/chips/dsp4emu.h Normal file
View File

@@ -0,0 +1,111 @@
#ifndef DSP4EMU_H
#define DSP4EMU_H
typedef unsigned char bool8;
typedef unsigned char uint8;
typedef unsigned short uint16;
typedef unsigned int uint32;
typedef char int8;
typedef short int16;
typedef long int32;
#define FALSE 0
#define TRUE 1
struct DSP4_t
{
bool8 waiting4command;
bool8 half_command;
uint16 command;
uint32 in_count;
uint32 in_index;
uint32 out_count;
uint32 out_index;
uint8 parameters[512];
uint8 output[512];
};
extern struct DSP4_t DSP4;
struct DSP4_vars_t
{
// op control
int8 DSP4_Logic; // controls op flow
// projection format
int16 lcv; // loop-control variable
int16 distance; // z-position into virtual world
int16 raster; // current raster line
int16 segments; // number of raster lines drawn
// 1.15.16 or 1.15.0 [sign, integer, fraction]
int32 world_x; // line of x-projection in world
int32 world_y; // line of y-projection in world
int32 world_dx; // projection line x-delta
int32 world_dy; // projection line y-delta
int16 world_ddx; // x-delta increment
int16 world_ddy; // y-delta increment
int32 world_xenv; // world x-shaping factor
int16 world_yofs; // world y-vertical scroll
int16 view_x1; // current viewer-x
int16 view_y1; // current viewer-y
int16 view_x2; // future viewer-x
int16 view_y2; // future viewer-y
int16 view_dx; // view x-delta factor
int16 view_dy; // view y-delta factor
int16 view_xofs1; // current viewer x-vertical scroll
int16 view_yofs1; // current viewer y-vertical scroll
int16 view_xofs2; // future viewer x-vertical scroll
int16 view_yofs2; // future viewer y-vertical scroll
int16 view_yofsenv; // y-scroll shaping factor
int16 view_turnoff_x; // road turnoff data
int16 view_turnoff_dx; // road turnoff delta factor
// drawing area
int16 viewport_cx; // x-center of viewport window
int16 viewport_cy; // y-center of render window
int16 viewport_left; // x-left of viewport
int16 viewport_right; // x-right of viewport
int16 viewport_top; // y-top of viewport
int16 viewport_bottom; // y-bottom of viewport
// sprite structure
int16 sprite_x; // projected x-pos of sprite
int16 sprite_y; // projected y-pos of sprite
int16 sprite_attr; // obj attributes
bool8 sprite_size; // sprite size: 8x8 or 16x16
int16 sprite_clipy; // visible line to clip pixels off
int16 sprite_count;
// generic projection variables designed for
// two solid polygons + two polygon sides
int16 poly_clipLf[2][2]; // left clip boundary
int16 poly_clipRt[2][2]; // right clip boundary
int16 poly_ptr[2][2]; // HDMA structure pointers
int16 poly_raster[2][2]; // current raster line below horizon
int16 poly_top[2][2]; // top clip boundary
int16 poly_bottom[2][2]; // bottom clip boundary
int16 poly_cx[2][2]; // center for left/right points
int16 poly_start[2]; // current projection points
int16 poly_plane[2]; // previous z-plane distance
// OAM
int16 OAM_attr[16]; // OAM (size,MSB) data
int16 OAM_index; // index into OAM table
int16 OAM_bits; // offset into OAM table
int16 OAM_RowMax; // maximum number of tiles per 8 aligned pixels (row)
int16 OAM_Row[32]; // current number of tiles per row
};
extern struct DSP4_vars_t DSP4_vars;
#endif

View File

@@ -0,0 +1,83 @@
;Copyright (C) 1997-2007 ZSNES Team ( zsKnight, _Demo_, pagefault, Nach )
;
;http://www.zsnes.com
;http://sourceforge.net/projects/zsnes
;https://zsnes.bountysource.com
;
;This program is free software; you can redistribute it and/or
;modify it under the terms of the GNU General Public License
;version 2 as published by the Free Software Foundation.
;
;This program is distributed in the hope that it will be useful,
;but WITHOUT ANY WARRANTY; without even the implied warranty of
;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;GNU General Public License for more details.
;
;You should have received a copy of the GNU General Public License
;along with this program; if not, write to the Free Software
;Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
%include "macros.mac"
EXTSYM dsp4_address,dsp4_byte,DSP4GetByte,DSP4SetByte
EXTSYM regaccessbankr16,regaccessbankr8,regaccessbankw16,regaccessbankw8
SECTION .text
%macro RouteAccess 1
test ecx,8000h
jz %1
test ecx,4000h
jz .dsp4continue
ret
.dsp4continue
%endmacro
NEWSYM DSP4Read8b
RouteAccess regaccessbankr8
mov [dsp4_address],cx
pushad
call DSP4GetByte
popad
mov al,[dsp4_byte]
ret
NEWSYM DSP4Write8b
RouteAccess regaccessbankw8
mov [dsp4_address],cx
mov [dsp4_byte],al
pushad
call DSP4SetByte
popad
ret
NEWSYM DSP4Read16b
RouteAccess regaccessbankr16
mov [dsp4_address],cx
pushad
call DSP4GetByte
mov al,[dsp4_byte]
mov [dsp4temp],al
inc word[dsp4_address]
call DSP4GetByte
popad
mov al,[dsp4temp]
mov ah,[dsp4_byte]
ret
NEWSYM DSP4Write16b
RouteAccess regaccessbankw16
mov [dsp4_address],cx
mov [dsp4_byte],al
mov [dsp4temp],ah
pushad
call DSP4SetByte
mov ah,[dsp4temp]
mov [dsp4_byte],ah
inc word[dsp4_address]
call DSP4SetByte
popad
ret
SECTION .bss
NEWSYM dsp4temp, resb 1

2686
zsnes/src/chips/fxemu2.asm Normal file

File diff suppressed because it is too large Load Diff

827
zsnes/src/chips/fxemu2.mac Normal file
View File

@@ -0,0 +1,827 @@
;Copyright (C) 1997-2007 ZSNES Team ( zsKnight, _Demo_, pagefault, Nach )
;
;http://www.zsnes.com
;http://sourceforge.net/projects/zsnes
;https://zsnes.bountysource.com
;
;This program is free software; you can redistribute it and/or
;modify it under the terms of the GNU General Public License
;version 2 as published by the Free Software Foundation.
;
;This program is distributed in the hope that it will be useful,
;but WITHOUT ANY WARRANTY; without even the implied warranty of
;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;GNU General Public License for more details.
;
;You should have received a copy of the GNU General Public License
;along with this program; if not, write to the Free Software
;Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
%macro FETCHPIPE 0
; mov edx,[SfxPBR]
; mov edx,[SfxMemTable+edx*4]
; mov edx,[SfxCPB]
; mov edx,[SfxR15]
mov cl,[ebp]
%endmacro
%macro UpdateR14 0
; mov edx,[SfxROMBR]
; mov edx,[SfxMemTable+edx*4]
mov eax,[SfxCROM]
; and dword[SfxR14],0FFFFh
add eax,[SfxR14]
mov [SfxRomBuffer],eax
%endmacro
%macro CLRFLAGS 0
;and dword[SfxSFR],0FFFFh-0100h-0200h-1000h ; Clear ALT1,ALT2 and B Flags
; xor ch,ch
; mov dword[SfxB],0 ; Clear B Flag
; mov esi,SfxR0
; mov edi,SfxR0
%endmacro
%macro TORN 1 ; V
FETCHPIPE
mov edi, SfxR0+%1*4
inc ebp ; Increase program counter
call [FxTable+ecx*4]
mov edi,SfxR0
ret
%endmacro
%macro WITH 1 ; Verified.
FETCHPIPE
mov esi,SfxR0+%1*4
mov edi,SfxR0+%1*4
mov dword[SfxB],1
inc ebp ; Increase program counter
call [FxTablec+ecx*4]
mov esi,SfxR0
mov edi,SfxR0
mov dword[SfxB],0 ; Clear B Flag
ret
%endmacro
%macro STWRN 1 ; V
mov eax,[SfxR0+%1*4] ; Read register
mov ebx,[SfxRAMMem]
mov [SfxLastRamAdr],eax ; Save last ram address
add dword[SfxLastRamAdr],ebx ; Save last ram address
mov edx,[esi] ; Read Source
FETCHPIPE
mov [ebx+eax],dl ; Store Word
xor eax,1
inc ebp ; Increase program counter
mov [ebx+eax],dh ; Store Word
CLRFLAGS
ret
%endmacro
%macro STBRN 1 ; V
mov eax,[SfxR0+%1*4] ; Read register
FETCHPIPE
add eax,[SfxRAMMem]
mov [SfxLastRamAdr],eax ; Save last ram address
mov ebx,[esi] ; Read Source
mov [eax],bl ; Store Byte
CLRFLAGS
inc ebp ; Increase program counter
ret
%endmacro
%macro LDWRN 1 ; V
mov eax,[SfxR0+%1*4] ; Read register
mov ebx,[SfxRAMMem]
mov [SfxLastRamAdr],eax ; Save last ram address
FETCHPIPE
mov dl,[ebx+eax] ; Store Word
add dword[SfxLastRamAdr],ebx ; Save last ram address
xor eax,1
and edx,0FFFFh
inc ebp ; Increase program counter
mov dh,[ebx+eax] ; Store Word
mov [edi],edx ; Read Source
CLRFLAGS
ret
%endmacro
%macro LDBRN 1 ; V
mov eax,[SfxR0+%1*4] ; Read register
FETCHPIPE
add eax,[SfxRAMMem]
xor ebx,ebx
mov [SfxLastRamAdr],eax ; Save last ram address
mov bl,[eax] ; Read Byte
inc ebp ; Increase program counter
mov [edi],ebx ; Store Result
CLRFLAGS
ret
%endmacro
; test byte[SfxPOR],01h
; jnz .nozerocheck
; test byte[SfxPOR],02h
; jz .nodither
; **** Can pre-calculate [SfxSCBR] << 10 + [sfxramdata]
; Pre-calculate fxbit values from color register
%macro drawpix4b 0
and [eax],edx
and [eax+16],edx
xor edx,0FFFFFFFFh
mov ebx,[fxbit01pcal]
and ebx,edx
or [eax], ebx
and edx,[fxbit23pcal]
or [eax+16], edx
%endmacro
%macro drawpix4bd 0
and [eax],edx
and [eax+16],edx
xor edx,0FFFFFFFFh
mov ebx,[fxbit45pcal]
and ebx,edx
or [eax], ebx
and edx,[fxbit67pcal]
or [eax+16], edx
%endmacro
%macro drawpix2b 0
and [eax],edx
xor edx,0FFFFFFFFh
and edx,[fxbit01pcal]
or [eax], edx
%endmacro
%macro drawpix2bd 0
and [eax],edx
xor edx,0FFFFFFFFh
and edx,[fxbit45pcal]
or [eax], edx
%endmacro
%macro drawpix8b 0
and [eax],edx
and [eax+16],edx
and [eax+32],edx
and [eax+48],edx
xor edx,0FFFFFFFFh
mov ebx,[fxbit01pcal]
and ebx,edx
or [eax], ebx
mov ebx,[fxbit23pcal]
and ebx,edx
or [eax+16], ebx
mov ebx,[fxbit45pcal]
and ebx,edx
or [eax+32], ebx
and edx,[fxbit67pcal]
or [eax+48], edx
%endmacro
%macro drawpix8bd 0
and [eax],edx
and [eax+16],edx
and [eax+32],edx
and [eax+48],edx
xor edx,0FFFFFFFFh
mov ebx,[fxbit45pcal]
and ebx,edx
or [eax], ebx
mov ebx,[fxbit67pcal]
and ebx,edx
or [eax+16], ebx
mov ebx,[fxbit01pcal]
and ebx,edx
or [eax+32], ebx
and edx,[fxbit23pcal]
or [eax+48], edx
%endmacro
%macro plotb 5
shl eax,%3
and ebx,07h
add ebx,ebx
add eax,ebx
add eax,[SCBRrel]
mov bl,[SfxR1]
mov edx,[fxxand+ebx*4]
%2
%endmacro
%macro plotbz 5
shl eax,%3
and ebx,07h
add ebx,ebx
add eax,ebx
add eax,[SCBRrel]
mov bl,[SfxR1]
mov edx,[fxxand+ebx*4]
test byte[SfxCOLR],%5
jz .nodraw
%2
%endmacro
%macro plotbd 5
shl eax,%3
and ebx,07h
add ebx,ebx
add eax,ebx
add eax,[SCBRrel]
mov bl,[SfxR1]
mov edx,[fxxand+ebx*4]
mov bl,[SfxR1]
xor bl,[SfxR2]
test bl,01h
jz .nodither4b
%4
inc word[SfxR1]
%1
.nodither4b
%2
%endmacro
%macro plotbzd 5
shl eax,%3
and ebx,07h
add ebx,ebx
add eax,ebx
add eax,[SCBRrel]
mov bl,[SfxR1]
mov edx,[fxxand+ebx*4]
test byte[SfxCOLR],%5
jz near .nodraw
mov bl,[SfxR1]
xor bl,[SfxR2]
test bl,01h
jz .nodither4b
%4
inc word[SfxR1]
%1
.nodither4b
%2
%endmacro
%macro plotlines4b 1
mov ebx,[SfxR2]
FETCHPIPE
mov bh,[SfxR1]
mov eax,[sfxclineloc]
inc ebp
mov eax,[eax+ebx*4]
cmp eax,0FFFFFFFFh
je near .nodraw
%1 ret, drawpix4b, 5, drawpix4bd, 0Fh
.nodraw
inc word[SfxR1]
ret
%endmacro
%macro plotlines4bb 1
mov ebx,[SfxR2]
FETCHPIPE
mov bh,[SfxR1]
mov eax,[sfxclineloc]
inc ebp
mov eax,[eax+ebx*4]
cmp eax,0FFFFFFFFh
je near .nodraw
%1 FXReturn, drawpix4b, 5, drawpix4bd, 0Fh
.nodraw
inc word[SfxR1]
FXReturn
%endmacro
%macro plotlines2b 1
mov ebx,[SfxR2]
FETCHPIPE
mov bh,[SfxR1]
mov eax,[sfxclineloc]
inc ebp
mov eax,[eax+ebx*4]
cmp eax,0FFFFFFFFh
je .nodraw
%1 ret, drawpix2b, 4, drawpix2bd, 03h
.nodraw
inc word[SfxR1]
ret
%endmacro
%macro plotlines2bb 1
mov ebx,[SfxR2]
FETCHPIPE
mov bh,[SfxR1]
mov eax,[sfxclineloc]
inc ebp
mov eax,[eax+ebx*4]
cmp eax,0FFFFFFFFh
je near .nodraw
%1 FXReturn, drawpix2b, 4, drawpix2bd, 03h
.nodraw
inc word[SfxR1]
FXReturn
%endmacro
%macro plotlines8b 1
mov ebx,[SfxR2]
FETCHPIPE
mov bh,[SfxR1]
mov eax,[sfxclineloc]
inc ebp
mov eax,[eax+ebx*4]
cmp eax,0FFFFFFFFh
je near .nodraw
%1 ret, drawpix8b, 6, drawpix8bd, 0FFh
.nodraw
inc word[SfxR1]
ret
%endmacro
%macro plotlines8bb 1
mov ebx,[SfxR2]
FETCHPIPE
mov bh,[SfxR1]
mov eax,[sfxclineloc]
inc ebp
mov eax,[eax+ebx*4]
cmp eax,0FFFFFFFFh
je .nodraw
%1 FXReturn, drawpix8b, 6, drawpix8bd, 0FFh
.nodraw
inc word[SfxR1]
FXReturn
%endmacro
%macro plotlines8bl 1
mov ebx,[SfxR2]
FETCHPIPE
mov bh,[SfxR1]
mov eax,[sfxclineloc]
inc ebp
mov eax,[eax+ebx*4]
cmp eax,0FFFFFFFFh
je near .nodraw
%1 ret, drawpix8b, 6, drawpix8bd, 0Fh
.nodraw
inc word[SfxR1]
ret
%endmacro
%macro plotlines8bbl 1
mov ebx,[SfxR2]
FETCHPIPE
mov bh,[SfxR1]
mov eax,[sfxclineloc]
inc ebp
mov eax,[eax+ebx*4]
cmp eax,0FFFFFFFFh
je .nodraw
%1 FXReturn, drawpix8b, 6, drawpix8bd, 0Fh
.nodraw
inc word[SfxR1]
FXReturn
%endmacro
%macro ADDRN 1 ; V
mov eax, [esi] ; Read Source
mov ebx, [SfxR0+%1*4]
FETCHPIPE
add ax,bx
seto byte[SfxOverflow]
setc byte[SfxCarry]
mov [SfxSignZero],eax
inc ebp ; Increase program counter
mov [edi],eax ; Write Destination
CLRFLAGS
ret
%endmacro
%macro ADCRN 1 ; V
FETCHPIPE
mov eax, [esi] ; Read Source
mov ebx, [SfxR0+%1*4]
shr byte[SfxCarry],1
adc ax,bx
seto byte[SfxOverflow]
setc byte[SfxCarry]
mov [SfxSignZero],eax
inc ebp ; Increase program counter
mov [edi],eax ; Write Destination
CLRFLAGS
ret
%endmacro
%macro ADIRN 1 ; V
mov eax, [esi] ; Read Source
FETCHPIPE
add ax,%1
seto byte[SfxOverflow]
setc byte[SfxCarry]
mov [SfxSignZero],eax
inc ebp ; Increase program counter
mov [edi],eax ; Write Destination
CLRFLAGS
ret
%endmacro
%macro ADCIRN 1 ; V
FETCHPIPE
mov eax, [esi] ; Read Source
shr byte[SfxCarry],1
adc ax,%1
seto byte[SfxOverflow]
setc byte[SfxCarry]
mov [SfxSignZero],eax
inc ebp ; Increase program counter
mov [edi],eax ; Write Destination
CLRFLAGS
ret
%endmacro
%macro SUBRN 1 ; V
mov eax,[esi] ; Read Source
mov ebx,[SfxR0+%1*4]
FETCHPIPE
sub ax,bx
seto byte[SfxOverflow]
setc byte[SfxCarry]
xor byte[SfxCarry],1
inc ebp ; Increase program counter
mov [edi],eax ; Write Destination
mov [SfxSignZero],eax
CLRFLAGS
ret
%endmacro
%macro SBCRN 1 ; V
FETCHPIPE
mov eax,[esi] ; Read Source
mov ebx,[SfxR0+%1*4]
cmp byte[SfxCarry],1
sbb ax,bx
seto byte[SfxOverflow]
setc byte[SfxCarry]
xor byte[SfxCarry],1
inc ebp ; Increase program counter
mov [edi],eax ; Write Destination
mov [SfxSignZero],eax
CLRFLAGS
ret
%endmacro
%macro SUBIRN 1 ; V
mov eax,[esi] ; Read Source
FETCHPIPE
sub ax,%1
seto byte[SfxOverflow]
setc byte[SfxCarry]
xor byte[SfxCarry],1
inc ebp ; Increase program counter
mov [edi],eax ; Write Destination
mov [SfxSignZero],eax
CLRFLAGS
ret
%endmacro
%macro CMPRN 1 ; V
mov eax,[esi] ; Read Source
mov ebx,[SfxR0+%1*4]
FETCHPIPE
sub ax,bx
seto byte[SfxOverflow]
setc byte[SfxCarry]
xor byte[SfxCarry],1
mov [SfxSignZero],eax
CLRFLAGS
inc ebp ; Increase program counter
ret
%endmacro
%macro ANDRN 1 ; V
mov eax,[esi] ; Read Source
mov ebx,[SfxR0+%1*4] ; Read RN
FETCHPIPE
and eax,ebx
inc ebp
mov [SfxSignZero],eax
mov [edi],eax ; Write Destination
CLRFLAGS
ret
%endmacro
%macro BICRN 1 ; V
mov ebx,[SfxR0+%1*4] ; Read RN
mov eax,[esi] ; Read Source
xor ebx,0FFFFh
FETCHPIPE
and eax,ebx
inc ebp
mov [SfxSignZero],eax
mov [edi],eax ; Write Destination
CLRFLAGS
ret
%endmacro
%macro ANDIRN 1 ; V
mov eax,[esi] ; Read Source
FETCHPIPE
and eax,%1
inc ebp
mov [SfxSignZero],eax
mov [edi],eax ; Write Destination
CLRFLAGS
ret
%endmacro
%macro BICIRN 1 ; V
mov eax,[esi] ; Read Source
FETCHPIPE
and eax,%1
inc ebp
mov [SfxSignZero],eax
mov [edi],eax ; Write Destination
CLRFLAGS
ret
%endmacro
%macro MULTRN 1 ; V
mov al,[esi] ; Read Source
mov bl,[SfxR0+%1*4] ; Read RN
FETCHPIPE
imul bl
inc ebp
and eax,0FFFFh
mov [SfxSignZero],eax
mov [edi],eax ; Write Destination
CLRFLAGS
ret
%endmacro
%macro UMULTRN 1 ; V
mov al,[esi] ; Read Source
mov bl,[SfxR0+%1*4] ; Read RN
FETCHPIPE
mul bl
inc ebp
and eax,0FFFFh
mov [SfxSignZero],eax
mov [edi],eax ; Write Destination
CLRFLAGS
ret
%endmacro
%macro MULTIRN 1 ; V
mov al,[esi] ; Read Source
mov bl,%1 ; Read RN
FETCHPIPE
imul bl
inc ebp
and eax,0FFFFh
mov [SfxSignZero],eax
mov [edi],eax ; Write Destination
CLRFLAGS
ret
%endmacro
%macro UMULTIRN 1 ; V
mov al,[esi] ; Read Source
mov bl,%1 ; Read RN
FETCHPIPE
mul bl
inc ebp
and eax,0FFFFh
mov [SfxSignZero],eax
mov [edi],eax ; Write Destination
CLRFLAGS
ret
%endmacro
%macro LINK 1 ; Verified.
mov eax,ebp
sub eax,[SfxCPB]
add eax,%1
FETCHPIPE
mov [SfxR11],ax
CLRFLAGS
inc ebp
ret
%endmacro
%macro JMPRN 1 ; V
FETCHPIPE
mov eax,[SfxR0+%1*4] ; Read RN
mov ebp,[SfxCPB]
add ebp,eax
CLRFLAGS
ret
%endmacro
%macro LJMPRN 1 ; V
FETCHPIPE
mov eax,[SfxR0+%1*4]
and eax,07Fh
mov [SfxPBR],al
; mov byte[fxtrace+eax],1
mov eax,[SfxMemTable+eax*4]
mov [SfxCPB],eax
mov ebp,eax
add ebp,[esi] ; Read RN
mov dword[SfxCacheActive],0
push ecx
call FxOp02
pop ecx
dec ebp
ret
%endmacro
%macro IBTRN 1 ; V
movsx eax,byte[ebp]
mov cl,[ebp+1]
add ebp,2
mov [SfxR0+%1*4],ax
CLRFLAGS
ret
%endmacro
%macro LMSRN 1 ; Verified.
xor eax,eax
mov al,[ebp]
add eax,eax
inc ebp
add eax,[SfxRAMMem]
mov cl,[ebp]
mov [SfxLastRamAdr],eax
mov ebx,[eax] ; Read word from ram
inc ebp
mov [SfxR0+%1*4],bx ; Write data
CLRFLAGS
ret
%endmacro
%macro SMSRN 1 ; Verified.
xor eax,eax
mov al,[ebp]
inc ebp
add eax,eax
mov cl,[ebp]
add eax,[SfxRAMMem]
mov ebx,[SfxR0+%1*4] ; Read data
mov [SfxLastRamAdr],eax
inc ebp
mov [eax],bx ; Write word to ram
CLRFLAGS
ret
%endmacro
%macro FROMRN 1 ; V
FETCHPIPE
mov esi,SfxR0+%1*4
inc ebp ; Increase program counter
call [FxTable+ecx*4]
mov esi,SfxR0
ret
%endmacro
%macro ORRN 1 ; V
mov eax,[esi] ; Read Source
mov ebx,[SfxR0+%1*4] ; Read
FETCHPIPE
or eax,ebx
inc ebp
mov [edi],eax ; Write DREG
mov [SfxSignZero],eax
CLRFLAGS
ret
%endmacro
%macro XORRN 1 ; V
mov eax,[esi] ; Read Source
mov ebx,[SfxR0+%1*4] ; Read
FETCHPIPE
xor eax,ebx
inc ebp
mov [edi],eax ; Write DREG
mov [SfxSignZero],eax
CLRFLAGS
ret
%endmacro
%macro ORI 1 ; V
mov eax,[esi] ; Read Source
FETCHPIPE
or eax,%1
inc ebp
mov [edi],eax ; Write DREG
mov [SfxSignZero],eax
CLRFLAGS
ret
%endmacro
%macro XORI 1 ; V
mov eax,[esi] ; Read Source
FETCHPIPE
xor eax,%1
inc ebp
mov [edi],eax ; Write DREG
mov [SfxSignZero],eax
CLRFLAGS
ret
%endmacro
%macro INCRN 1 ; Verified
inc word[SfxR0+%1*4]
FETCHPIPE
mov eax,[SfxR0+%1*4] ; Read Source
mov [SfxSignZero],eax
CLRFLAGS
inc ebp
ret
%endmacro
%macro DECRN 1 ; Verified
dec word[SfxR0+%1*4]
FETCHPIPE
mov eax,[SfxR0+%1*4] ; Read Source
mov [SfxR0+%1*4],eax
mov [SfxSignZero],eax
CLRFLAGS
inc ebp
ret
%endmacro
%macro IWTRN 1 ; aka LEA ; Verified.
mov eax,[ebp]
mov cl,[ebp+2]
and eax,0FFFFh
add ebp,3
mov [SfxR0+%1*4],eax
CLRFLAGS
ret
%endmacro
%macro LMRN 1 ; Verified!
xor eax,eax
mov cl,[ebp+2]
mov ax,[ebp]
mov ebx,[SfxRAMMem]
mov [SfxLastRamAdr],eax
add [SfxLastRamAdr],ebx
mov dl,[eax+ebx]
xor eax,1
add ebp,3
mov dh,[eax+ebx]
mov [SfxR0+%1*4],dx ; Store Word
CLRFLAGS
ret
%endmacro
%macro SMRN 1 ; Verified
mov ebx,[SfxR0+%1*4]
mov eax,[ebp]
mov cl,[ebp+2]
and eax,0FFFFh
mov dx,bx
mov ebx,[SfxRAMMem]
mov [SfxLastRamAdr],eax
add [SfxLastRamAdr],ebx
mov [eax+ebx],dl
xor eax,1
add ebp,3
mov [eax+ebx],dh
CLRFLAGS
ret
%endmacro
%macro PackEsiEdi 0
mov eax,[SfxSREG]
shl eax,2
add eax,SfxR0
mov esi,eax
mov eax,[SfxDREG]
shl eax,2
add eax,SfxR0
mov edi,eax
mov eax,[SfxRAMBR]
shl eax,16
add eax,[sfxramdata]
mov [SfxRAMMem],eax
%endmacro
%macro UnPackEsiEdi 0
mov eax,esi
sub eax,SfxR0
shr eax,2
mov [SfxSREG],eax
mov eax,edi
sub eax,SfxR0
shr eax,2
mov [SfxDREG],eax
%endmacro

615
zsnes/src/chips/fxemu2b.asm Normal file
View File

@@ -0,0 +1,615 @@
;Copyright (C) 1997-2007 ZSNES Team ( zsKnight, _Demo_, pagefault, Nach )
;
;http://www.zsnes.com
;http://sourceforge.net/projects/zsnes
;https://zsnes.bountysource.com
;
;This program is free software; you can redistribute it and/or
;modify it under the terms of the GNU General Public License
;version 2 as published by the Free Software Foundation.
;
;This program is distributed in the hope that it will be useful,
;but WITHOUT ANY WARRANTY; without even the implied warranty of
;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;GNU General Public License for more details.
;
;You should have received a copy of the GNU General Public License
;along with this program; if not, write to the Free Software
;Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
%include "macros.mac"
EXTSYM FxTable,FxTableb,FxTablec,SfxB,SfxCPB,SfxCROM,SfxCarry,SfxOverflow
EXTSYM SfxR0,SfxR14,SfxR15,SfxRomBuffer,SfxSignZero,withr15sk
%include "chips/fxemu2.mac"
%include "chips/fxemu2b.mac"
SECTION .text
NEWSYM FxOpb05 ; BRA branch always ; Verified.
movsx eax,byte[ebp]
mov cl,[ebp+1]
inc ebp
add ebp,eax
call [FxTableb+ecx*4]
ret
NEWSYM FxOpb06 ; BGE branch on greater or equals ; Verified.
movsx eax,byte[ebp]
mov ebx,[SfxSignZero]
shr ebx,15
inc ebp
xor bl,[SfxOverflow]
mov cl,[ebp]
test bl,01h
jnz .nojump
add ebp,eax
call [FxTableb+ecx*4]
ret
.nojump
inc ebp
call [FxTableb+ecx*4]
ret
NEWSYM FxOpb07 ; BLT branch on lesss than ; Verified.
movsx eax,byte[ebp]
mov ebx,[SfxSignZero]
shr ebx,15
inc ebp
xor bl,[SfxOverflow]
mov cl,[ebp]
test bl,01h
jz .nojump
add ebp,eax
call [FxTableb+ecx*4]
ret
.nojump
inc ebp
call [FxTableb+ecx*4]
ret
NEWSYM FxOpb08 ; BNE branch on not equal ; Verified.
movsx eax,byte[ebp]
inc ebp
test dword[SfxSignZero],0FFFFh
mov cl,[ebp]
jz .nojump
add ebp,eax
call [FxTableb+ecx*4]
ret
.nojump
inc ebp
call [FxTableb+ecx*4]
ret
NEWSYM FxOpb09 ; BEQ branch on equal (z=1) ; Verified.
movsx eax,byte[ebp]
inc ebp
test dword[SfxSignZero],0FFFFh
mov cl,[ebp]
jnz .nojump
add ebp,eax
call [FxTableb+ecx*4]
ret
.nojump
inc ebp
call [FxTableb+ecx*4]
ret
NEWSYM FxOpb0A ; BPL branch on plus ; Verified.
movsx eax,byte[ebp]
inc ebp
test dword[SfxSignZero],088000h
mov cl,[ebp]
jnz .nojump
add ebp,eax
call [FxTableb+ecx*4]
ret
.nojump
inc ebp
call [FxTableb+ecx*4]
ret
NEWSYM FxOpb0B ; BMI branch on minus ; Verified.
movsx eax,byte[ebp]
inc ebp
test dword[SfxSignZero],088000h
mov cl,[ebp]
jz .nojump
add ebp,eax
call [FxTableb+ecx*4]
ret
.nojump
inc ebp
call [FxTableb+ecx*4]
ret
NEWSYM FxOpb0C ; BCC branch on carry clear ; Verified.
movsx eax,byte[ebp]
inc ebp
test byte[SfxCarry],01h
mov cl,[ebp]
jnz .nojump
add ebp,eax
call [FxTableb+ecx*4]
ret
.nojump
inc ebp
call [FxTableb+ecx*4]
ret
NEWSYM FxOpb0D ; BCS branch on carry set ; Verified.
movsx eax,byte[ebp]
inc ebp
test byte[SfxCarry],01h
mov cl,[ebp]
jz .nojump
add ebp,eax
call [FxTableb+ecx*4]
ret
.nojump
inc ebp
call [FxTableb+ecx*4]
ret
NEWSYM FxOpb0E ; BVC branch on overflow clear ; Verified.
movsx eax,byte[ebp]
inc ebp
test byte[SfxOverflow],01h
mov cl,[ebp]
jnz .nojump
add ebp,eax
call [FxTableb+ecx*4]
ret
.nojump
inc ebp
call [FxTableb+ecx*4]
ret
NEWSYM FxOpb0F ; BVS branch on overflow set ; Verified.
movsx eax,byte[ebp]
inc ebp
test byte[SfxOverflow],01h
mov cl,[ebp]
jz .nojump
add ebp,eax
call [FxTableb+ecx*4]
ret
.nojump
inc ebp
call [FxTableb+ecx*4]
ret
NEWSYM FxOpb10 ; TO RN set register n as destination register
TORNb 0
NEWSYM FxOpb11 ; TO RN set register n as destination register
TORNb 1
NEWSYM FxOpb12 ; TO RN set register n as destination register
TORNb 2
NEWSYM FxOpb13 ; TO RN set register n as destination register
TORNb 3
NEWSYM FxOpb14 ; TO RN set register n as destination register
TORNb 4
NEWSYM FxOpb15 ; TO RN set register n as destination register
TORNb 5
NEWSYM FxOpb16 ; TO RN set register n as destination register
TORNb 6
NEWSYM FxOpb17 ; TO RN set register n as destination register
TORNb 7
NEWSYM FxOpb18 ; TO RN set register n as destination register
TORNb 8
NEWSYM FxOpb19 ; TO RN set register n as destination register
TORNb 9
NEWSYM FxOpb1A ; TO RN set register n as destination register
TORNb 10
NEWSYM FxOpb1B ; TO RN set register n as destination register
TORNb 11
NEWSYM FxOpb1C ; TO RN set register n as destination register
TORNb 12
NEWSYM FxOpb1D ; TO RN set register n as destination register
TORNb 13
NEWSYM FxOpb1E ; TO RN set register n as destination register
FETCHPIPE
test dword[SfxB],1
jnz .VersionB
mov edi,SfxR0+14*4
inc ebp
mov eax,ebp
sub eax,[SfxCPB]
mov dword[withr15sk],1
mov [SfxR15],eax
call [FxTableb+ecx*4]
mov edi,SfxR0
UpdateR14
ret
.VersionB
mov eax,[esi] ; Read Source
mov dword[withr15sk],1
mov [SfxR0+14*4],eax ; Write
CLRFLAGS
UpdateR14
inc ebp ; Increase program counter
ret
NEWSYM FxOpb1F ; TO RN set register n as destination register
FETCHPIPE
test dword[SfxB],1
jnz .VersionB
mov edi,SfxR0+15*4
inc ebp
mov eax,ebp
sub eax,[SfxCPB]
mov [SfxR15],eax
call [FxTableb+ecx*4]
mov ebp,[SfxCPB]
mov dword[withr15sk],1
add ebp,[SfxR15]
mov edi,SfxR0
ret
.VersionB
mov eax,[esi] ; Read Source
mov ebp,[SfxCPB]
mov dword[withr15sk],1
add ebp,eax
CLRFLAGS
ret
NEWSYM FxOpb3D ; ALT1 set alt1 mode ; Verified.
FETCHPIPE
mov dword[SfxB],0
or ch,01h
inc ebp
mov eax,ebp
sub eax,[SfxCPB]
mov [SfxR15],eax
call [FxTableb+ecx*4]
xor ch,ch
ret
NEWSYM FxOpb3E ; ALT2 set alt1 mode ; Verified.
FETCHPIPE
mov dword[SfxB],0
or ch,02h
inc ebp
mov eax,ebp
sub eax,[SfxCPB]
mov [SfxR15],eax
call [FxTable+ecx*4]
xor ch,ch
ret
NEWSYM FxOpb3F ; ALT3 set alt3 mode ; Verified.
FETCHPIPE
mov dword[SfxB],0
or ch,03h
inc ebp
mov eax,ebp
sub eax,[SfxCPB]
mov [SfxR15],eax
call [FxTable+ecx*4]
xor ch,ch
ret
NEWSYM FxOpbB0 ; FROM rn set source register
FROMRNb 0
NEWSYM FxOpbB1 ; FROM rn set source register
FROMRNb 1
NEWSYM FxOpbB2 ; FROM rn set source register
FROMRNb 2
NEWSYM FxOpbB3 ; FROM rn set source register
FROMRNb 3
NEWSYM FxOpbB4 ; FROM rn set source register
FROMRNb 4
NEWSYM FxOpbB5 ; FROM rn set source register
FROMRNb 5
NEWSYM FxOpbB6 ; FROM rn set source register
FROMRNb 6
NEWSYM FxOpbB7 ; FROM rn set source register
FROMRNb 7
NEWSYM FxOpbB8 ; FROM rn set source register
FROMRNb 8
NEWSYM FxOpbB9 ; FROM rn set source register
FROMRNb 9
NEWSYM FxOpbBA ; FROM rn set source register
FROMRNb 10
NEWSYM FxOpbBB ; FROM rn set source register
FROMRNb 11
NEWSYM FxOpbBC ; FROM rn set source register
FROMRNb 12
NEWSYM FxOpbBD ; FROM rn set source register
FROMRNb 13
NEWSYM FxOpbBE ; FROM rn set source register
FROMRNb 14
NEWSYM FxOpbBF ; FROM rn set source register
test dword[SfxB],1
jnz .VersionB
mov esi,SfxR0+15*4
inc ebp ; Increase program counter
mov eax,ebp
sub eax,[SfxCPB]
mov [SfxR15],eax
call [FxTableb+ecx*4]
mov esi,SfxR0
ret
.VersionB
FETCHPIPE
mov eax,ebp
sub eax,[SfxCPB]
inc ebp
mov [edi],eax ; Write Destination
mov [SfxSignZero],eax
shr al,7
mov [SfxOverflow],al
CLRFLAGS
ret
NEWSYM FxOpc05 ; BRA branch always ; Verified.
movsx eax,byte[ebp]
mov cl,[ebp+1]
inc ebp
add ebp,eax
call [FxTablec+ecx*4]
ret
NEWSYM FxOpc06 ; BGE branch on greater or equals ; Verified.
movsx eax,byte[ebp]
mov ebx,[SfxSignZero]
shr ebx,15
inc ebp
xor bl,[SfxOverflow]
mov cl,[ebp]
test bl,01h
jnz .nojump
add ebp,eax
call [FxTablec+ecx*4]
ret
.nojump
inc ebp
call [FxTablec+ecx*4]
ret
NEWSYM FxOpc07 ; BLT branch on lesss than ; Verified.
movsx eax,byte[ebp]
mov ebx,[SfxSignZero]
shr ebx,15
inc ebp
xor bl,[SfxOverflow]
mov cl,[ebp]
test bl,01h
jz .nojump
add ebp,eax
call [FxTablec+ecx*4]
ret
.nojump
inc ebp
call [FxTablec+ecx*4]
ret
NEWSYM FxOpc08 ; BNE branch on not equal ; Verified.
movsx eax,byte[ebp]
inc ebp
test dword[SfxSignZero],0FFFFh
mov cl,[ebp]
jz .nojump
add ebp,eax
call [FxTablec+ecx*4]
ret
.nojump
inc ebp
call [FxTablec+ecx*4]
ret
NEWSYM FxOpc09 ; BEQ branch on equal (z=1) ; Verified.
movsx eax,byte[ebp]
inc ebp
test dword[SfxSignZero],0FFFFh
mov cl,[ebp]
jnz .nojump
add ebp,eax
call [FxTablec+ecx*4]
ret
.nojump
inc ebp
call [FxTablec+ecx*4]
ret
NEWSYM FxOpc0A ; BPL branch on plus ; Verified.
movsx eax,byte[ebp]
inc ebp
test dword[SfxSignZero],088000h
mov cl,[ebp]
jnz .nojump
add ebp,eax
call [FxTablec+ecx*4]
ret
.nojump
inc ebp
call [FxTablec+ecx*4]
ret
NEWSYM FxOpc0B ; BMI branch on minus ; Verified.
movsx eax,byte[ebp]
inc ebp
test dword[SfxSignZero],088000h
mov cl,[ebp]
jz .nojump
add ebp,eax
call [FxTablec+ecx*4]
ret
.nojump
inc ebp
call [FxTablec+ecx*4]
ret
NEWSYM FxOpc0C ; BCC branch on carry clear ; Verified.
movsx eax,byte[ebp]
inc ebp
test byte[SfxCarry],01h
mov cl,[ebp]
jnz .nojump
add ebp,eax
call [FxTablec+ecx*4]
ret
.nojump
inc ebp
call [FxTablec+ecx*4]
ret
NEWSYM FxOpc0D ; BCS branch on carry set ; Verified.
movsx eax,byte[ebp]
inc ebp
test byte[SfxCarry],01h
mov cl,[ebp]
jz .nojump
add ebp,eax
call [FxTablec+ecx*4]
ret
.nojump
inc ebp
call [FxTablec+ecx*4]
ret
NEWSYM FxOpc0E ; BVC branch on overflow clear ; Verified.
movsx eax,byte[ebp]
inc ebp
test byte[SfxOverflow],01h
mov cl,[ebp]
jnz .nojump
add ebp,eax
call [FxTablec+ecx*4]
ret
.nojump
inc ebp
call [FxTablec+ecx*4]
ret
NEWSYM FxOpc0F ; BVS branch on overflow set ; Verified.
movsx eax,byte[ebp]
inc ebp
test byte[SfxOverflow],01h
mov cl,[ebp]
jz .nojump
add ebp,eax
call [FxTablec+ecx*4]
ret
.nojump
inc ebp
call [FxTablec+ecx*4]
ret
NEWSYM FxOpc10 ; TO RN set register n as destination register
TORNc 0
NEWSYM FxOpc11 ; TO RN set register n as destination register
TORNc 1
NEWSYM FxOpc12 ; TO RN set register n as destination register
TORNc 2
NEWSYM FxOpc13 ; TO RN set register n as destination register
TORNc 3
NEWSYM FxOpc14 ; TO RN set register n as destination register
TORNc 4
NEWSYM FxOpc15 ; TO RN set register n as destination register
TORNc 5
NEWSYM FxOpc16 ; TO RN set register n as destination register
TORNc 6
NEWSYM FxOpc17 ; TO RN set register n as destination register
TORNc 7
NEWSYM FxOpc18 ; TO RN set register n as destination register
TORNc 8
NEWSYM FxOpc19 ; TO RN set register n as destination register
TORNc 9
NEWSYM FxOpc1A ; TO RN set register n as destination register
TORNc 10
NEWSYM FxOpc1B ; TO RN set register n as destination register
TORNc 11
NEWSYM FxOpc1C ; TO RN set register n as destination register
TORNc 12
NEWSYM FxOpc1D ; TO RN set register n as destination register
TORNc 13
NEWSYM FxOpc1E ; TO RN set register n as destination register
FETCHPIPE
mov eax,[esi] ; Read Source
mov [SfxR0+14*4],eax ; Write
CLRFLAGS
UpdateR14
inc ebp ; Increase program counter
ret
NEWSYM FxOpc1F ; TO RN set register n as destination register
FETCHPIPE
mov eax,[esi] ; Read Source
mov ebp,[SfxCPB]
mov [SfxR15],eax
add ebp,eax
CLRFLAGS
ret
NEWSYM FxOpc3D ; ALT1 set alt1 mode ; Verified.
FETCHPIPE
mov dword[SfxB],0
or ch,01h
inc ebp
call [FxTablec+ecx*4]
xor ch,ch
ret
NEWSYM FxOpc3E ; ALT2 set alt1 mode ; Verified.
FETCHPIPE
mov dword[SfxB],0
or ch,02h
inc ebp
call [FxTablec+ecx*4]
xor ch,ch
ret
NEWSYM FxOpc3F ; ALT3 set alt3 mode ; Verified.
FETCHPIPE
mov dword[SfxB],0
or ch,03h
inc ebp
call [FxTablec+ecx*4]
xor ch,ch
ret
NEWSYM FxOpcB0 ; FROM rn set source register
FROMRNc 0
NEWSYM FxOpcB1 ; FROM rn set source register
FROMRNc 1
NEWSYM FxOpcB2 ; FROM rn set source register
FROMRNc 2
NEWSYM FxOpcB3 ; FROM rn set source register
FROMRNc 3
NEWSYM FxOpcB4 ; FROM rn set source register
FROMRNc 4
NEWSYM FxOpcB5 ; FROM rn set source register
FROMRNc 5
NEWSYM FxOpcB6 ; FROM rn set source register
FROMRNc 6
NEWSYM FxOpcB7 ; FROM rn set source register
FROMRNc 7
NEWSYM FxOpcB8 ; FROM rn set source register
FROMRNc 8
NEWSYM FxOpcB9 ; FROM rn set source register
FROMRNc 9
NEWSYM FxOpcBA ; FROM rn set source register
FROMRNc 10
NEWSYM FxOpcBB ; FROM rn set source register
FROMRNc 11
NEWSYM FxOpcBC ; FROM rn set source register
FROMRNc 12
NEWSYM FxOpcBD ; FROM rn set source register
FROMRNc 13
NEWSYM FxOpcBE ; FROM rn set source register
FROMRNc 14
NEWSYM FxOpcBF ; FROM rn set source register
FETCHPIPE
mov eax,ebp
sub eax,[SfxCPB]
inc ebp
mov [edi],eax ; Write Destination
mov [SfxSignZero],eax
shr al,7
mov [SfxOverflow],al
CLRFLAGS
ret

View File

@@ -0,0 +1,92 @@
;Copyright (C) 1997-2007 ZSNES Team ( zsKnight, _Demo_, pagefault, Nach )
;
;http://www.zsnes.com
;http://sourceforge.net/projects/zsnes
;https://zsnes.bountysource.com
;
;This program is free software; you can redistribute it and/or
;modify it under the terms of the GNU General Public License
;version 2 as published by the Free Software Foundation.
;
;This program is distributed in the hope that it will be useful,
;but WITHOUT ANY WARRANTY; without even the implied warranty of
;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;GNU General Public License for more details.
;
;You should have received a copy of the GNU General Public License
;along with this program; if not, write to the Free Software
;Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
%macro TORNb 1 ; V
FETCHPIPE
test dword[SfxB],1
jnz .VersionB
mov edi, SfxR0+%1*4
inc ebp ; Increase program counter
mov eax,ebp
sub eax,[SfxCPB]
mov dword[withr15sk],1
mov [SfxR15],eax
call [FxTableb+ecx*4]
mov edi,SfxR0
ret
.VersionB
mov eax,[esi] ; Read Source
mov dword[withr15sk],1
inc ebp ; Increase program counter
mov [SfxR0+%1*4],eax ; Write
CLRFLAGS
ret
%endmacro
%macro FROMRNb 1 ; V
FETCHPIPE
test dword[SfxB],1
jnz .VersionB
mov esi,SfxR0+%1*4
inc ebp ; Increase program counter
call [FxTable+ecx*4]
mov esi,SfxR0
ret
.VersionB
mov eax,[SfxR0+%1*4] ; Read
inc ebp
mov [edi],eax ; Write Destination
mov [SfxSignZero],eax
shr al,7
mov [SfxOverflow],al
CLRFLAGS
ret
%endmacro
%macro TORNc 1 ; V
FETCHPIPE
mov eax,[esi] ; Read Source
inc ebp ; Increase program counter
mov [SfxR0+%1*4],eax ; Write
CLRFLAGS
ret
%endmacro
%macro FROMRNc 1 ; V
FETCHPIPE
mov eax,[SfxR0+%1*4] ; Read
inc ebp
mov [edi],eax ; Write Destination
mov [SfxSignZero],eax
shr al,7
mov [SfxOverflow],al
CLRFLAGS
ret
%endmacro

2553
zsnes/src/chips/fxemu2c.asm Normal file

File diff suppressed because it is too large Load Diff

532
zsnes/src/chips/fxemu2c.mac Normal file
View File

@@ -0,0 +1,532 @@
;Copyright (C) 1997-2007 ZSNES Team ( zsKnight, _Demo_, pagefault, Nach )
;
;http://www.zsnes.com
;http://sourceforge.net/projects/zsnes
;https://zsnes.bountysource.com
;
;This program is free software; you can redistribute it and/or
;modify it under the terms of the GNU General Public License
;version 2 as published by the Free Software Foundation.
;
;This program is distributed in the hope that it will be useful,
;but WITHOUT ANY WARRANTY; without even the implied warranty of
;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;GNU General Public License for more details.
;
;You should have received a copy of the GNU General Public License
;along with this program; if not, write to the Free Software
;Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
%macro FXReturn 0
dec dword[NumberOfOpcodes]
;pushad
js %%endloop
;call WriteLine
;popad
%%blah
jmp [FxTabled+ecx*4]
%%endloop
jmp FXEndLoop
ALIGN32
%endmacro
%macro FXReturn2 0
dec dword[NumberOfOpcodes]
js %%endloop
jmp [FxTabled+ecx*4]
%%endloop
jmp FXEndLoop
ALIGN32
%endmacro
%macro TORNd 1 ; V
FETCHPIPE
mov edi, SfxR0+%1*4
inc ebp ; Increase program counter
call [FxTable+ecx*4]
mov edi,SfxR0
FXReturn
%endmacro
%macro WITHc 1 ; Verified.
FETCHPIPE
mov esi,SfxR0+%1*4
mov edi,SfxR0+%1*4
mov dword[SfxB],1
inc ebp ; Increase program counter
call [FxTablec+ecx*4]
mov esi,SfxR0
mov edi,SfxR0
mov dword[SfxB],0 ; Clear B Flag
FXReturn
%endmacro
%macro STWRNc 1 ; V
mov eax,[SfxR0+%1*4] ; Read register
mov ebx,[SfxRAMMem]
mov [SfxLastRamAdr],eax ; Save last ram address
add dword[SfxLastRamAdr],ebx ; Save last ram address
mov edx,[esi] ; Read Source
FETCHPIPE
mov [ebx+eax],dl ; Store Word
xor eax,1
inc ebp ; Increase program counter
mov [ebx+eax],dh ; Store Word
CLRFLAGS
FXReturn
%endmacro
%macro STBRNc 1 ; V
mov eax,[SfxR0+%1*4] ; Read register
FETCHPIPE
add eax,[SfxRAMMem]
mov [SfxLastRamAdr],eax ; Save last ram address
mov ebx,[esi] ; Read Source
mov [eax],bl ; Store Byte
CLRFLAGS
inc ebp ; Increase program counter
FXReturn
%endmacro
%macro LDWRNc 1 ; V
mov eax,[SfxR0+%1*4] ; Read register
mov ebx,[SfxRAMMem]
mov [SfxLastRamAdr],eax ; Save last ram address
FETCHPIPE
mov dl,[ebx+eax] ; Store Word
add dword[SfxLastRamAdr],ebx ; Save last ram address
xor eax,1
and edx,0FFFFh
inc ebp ; Increase program counter
mov dh,[ebx+eax] ; Store Word
mov [edi],edx ; Read Source
CLRFLAGS
FXReturn
%endmacro
%macro LDBRNc 1 ; V
mov eax,[SfxR0+%1*4] ; Read register
FETCHPIPE
add eax,[SfxRAMMem]
xor ebx,ebx
mov [SfxLastRamAdr],eax ; Save last ram address
mov bl,[eax] ; Read Byte
inc ebp ; Increase program counter
mov [edi],ebx ; Store Result
CLRFLAGS
FXReturn
%endmacro
%macro ADDRNc 1 ; V
mov eax, [esi] ; Read Source
mov ebx, [SfxR0+%1*4]
FETCHPIPE
add ax,bx
seto byte[SfxOverflow]
setc byte[SfxCarry]
mov [SfxSignZero],eax
inc ebp ; Increase program counter
mov [edi],eax ; Write Destination
CLRFLAGS
FXReturn
%endmacro
%macro ADCRNc 1 ; V
FETCHPIPE
mov eax, [esi] ; Read Source
mov ebx, [SfxR0+%1*4]
shr byte[SfxCarry],1
adc ax,bx
seto byte[SfxOverflow]
setc byte[SfxCarry]
mov [SfxSignZero],eax
inc ebp ; Increase program counter
mov [edi],eax ; Write Destination
CLRFLAGS
FXReturn
%endmacro
%macro ADIRNc 1 ; V
mov eax, [esi] ; Read Source
FETCHPIPE
add ax,%1
seto byte[SfxOverflow]
setc byte[SfxCarry]
mov [SfxSignZero],eax
inc ebp ; Increase program counter
mov [edi],eax ; Write Destination
CLRFLAGS
FXReturn
%endmacro
%macro ADCIRNc 1 ; V
FETCHPIPE
mov eax, [esi] ; Read Source
shr byte[SfxCarry],1
adc ax,%1
seto byte[SfxOverflow]
setc byte[SfxCarry]
mov [SfxSignZero],eax
inc ebp ; Increase program counter
mov [edi],eax ; Write Destination
CLRFLAGS
FXReturn
%endmacro
%macro SUBRNc 1 ; V
mov eax,[esi] ; Read Source
mov ebx,[SfxR0+%1*4]
FETCHPIPE
sub ax,bx
seto byte[SfxOverflow]
setc byte[SfxCarry]
xor byte[SfxCarry],1
inc ebp ; Increase program counter
mov [edi],eax ; Write Destination
mov [SfxSignZero],eax
CLRFLAGS
FXReturn
%endmacro
%macro SBCRNc 1 ; V
FETCHPIPE
mov eax,[esi] ; Read Source
mov ebx,[SfxR0+%1*4]
cmp byte[SfxCarry],1
sbb ax,bx
seto byte[SfxOverflow]
setc byte[SfxCarry]
xor byte[SfxCarry],1
inc ebp ; Increase program counter
mov [edi],eax ; Write Destination
mov [SfxSignZero],eax
CLRFLAGS
FXReturn
%endmacro
%macro SUBIRNc 1 ; V
mov eax,[esi] ; Read Source
FETCHPIPE
sub ax,%1
seto byte[SfxOverflow]
setc byte[SfxCarry]
xor byte[SfxCarry],1
inc ebp ; Increase program counter
mov [edi],eax ; Write Destination
mov [SfxSignZero],eax
CLRFLAGS
FXReturn
%endmacro
%macro CMPRNc 1 ; V
mov eax,[esi] ; Read Source
mov ebx,[SfxR0+%1*4]
FETCHPIPE
sub ax,bx
seto byte[SfxOverflow]
setc byte[SfxCarry]
xor byte[SfxCarry],1
mov [SfxSignZero],eax
CLRFLAGS
inc ebp ; Increase program counter
FXReturn
%endmacro
%macro ANDRNc 1 ; V
mov eax,[esi] ; Read Source
mov ebx,[SfxR0+%1*4] ; Read RN
FETCHPIPE
and eax,ebx
inc ebp
mov [SfxSignZero],eax
mov [edi],eax ; Write Destination
CLRFLAGS
FXReturn
%endmacro
%macro BICRNc 1 ; V
mov ebx,[SfxR0+%1*4] ; Read RN
mov eax,[esi] ; Read Source
xor ebx,0FFFFh
FETCHPIPE
and eax,ebx
inc ebp
mov [SfxSignZero],eax
mov [edi],eax ; Write Destination
CLRFLAGS
FXReturn
%endmacro
%macro ANDIRNc 1 ; V
mov eax,[esi] ; Read Source
FETCHPIPE
and eax,%1
inc ebp
mov [SfxSignZero],eax
mov [edi],eax ; Write Destination
CLRFLAGS
FXReturn
%endmacro
%macro BICIRNc 1 ; V
mov eax,[esi] ; Read Source
FETCHPIPE
and eax,%1
inc ebp
mov [SfxSignZero],eax
mov [edi],eax ; Write Destination
CLRFLAGS
FXReturn
%endmacro
%macro MULTRNc 1 ; V
mov al,[esi] ; Read Source
mov bl,[SfxR0+%1*4] ; Read RN
FETCHPIPE
imul bl
inc ebp
and eax,0FFFFh
mov [SfxSignZero],eax
mov [edi],eax ; Write Destination
CLRFLAGS
FXReturn
%endmacro
%macro UMULTRNc 1 ; V
mov al,[esi] ; Read Source
mov bl,[SfxR0+%1*4] ; Read RN
FETCHPIPE
mul bl
inc ebp
and eax,0FFFFh
mov [SfxSignZero],eax
mov [edi],eax ; Write Destination
CLRFLAGS
FXReturn
%endmacro
%macro MULTIRNc 1 ; V
mov al,[esi] ; Read Source
mov bl,%1 ; Read RN
FETCHPIPE
imul bl
inc ebp
and eax,0FFFFh
mov [SfxSignZero],eax
mov [edi],eax ; Write Destination
CLRFLAGS
FXReturn
%endmacro
%macro UMULTIRNc 1 ; V
mov al,[esi] ; Read Source
mov bl,%1 ; Read RN
FETCHPIPE
mul bl
inc ebp
and eax,0FFFFh
mov [SfxSignZero],eax
mov [edi],eax ; Write Destination
CLRFLAGS
FXReturn
%endmacro
%macro LINKc 1 ; Verified.
mov eax,ebp
sub eax,[SfxCPB]
add eax,%1
FETCHPIPE
mov [SfxR11],ax
CLRFLAGS
inc ebp
FXReturn
%endmacro
%macro JMPRNc 1 ; V
FETCHPIPE
mov eax,[SfxR0+%1*4] ; Read RN
mov ebp,[SfxCPB]
add ebp,eax
CLRFLAGS
FXReturn
%endmacro
%macro LJMPRNc 1 ; V
FETCHPIPE
mov eax,[SfxR0+%1*4]
and eax,07Fh
mov [SfxPBR],al
; mov byte[fxtrace+eax],1
mov eax,[SfxMemTable+eax*4]
mov [SfxCPB],eax
mov ebp,eax
add ebp,[esi] ; Read RN
mov dword[SfxCacheActive],0
push ecx
call FxOp02
pop ecx
dec ebp
FXReturn
%endmacro
%macro IBTRNc 1 ; V
movsx eax,byte[ebp]
mov cl,[ebp+1]
add ebp,2
mov [SfxR0+%1*4],ax
CLRFLAGS
FXReturn
%endmacro
%macro LMSRNc 1 ; Verified.
xor eax,eax
mov al,[ebp]
add eax,eax
inc ebp
add eax,[SfxRAMMem]
mov cl,[ebp]
mov [SfxLastRamAdr],eax
mov ebx,[eax] ; Read word from ram
inc ebp
mov [SfxR0+%1*4],bx ; Write data
CLRFLAGS
FXReturn
%endmacro
%macro SMSRNc 1 ; Verified.
xor eax,eax
mov al,[ebp]
inc ebp
add eax,eax
mov cl,[ebp]
add eax,[SfxRAMMem]
mov ebx,[SfxR0+%1*4] ; Read data
mov [SfxLastRamAdr],eax
inc ebp
mov [eax],bx ; Write word to ram
CLRFLAGS
FXReturn
%endmacro
%macro FROMRNd 1 ; V
FETCHPIPE
mov esi,SfxR0+%1*4
inc ebp ; Increase program counter
call [FxTable+ecx*4]
mov esi,SfxR0
FXReturn
%endmacro
%macro ORRNc 1 ; V
mov eax,[esi] ; Read Source
mov ebx,[SfxR0+%1*4] ; Read
FETCHPIPE
or eax,ebx
inc ebp
mov [edi],eax ; Write DREG
mov [SfxSignZero],eax
CLRFLAGS
FXReturn
%endmacro
%macro XORRNc 1 ; V
mov eax,[esi] ; Read Source
mov ebx,[SfxR0+%1*4] ; Read
FETCHPIPE
xor eax,ebx
inc ebp
mov [edi],eax ; Write DREG
mov [SfxSignZero],eax
CLRFLAGS
FXReturn
%endmacro
%macro ORIc 1 ; V
mov eax,[esi] ; Read Source
FETCHPIPE
or eax,%1
inc ebp
mov [edi],eax ; Write DREG
mov [SfxSignZero],eax
CLRFLAGS
FXReturn
%endmacro
%macro XORIc 1 ; V
mov eax,[esi] ; Read Source
FETCHPIPE
xor eax,%1
inc ebp
mov [edi],eax ; Write DREG
mov [SfxSignZero],eax
CLRFLAGS
FXReturn
%endmacro
%macro INCRNc 1 ; Verified
inc word[SfxR0+%1*4]
FETCHPIPE
mov eax,[SfxR0+%1*4] ; Read Source
mov [SfxSignZero],eax
CLRFLAGS
inc ebp
FXReturn
%endmacro
%macro DECRNc 1 ; Verified
dec word[SfxR0+%1*4]
FETCHPIPE
mov eax,[SfxR0+%1*4] ; Read Source
mov [SfxR0+%1*4],eax
mov [SfxSignZero],eax
CLRFLAGS
inc ebp
FXReturn
%endmacro
%macro IWTRNc 1 ; aka LEA ; Verified.
mov eax,[ebp]
mov cl,[ebp+2]
and eax,0FFFFh
add ebp,3
mov [SfxR0+%1*4],eax
CLRFLAGS
FXReturn
%endmacro
%macro LMRNc 1 ; Verified!
xor eax,eax
mov cl,[ebp+2]
mov ax,[ebp]
mov ebx,[SfxRAMMem]
mov [SfxLastRamAdr],eax
add [SfxLastRamAdr],ebx
mov dl,[eax+ebx]
xor eax,1
add ebp,3
mov dh,[eax+ebx]
mov [SfxR0+%1*4],dx ; Store Word
CLRFLAGS
FXReturn
%endmacro
%macro SMRNc 1 ; Verified
mov ebx,[SfxR0+%1*4]
mov eax,[ebp]
mov cl,[ebp+2]
and eax,0FFFFh
mov dx,bx
mov ebx,[SfxRAMMem]
mov [SfxLastRamAdr],eax
add [SfxLastRamAdr],ebx
mov [eax+ebx],dl
xor eax,1
add ebp,3
mov [eax+ebx],dh
CLRFLAGS
FXReturn
%endmacro

3535
zsnes/src/chips/fxtable.asm Normal file

File diff suppressed because it is too large Load Diff

142
zsnes/src/chips/obc1emu.c Normal file
View File

@@ -0,0 +1,142 @@
/*
Copyright (C) 1997-2007 ZSNES Team ( zsKnight, _Demo_, pagefault, Nach )
http://www.zsnes.com
http://sourceforge.net/projects/zsnes
https://zsnes.bountysource.com
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
typedef unsigned char bool8;
typedef unsigned char uint8;
typedef unsigned short uint16;
typedef unsigned int uint32;
typedef char int8;
typedef short int16;
typedef long int32;
//C++ in C
typedef unsigned char bool;
#define true 1
#define false 0
static uint8 *OBC1_RAM = 0;
int OBC1_Address;
int OBC1_BasePtr;
int OBC1_Shift;
uint16 obc1_address;
uint8 obc1_byte;
void GetOBC1 ()
{
switch(obc1_address) {
case 0x7ff0:
obc1_byte = OBC1_RAM[OBC1_BasePtr + (OBC1_Address << 2)];
break;
case 0x7ff1:
obc1_byte = OBC1_RAM[OBC1_BasePtr + (OBC1_Address << 2) + 1];
break;
case 0x7ff2:
obc1_byte = OBC1_RAM[OBC1_BasePtr + (OBC1_Address << 2) + 2];
break;
case 0x7ff3:
obc1_byte = OBC1_RAM[OBC1_BasePtr + (OBC1_Address << 2) + 3];
break;
case 0x7ff4:
obc1_byte = OBC1_RAM[OBC1_BasePtr + (OBC1_Address >> 2) + 0x200];
break;
default:
obc1_byte = OBC1_RAM[obc1_address & 0x1fff];
}
}
void SetOBC1 ()
{
switch(obc1_address) {
case 0x7ff0:
{
OBC1_RAM[OBC1_BasePtr + (OBC1_Address << 2)] = obc1_byte;
break;
}
case 0x7ff1:
{
OBC1_RAM[OBC1_BasePtr + (OBC1_Address << 2) + 1] = obc1_byte;
break;
}
case 0x7ff2:
{
OBC1_RAM[OBC1_BasePtr + (OBC1_Address << 2) + 2] = obc1_byte;
break;
}
case 0x7ff3:
{
OBC1_RAM[OBC1_BasePtr + (OBC1_Address << 2) + 3] = obc1_byte;
break;
}
case 0x7ff4:
{
unsigned char Temp;
Temp = OBC1_RAM[OBC1_BasePtr + (OBC1_Address >> 2) + 0x200];
Temp = (Temp & ~(3 << OBC1_Shift)) | ((obc1_byte & 3) << OBC1_Shift);
OBC1_RAM[OBC1_BasePtr + (OBC1_Address >> 2) + 0x200] = Temp;
break;
}
case 0x7ff5:
{
if (obc1_byte & 1)
OBC1_BasePtr = 0x1800;
else
OBC1_BasePtr = 0x1c00;
break;
}
case 0x7ff6:
{
OBC1_Address = obc1_byte & 0x7f;
OBC1_Shift = (obc1_byte & 3) << 1;
break;
}
}
OBC1_RAM[obc1_address & 0x1fff] = obc1_byte;
}
extern unsigned char *romdata;
void InitOBC1()
{
OBC1_RAM = romdata+0x400000;
if (OBC1_RAM[0x1ff5] & 1)
OBC1_BasePtr = 0x1800;
else
OBC1_BasePtr = 0x1c00;
OBC1_Address = OBC1_RAM[0x1ff6] & 0x7f;
OBC1_Shift = (OBC1_RAM[0x1ff6] & 3) << 1;
}

View File

@@ -0,0 +1,82 @@
;Copyright (C) 1997-2007 ZSNES Team ( zsKnight, _Demo_, pagefault, Nach )
;
;http://www.zsnes.com
;http://sourceforge.net/projects/zsnes
;https://zsnes.bountysource.com
;
;This program is free software; you can redistribute it and/or
;modify it under the terms of the GNU General Public License
;version 2 as published by the Free Software Foundation.
;
;This program is distributed in the hope that it will be useful,
;but WITHOUT ANY WARRANTY; without even the implied warranty of
;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;GNU General Public License for more details.
;
;You should have received a copy of the GNU General Public License
;along with this program; if not, write to the Free Software
;Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
%include "macros.mac"
EXTSYM obc1_address,obc1_byte,SetOBC1,GetOBC1
EXTSYM regaccessbankr16,regaccessbankr8,regaccessbankw16,regaccessbankw8
EXTSYM memaccessbankr16,memaccessbankr8,memaccessbankw16,memaccessbankw8
SECTION .text
%macro RouteAccess 1
test ecx,8000h
jnz memaccessbank%1
cmp ecx,6000h
jb regaccessbank%1
%endmacro
NEWSYM OBC1Read8b
RouteAccess r8
mov [obc1_address],cx
pushad
call GetOBC1
popad
mov al,[obc1_byte]
ret
NEWSYM OBC1Write8b
RouteAccess w8
mov [obc1_address],cx
mov [obc1_byte],al
pushad
call SetOBC1
popad
ret
NEWSYM OBC1Read16b
RouteAccess r16
mov [obc1_address],cx
pushad
call GetOBC1
mov al,[obc1_byte]
mov [obc1temp],al
inc word[obc1_address]
call GetOBC1
popad
mov al,[obc1temp]
mov ah,[obc1_byte]
ret
NEWSYM OBC1Write16b
RouteAccess w16
mov [obc1_address],cx
mov [obc1_byte],al
mov [obc1temp],ah
pushad
call SetOBC1
mov ah,[obc1temp]
mov [obc1_byte],ah
inc word[obc1_address]
call SetOBC1
popad
ret
SECTION .bss
NEWSYM obc1temp, resb 1

363
zsnes/src/chips/sa1proc.asm Normal file
View File

@@ -0,0 +1,363 @@
;Copyright (C) 1997-2007 ZSNES Team ( zsKnight, _Demo_, pagefault, Nach )
;
;http://www.zsnes.com
;http://sourceforge.net/projects/zsnes
;https://zsnes.bountysource.com
;
;This program is free software; you can redistribute it and/or
;modify it under the terms of the GNU General Public License
;version 2 as published by the Free Software Foundation.
;
;This program is distributed in the hope that it will be useful,
;but WITHOUT ANY WARRANTY; without even the implied warranty of
;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;GNU General Public License for more details.
;
;You should have received a copy of the GNU General Public License
;along with this program; if not, write to the Free Software
;Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
%include "macros.mac"
EXTSYM initaddrl,wramdata,IRAM,SA1DoIRQ,SNSRegP,SNSRegPCS
EXTSYM SA1Ptr,SNSPtr,snesmap2,SA1tablead,SA1xpb,SA1RegP,wramdataa,SA1TimerVal
EXTSYM SA1RegPCS,SA1BWPtr,SNSBWPtr,CurBWPtr,SA1NMIV,SA1IRQV
EXTSYM membank0w8,SA1LBound,SA1UBound,SA1SH,SA1SHb,stackor,stackand,snesmmap
EXTSYM SA1xs,SA1IRQExec,SA1Message,Sflagnz,Sflagc,Sflago
; In exec loop, jump to execloop if SA1Status != 0
; *** Disable spc700 if possible ***
SECTION .bss
NEWSYM SA1Status, resb 1 ; 0 = 65816, 1 = SA1A, 2 = SA1B
NEWSYM CurrentExecSA1, resb 1
NEWSYM CurrentCPU, resb 1
;ALIGN32
NEWSYM prevedi, resd 1
SECTION .text
%macro SA1Debugb 0
pushad
sub esi,[initaddrl]
mov [SA1xpc],esi
call nextopcodesa1
popad
mov bl,[esi]
xor dh,dh
inc esi
call dword near [edi+ebx*4]
dec esi
%endmacro
%macro SA1Debug 0
; debug version
test byte[debugds],01h
jz near .nodebug
cmp byte[debuggeron],0
je near .nodebug
SA1Debugb
SA1Debugb
SA1Debugb
SA1Debugb
SA1Debugb
SA1Debugb
SA1Debugb
SA1Debugb
jmp .debug
.nodebug
%endmacro
NEWSYM SA1Swap
mov ecx,[SA1BWPtr]
mov eax,[SA1Ptr] ; small speed hack
test byte[SA1DoIRQ],1
jnz near .sa1exec3
cmp byte[IRAM],0
jne .sa1exec2
cmp dword[eax],0FCF000A5h
je near .nosa1exec
cmp dword[eax-2],0FCF000A5h
je near .nosa1exec
.sa1exec2
cmp byte[SA1SHb],1
je near .nosa1execb
cmp word[ecx+72A4h],0
jnz .sa1exec
cmp dword[eax],0F072A4ADh
je near .nosa1execb
.sa1exec
cmp byte[IRAM+72h],0
jne .sa1exec3
cmp dword[eax],0F03072ADh
je near .nosa1execb
.sa1exec3
.yesdebugr
xor ecx,ecx
; store all snes 65816 stuff
mov [SNSRegP],dl
mov eax,[initaddrl]
mov [prevedi],edi
mov [SNSRegPCS],eax
mov [SNSPtr],esi
; restore all sa1 65816 stuff
mov dl,[SA1RegP]
mov eax,[SA1RegPCS]
mov [initaddrl],eax
mov eax,[SA1BWPtr]
mov [CurBWPtr],eax
mov esi,[SA1Ptr]
mov dword[snesmap2],IRAM
mov dword[wramdata],IRAM
; Check if IRQ is executed on SA-1
xor eax,eax
mov al,dl
add dh,20
mov edi,[SA1tablead+eax*4]
mov byte[SA1Status],1
test dword[SA1DoIRQ],0FF000003h
jnz near .switchirq
.returnirq
; SA1Debug
; cmp byte[SA1SH],1
; je near .speedhack
; non debug version
mov bl,[esi]
inc esi
call dword near [edi+ebx*4]
dec esi
.debug
; store all sa1 65816 stuff
mov [SA1RegP],dl
mov eax,[initaddrl]
mov [SA1RegPCS],eax
mov [SA1Ptr],esi
; restore all snes 65816 stuff
mov dl,[SNSRegP]
mov eax,[SNSRegPCS]
mov [initaddrl],eax
mov eax,[SNSBWPtr]
mov [CurBWPtr],eax
mov dword[wramdata],wramdataa
mov esi,[SNSPtr]
mov eax,[wramdata]
mov [snesmap2],eax
mov edi,[prevedi]
xor eax,eax
add dh,11
inc byte[CurrentExecSA1]
mov byte[SA1Status],0
add dword[SA1TimerVal],23
ret
.speedhack
add dh,90
mov bl,[esi]
inc esi
call dword near [edi+ebx*4]
dec esi
; store all sa1 65816 stuff
mov [SA1RegP],dl
mov eax,[initaddrl]
mov [SA1RegPCS],eax
mov [SA1Ptr],esi
; restore all snes 65816 stuff
mov dl,[SNSRegP]
mov eax,[SNSRegPCS]
mov [initaddrl],eax
mov eax,[SNSBWPtr]
mov [CurBWPtr],eax
mov dword[wramdata],wramdataa
mov esi,[SNSPtr]
mov eax,[wramdata]
mov [snesmap2],eax
mov edi,[prevedi]
xor eax,eax
add byte[CurrentExecSA1],4
mov byte[SA1Status],0
add dword[SA1TimerVal],23
xor dh,dh
mov dh,18
cmp esi,dword[SA1LBound]
jb .stoph
cmp esi,dword[SA1UBound]
ja .stoph
ret
.stoph
mov byte[SA1SH],0
ret
.nosa1execb
xor ecx,ecx
add dh,15
add byte[CurrentExecSA1],2
mov byte[SA1Status],0
ret
.nosa1exec
xor ecx,ecx
add dh,18
add byte[CurrentExecSA1],2
mov byte[SA1Status],0
ret
.switchirq
test dword[SA1DoIRQ],3
jz .notirq
test dword[SA1DoIRQ],1
jz .nmi
and byte[SA1DoIRQ],0FEh
call SA1switchtovirq
jmp .returnirq
.nmi
and byte[SA1DoIRQ],0FDh
call SA1switchtonmi
jmp .returnirq
.notirq
dec byte[SA1DoIRQ+3]
jz .hack
jmp .returnirq
.hack
or byte[SA1DoIRQ],8
jmp .returnirq
SECTION .bss
NEWSYM SA1xpc, resd 1
SECTION .text
%macro makedl 0
and dl,00111100b
test dword[Sflagnz],18000h
jz %%noneg
or dl,80h
%%noneg
test dword[Sflagnz],0FFFFh
jnz %%nozero
or dl,02h
%%nozero
test dword[Sflagc],0FFh
jz %%nocarry
or dl,01h
%%nocarry
test dword[Sflago],0FFh
jz %%nov
or dl,40h
%%nov
%endmacro
NEWSYM SA1switchtonmi
mov al,[SA1Message]
mov [SA1Message+2],al
mov byte[SA1IRQExec+2],1
mov ebx,esi
sub ebx,[initaddrl]
mov [SA1xpc],bx
xor ecx,ecx
mov cx,[SA1xs]
mov al,[SA1xpb]
call membank0w8
dec cx
and cx,word[stackand]
or cx,word[stackor]
mov al,[SA1xpc+1]
call membank0w8
dec cx
and cx,word[stackand]
or cx,word[stackor]
mov al,[SA1xpc]
call membank0w8
dec cx
and cx,word[stackand]
or cx,word[stackor]
makedl
mov al,dl
call membank0w8
dec cx
and cx,word[stackand]
or cx,word[stackor]
mov [SA1xs],cx
xor ebx,ebx
mov [SA1xpb],bl
xor eax,eax
mov ax,[SA1NMIV]
and dl,11110011b
or dl,00000100b
test ax,8000h
jz .loweraddr
mov esi,[snesmmap+ebx*4]
mov [initaddrl],esi
add esi,eax
ret
.loweraddr
mov esi,[snesmap2+ebx*4]
mov [initaddrl],esi
add esi,eax
ret
NEWSYM SA1switchtovirq
mov al,[SA1Message]
mov [SA1Message+2],al
mov byte[SA1IRQExec+1],1
mov ebx,esi
sub ebx,[initaddrl]
mov [SA1xpc],bx
xor ecx,ecx
mov cx,[SA1xs]
mov al,[SA1xpb]
call membank0w8
dec cx
and cx,word[stackand]
or cx,word[stackor]
mov al,[SA1xpc+1]
call membank0w8
dec cx
and cx,word[stackand]
or cx,word[stackor]
mov al,[SA1xpc]
call membank0w8
dec cx
and cx,word[stackand]
or cx,word[stackor]
makedl
mov al,dl
call membank0w8
dec cx
and cx,word[stackand]
or cx,word[stackor]
mov [SA1xs],cx
xor ebx,ebx
mov [SA1xpb],bl
xor eax,eax
mov ax,[SA1IRQV]
and dl,11110011b
or dl,00000100b
test ax,8000h
jz .loweraddr
mov esi,[snesmmap+ebx*4]
mov [initaddrl],esi
add esi,eax
ret
.loweraddr
mov esi,[snesmap2+ebx*4]
mov [initaddrl],esi
add esi,eax
ret

1370
zsnes/src/chips/sa1regs.asm Normal file

File diff suppressed because it is too large Load Diff

271
zsnes/src/chips/sdd1emu.c Normal file
View File

@@ -0,0 +1,271 @@
/*
Copyright (C) 1997-2007 ZSNES Team ( zsKnight, _Demo_, pagefault, Nach )
http://www.zsnes.com
http://sourceforge.net/projects/zsnes
https://zsnes.bountysource.com
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/*******************************************************************************
S-DD1 C emulator code
(c) Copyright 2003 Brad Jorsch with research by
Andreas Naive and John Weidman
*******************************************************************************/
/* S-DD1 decompressor
*
* Based on code and documentation by Andreas Naive, who deserves a great deal
* of thanks and credit for figuring this out.
*
* Andreas says:
* The author is greatly indebted with The Dumper, without whose help and
* patience providing him with real S-DD1 data the research had never been
* possible. He also wish to note that in the very beggining of his research,
* Neviksti had done some steps in the right direction. By last, the author is
* indirectly indebted to all the people that worked and contributed in the
* S-DD1 issue in the past.
*/
#include <string.h>
#ifndef __GNUC__
#define INLINE
#else
#define INLINE static inline
#endif
static int valid_bits;
static unsigned short in_stream;
static unsigned char *in_buf;
static unsigned char bit_ctr[8];
static unsigned char context_states[32];
static int context_MPS[32];
static int bitplane_type;
static int high_context_bits;
static int low_context_bits;
static int prev_bits[8];
static struct {
unsigned char code_size;
unsigned char MPS_next;
unsigned char LPS_next;
} evolution_table[] = {
/* 0 */ { 0,25,25},
/* 1 */ { 0, 2, 1},
/* 2 */ { 0, 3, 1},
/* 3 */ { 0, 4, 2},
/* 4 */ { 0, 5, 3},
/* 5 */ { 1, 6, 4},
/* 6 */ { 1, 7, 5},
/* 7 */ { 1, 8, 6},
/* 8 */ { 1, 9, 7},
/* 9 */ { 2,10, 8},
/* 10 */ { 2,11, 9},
/* 11 */ { 2,12,10},
/* 12 */ { 2,13,11},
/* 13 */ { 3,14,12},
/* 14 */ { 3,15,13},
/* 15 */ { 3,16,14},
/* 16 */ { 3,17,15},
/* 17 */ { 4,18,16},
/* 18 */ { 4,19,17},
/* 19 */ { 5,20,18},
/* 20 */ { 5,21,19},
/* 21 */ { 6,22,20},
/* 22 */ { 6,23,21},
/* 23 */ { 7,24,22},
/* 24 */ { 7,24,23},
/* 25 */ { 0,26, 1},
/* 26 */ { 1,27, 2},
/* 27 */ { 2,28, 4},
/* 28 */ { 3,29, 8},
/* 29 */ { 4,30,12},
/* 30 */ { 5,31,16},
/* 31 */ { 6,32,18},
/* 32 */ { 7,24,22}
};
static unsigned char run_table[128] = {
128, 64, 96, 32, 112, 48, 80, 16, 120, 56, 88, 24, 104, 40, 72,
8, 124, 60, 92, 28, 108, 44, 76, 12, 116, 52, 84, 20, 100, 36,
68, 4, 126, 62, 94, 30, 110, 46, 78, 14, 118, 54, 86, 22, 102,
38, 70, 6, 122, 58, 90, 26, 106, 42, 74, 10, 114, 50, 82, 18,
98, 34, 66, 2, 127, 63, 95, 31, 111, 47, 79, 15, 119, 55, 87,
23, 103, 39, 71, 7, 123, 59, 91, 27, 107, 43, 75, 11, 115, 51,
83, 19, 99, 35, 67, 3, 125, 61, 93, 29, 109, 45, 77, 13, 117,
53, 85, 21, 101, 37, 69, 5, 121, 57, 89, 25, 105, 41, 73, 9,
113, 49, 81, 17, 97, 33, 65, 1
};
INLINE unsigned char GetCodeword(int bits){
unsigned char tmp;
if(!valid_bits){
in_stream|=*(in_buf++);
valid_bits=8;
}
in_stream<<=1;
valid_bits--;
in_stream^=0x8000;
if(in_stream&0x8000) return 0x80+(1<<bits);
tmp=(in_stream>>8) | (0x7f>>bits);
in_stream<<=bits;
valid_bits-=bits;
if(valid_bits<0){
in_stream |= (*(in_buf++))<<(-valid_bits);
valid_bits+=8;
}
return run_table[tmp];
}
INLINE unsigned char GolombGetBit(int code_size){
if(!bit_ctr[code_size]) bit_ctr[code_size]=GetCodeword(code_size);
bit_ctr[code_size]--;
if(bit_ctr[code_size]==0x80){
bit_ctr[code_size]=0;
return 2; /* secret code for 'last zero'. ones are always last. */
}
return (bit_ctr[code_size]==0)?1:0;
}
INLINE unsigned char ProbGetBit(unsigned char context){
unsigned char state=context_states[context];
unsigned char bit=GolombGetBit(evolution_table[state].code_size);
if(bit&1){
context_states[context]=evolution_table[state].LPS_next;
if(state<2){
context_MPS[context]^=1;
return context_MPS[context]; /* just inverted, so just return it */
} else{
return context_MPS[context]^1; /* we know bit is 1, so use a constant */
}
} else if(bit){
context_states[context]=evolution_table[state].MPS_next;
/* zero here, zero there, no difference so drop through. */
}
return context_MPS[context]; /* we know bit is 0, so don't bother xoring */
}
INLINE unsigned char GetBit(unsigned char cur_bitplane){
unsigned char bit;
bit=ProbGetBit(((cur_bitplane&1)<<4)
| ((prev_bits[cur_bitplane]&high_context_bits)>>5)
| (prev_bits[cur_bitplane]&low_context_bits));
prev_bits[cur_bitplane] <<= 1;
prev_bits[cur_bitplane] |= bit;
return bit;
}
static unsigned char cur_plane;
static unsigned char num_bits;
static unsigned char next_byte;
void SDD1_init(unsigned char *in){
bitplane_type=in[0]>>6;
switch(in[0]&0x30){
case 0x00:
high_context_bits=0x01c0;
low_context_bits =0x0001;
break;
case 0x10:
high_context_bits=0x0180;
low_context_bits =0x0001;
break;
case 0x20:
high_context_bits=0x00c0;
low_context_bits =0x0001;
break;
case 0x30:
high_context_bits=0x0180;
low_context_bits =0x0003;
break;
}
in_stream=(in[0]<<11) | (in[1]<<3);
valid_bits=5;
in_buf=in+2;
memset(bit_ctr, 0, sizeof(bit_ctr));
memset(context_states, 0, sizeof(context_states));
memset(context_MPS, 0, sizeof(context_MPS));
memset(prev_bits, 0, sizeof(prev_bits));
cur_plane=0;
num_bits=0;
}
unsigned char SDD1_get_byte(void){
unsigned char bit;
unsigned char byte=0;
switch(bitplane_type){
case 0:
num_bits+=16;
if(num_bits&16){
next_byte=0;
for(bit=0x80; bit; bit>>=1){
if(GetBit(0)) byte |= bit;
if(GetBit(1)) next_byte |= bit;
}
return byte;
} else {
return next_byte;
}
case 1:
num_bits+=16;
if(num_bits&16){
next_byte=0;
for(bit=0x80; bit; bit>>=1){
if(GetBit(cur_plane)) byte |= bit;
if(GetBit(cur_plane+1)) next_byte |= bit;
}
return byte;
} else {
if(!num_bits) cur_plane = (cur_plane+2)&7;
return next_byte;
}
case 2:
num_bits+=16;
if(num_bits&16){
next_byte=0;
for(bit=0x80; bit; bit>>=1){
if(GetBit(cur_plane)) byte |= bit;
if(GetBit(cur_plane+1)) next_byte |= bit;
}
return byte;
} else {
if(!num_bits) cur_plane ^= 2;
return next_byte;
}
case 3:
for(cur_plane=0, bit=1; bit; bit<<=1, cur_plane++){
if(GetBit(cur_plane)) byte |= bit;
}
return byte;
default:
/* should never happen */
return 0;
}
}

566
zsnes/src/chips/seta10.c Normal file
View File

@@ -0,0 +1,566 @@
/*
Copyright (C) 1997-2007 ZSNES Team ( zsKnight, _Demo_, pagefault, Nach )
http://www.zsnes.com
http://sourceforge.net/projects/zsnes
https://zsnes.bountysource.com
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
//http://users.tpg.com.au/trauma/dsp/st010.html
#ifdef __UNIXSDL__
#include "gblhdr.h"
#else
#include <math.h> //sqrt()
#include <stdlib.h> //abs()
#endif
#define SRAM setaramdata
extern unsigned char *setaramdata;
void ST010DoCommand(void);
//C++ style code in C
#define bool unsigned char
#define true 1
#define false 0
typedef signed char int8;
typedef unsigned char uint8;
typedef short int16;
typedef unsigned short uint16;
typedef int int32;
typedef unsigned int uint32;
// Mode 7 scaling constants for all raster lines
const int16 ST010_M7Scale[176] = {
0x0380, 0x0325, 0x02da, 0x029c, 0x0268, 0x023b, 0x0215, 0x01f3,
0x01d5, 0x01bb, 0x01a3, 0x018e, 0x017b, 0x016a, 0x015a, 0x014b,
0x013e, 0x0132, 0x0126, 0x011c, 0x0112, 0x0109, 0x0100, 0x00f8,
0x00f0, 0x00e9, 0x00e3, 0x00dc, 0x00d6, 0x00d1, 0x00cb, 0x00c6,
0x00c1, 0x00bd, 0x00b8, 0x00b4, 0x00b0, 0x00ac, 0x00a8, 0x00a5,
0x00a2, 0x009e, 0x009b, 0x0098, 0x0095, 0x0093, 0x0090, 0x008d,
0x008b, 0x0088, 0x0086, 0x0084, 0x0082, 0x0080, 0x007e, 0x007c,
0x007a, 0x0078, 0x0076, 0x0074, 0x0073, 0x0071, 0x006f, 0x006e,
0x006c, 0x006b, 0x0069, 0x0068, 0x0067, 0x0065, 0x0064, 0x0063,
0x0062, 0x0060, 0x005f, 0x005e, 0x005d, 0x005c, 0x005b, 0x005a,
0x0059, 0x0058, 0x0057, 0x0056, 0x0055, 0x0054, 0x0053, 0x0052,
0x0051, 0x0051, 0x0050, 0x004f, 0x004e, 0x004d, 0x004d, 0x004c,
0x004b, 0x004b, 0x004a, 0x0049, 0x0048, 0x0048, 0x0047, 0x0047,
0x0046, 0x0045, 0x0045, 0x0044, 0x0044, 0x0043, 0x0042, 0x0042,
0x0041, 0x0041, 0x0040, 0x0040, 0x003f, 0x003f, 0x003e, 0x003e,
0x003d, 0x003d, 0x003c, 0x003c, 0x003b, 0x003b, 0x003a, 0x003a,
0x003a, 0x0039, 0x0039, 0x0038, 0x0038, 0x0038, 0x0037, 0x0037,
0x0036, 0x0036, 0x0036, 0x0035, 0x0035, 0x0035, 0x0034, 0x0034,
0x0034, 0x0033, 0x0033, 0x0033, 0x0032, 0x0032, 0x0032, 0x0031,
0x0031, 0x0031, 0x0030, 0x0030, 0x0030, 0x0030, 0x002f, 0x002f,
0x002f, 0x002e, 0x002e, 0x002e, 0x002e, 0x002d, 0x002d, 0x002d,
0x002d, 0x002c, 0x002c, 0x002c, 0x002c, 0x002b, 0x002b, 0x002b
};
const int16 ST010_SinTable[256] = {
0x0000, 0x0324, 0x0648, 0x096a, 0x0c8c, 0x0fab, 0x12c8, 0x15e2,
0x18f9, 0x1c0b, 0x1f1a, 0x2223, 0x2528, 0x2826, 0x2b1f, 0x2e11,
0x30fb, 0x33df, 0x36ba, 0x398c, 0x3c56, 0x3f17, 0x41ce, 0x447a,
0x471c, 0x49b4, 0x4c3f, 0x4ebf, 0x5133, 0x539b, 0x55f5, 0x5842,
0x5a82, 0x5cb3, 0x5ed7, 0x60eb, 0x62f1, 0x64e8, 0x66cf, 0x68a6,
0x6a6d, 0x6c23, 0x6dc9, 0x6f5e, 0x70e2, 0x7254, 0x73b5, 0x7504,
0x7641, 0x776b, 0x7884, 0x7989, 0x7a7c, 0x7b5c, 0x7c29, 0x7ce3,
0x7d89, 0x7e1d, 0x7e9c, 0x7f09, 0x7f61, 0x7fa6, 0x7fd8, 0x7ff5,
0x7fff, 0x7ff5, 0x7fd8, 0x7fa6, 0x7f61, 0x7f09, 0x7e9c, 0x7e1d,
0x7d89, 0x7ce3, 0x7c29, 0x7b5c, 0x7a7c, 0x7989, 0x7884, 0x776b,
0x7641, 0x7504, 0x73b5, 0x7254, 0x70e2, 0x6f5e, 0x6dc9, 0x6c23,
0x6a6d, 0x68a6, 0x66cf, 0x64e8, 0x62f1, 0x60eb, 0x5ed7, 0x5cb3,
0x5a82, 0x5842, 0x55f5, 0x539b, 0x5133, 0x4ebf, 0x4c3f, 0x49b4,
0x471c, 0x447a, 0x41ce, 0x3f17, 0x3c56, 0x398c, 0x36ba, 0x33df,
0x30fb, 0x2e11, 0x2b1f, 0x2826, 0x2528, 0x2223, 0x1f1a, 0x1c0b,
0x18f8, 0x15e2, 0x12c8, 0x0fab, 0x0c8c, 0x096a, 0x0648, 0x0324,
0x0000, -0x0324, -0x0648, -0x096b, -0x0c8c, -0x0fab, -0x12c8, -0x15e2,
-0x18f9, -0x1c0b, -0x1f1a, -0x2223, -0x2528, -0x2826, -0x2b1f, -0x2e11,
-0x30fb, -0x33df, -0x36ba, -0x398d, -0x3c56, -0x3f17, -0x41ce, -0x447a,
-0x471c, -0x49b4, -0x4c3f, -0x4ebf, -0x5133, -0x539b, -0x55f5, -0x5842,
-0x5a82, -0x5cb3, -0x5ed7, -0x60ec, -0x62f1, -0x64e8, -0x66cf, -0x68a6,
-0x6a6d, -0x6c23, -0x6dc9, -0x6f5e, -0x70e2, -0x7254, -0x73b5, -0x7504,
-0x7641, -0x776b, -0x7884, -0x7989, -0x7a7c, -0x7b5c, -0x7c29, -0x7ce3,
-0x7d89, -0x7e1d, -0x7e9c, -0x7f09, -0x7f61, -0x7fa6, -0x7fd8, -0x7ff5,
-0x7fff, -0x7ff5, -0x7fd8, -0x7fa6, -0x7f61, -0x7f09, -0x7e9c, -0x7e1d,
-0x7d89, -0x7ce3, -0x7c29, -0x7b5c, -0x7a7c, -0x7989, -0x7883, -0x776b,
-0x7641, -0x7504, -0x73b5, -0x7254, -0x70e2, -0x6f5e, -0x6dc9, -0x6c23,
-0x6a6d, -0x68a6, -0x66cf, -0x64e8, -0x62f1, -0x60eb, -0x5ed7, -0x5cb3,
-0x5a82, -0x5842, -0x55f5, -0x539a, -0x5133, -0x4ebf, -0x4c3f, -0x49b3,
-0x471c, -0x447a, -0x41cd, -0x3f17, -0x3c56, -0x398c, -0x36b9, -0x33de,
-0x30fb, -0x2e10, -0x2b1f, -0x2826, -0x2527, -0x2223, -0x1f19, -0x1c0b,
-0x18f8, -0x15e2, -0x12c8, -0x0fab, -0x0c8b, -0x096a, -0x0647, -0x0324};
const unsigned char ST010_ArcTan[32][32] = {
{ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80},
{ 0x80, 0xa0, 0xad, 0xb3, 0xb6, 0xb8, 0xb9, 0xba, 0xbb, 0xbb, 0xbc, 0xbc, 0xbd, 0xbd, 0xbd, 0xbd,
0xbd, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbf, 0xbf, 0xbf, 0xbf},
{ 0x80, 0x93, 0xa0, 0xa8, 0xad, 0xb0, 0xb3, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xb9, 0xba, 0xba, 0xbb,
0xbb, 0xbb, 0xbb, 0xbc, 0xbc, 0xbc, 0xbc, 0xbc, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd, 0xbd},
{ 0x80, 0x8d, 0x98, 0xa0, 0xa6, 0xaa, 0xad, 0xb0, 0xb1, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb7, 0xb8,
0xb8, 0xb9, 0xb9, 0xba, 0xba, 0xba, 0xba, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbc, 0xbc, 0xbc, 0xbc},
{ 0x80, 0x8a, 0x93, 0x9a, 0xa0, 0xa5, 0xa8, 0xab, 0xad, 0xaf, 0xb0, 0xb2, 0xb3, 0xb4, 0xb5, 0xb5,
0xb6, 0xb7, 0xb7, 0xb8, 0xb8, 0xb8, 0xb9, 0xb9, 0xb9, 0xba, 0xba, 0xba, 0xba, 0xba, 0xbb, 0xbb},
{ 0x80, 0x88, 0x90, 0x96, 0x9b, 0xa0, 0xa4, 0xa7, 0xa9, 0xab, 0xad, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3,
0xb4, 0xb4, 0xb5, 0xb6, 0xb6, 0xb6, 0xb7, 0xb7, 0xb8, 0xb8, 0xb8, 0xb9, 0xb9, 0xb9, 0xb9, 0xb9},
{ 0x80, 0x87, 0x8d, 0x93, 0x98, 0x9c, 0xa0, 0xa3, 0xa6, 0xa8, 0xaa, 0xac, 0xad, 0xae, 0xb0, 0xb0,
0xb1, 0xb2, 0xb3, 0xb4, 0xb4, 0xb5, 0xb5, 0xb6, 0xb6, 0xb6, 0xb7, 0xb7, 0xb7, 0xb8, 0xb8, 0xb8},
{ 0x80, 0x86, 0x8b, 0x90, 0x95, 0x99, 0x9d, 0xa0, 0xa3, 0xa5, 0xa7, 0xa9, 0xaa, 0xac, 0xad, 0xae,
0xaf, 0xb0, 0xb1, 0xb2, 0xb2, 0xb3, 0xb3, 0xb4, 0xb4, 0xb5, 0xb5, 0xb6, 0xb6, 0xb6, 0xb7, 0xb7},
{ 0x80, 0x85, 0x8a, 0x8f, 0x93, 0x97, 0x9a, 0x9d, 0xa0, 0xa2, 0xa5, 0xa6, 0xa8, 0xaa, 0xab, 0xac,
0xad, 0xae, 0xaf, 0xb0, 0xb0, 0xb1, 0xb2, 0xb2, 0xb3, 0xb3, 0xb4, 0xb4, 0xb5, 0xb5, 0xb5, 0xb5},
{ 0x80, 0x85, 0x89, 0x8d, 0x91, 0x95, 0x98, 0x9b, 0x9e, 0xa0, 0xa0, 0xa4, 0xa6, 0xa7, 0xa9, 0xaa,
0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb0, 0xb1, 0xb1, 0xb2, 0xb2, 0xb3, 0xb3, 0xb4, 0xb4, 0xb4},
{ 0x80, 0x84, 0x88, 0x8c, 0x90, 0x93, 0x96, 0x99, 0x9b, 0x9e, 0xa0, 0xa2, 0xa4, 0xa5, 0xa7, 0xa8,
0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xaf, 0xb0, 0xb0, 0xb1, 0xb2, 0xb2, 0xb2, 0xb3, 0xb3},
{ 0x80, 0x84, 0x87, 0x8b, 0x8e, 0x91, 0x94, 0x97, 0x9a, 0x9c, 0x9e, 0xa0, 0xa2, 0xa3, 0xa5, 0xa6,
0xa7, 0xa9, 0xaa, 0xab, 0xac, 0xac, 0xad, 0xae, 0xae, 0xaf, 0xb0, 0xb0, 0xb1, 0xb1, 0xb2, 0xb2},
{ 0x80, 0x83, 0x87, 0x8a, 0x8d, 0x90, 0x93, 0x96, 0x98, 0x9a, 0x9c, 0x9e, 0xa0, 0xa2, 0xa3, 0xa5,
0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xac, 0xad, 0xae, 0xae, 0xaf, 0xb0, 0xb0, 0xb0, 0xb1},
{ 0x80, 0x83, 0x86, 0x89, 0x8c, 0x8f, 0x92, 0x94, 0x96, 0x99, 0x9b, 0x9d, 0x9e, 0xa0, 0xa2, 0xa3,
0xa4, 0xa5, 0xa7, 0xa8, 0xa9, 0xa9, 0xaa, 0xab, 0xac, 0xac, 0xad, 0xae, 0xae, 0xaf, 0xaf, 0xb0},
{ 0x80, 0x83, 0x86, 0x89, 0x8b, 0x8e, 0x90, 0x93, 0x95, 0x97, 0x99, 0x9b, 0x9d, 0x9e, 0xa0, 0xa1,
0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xaa, 0xab, 0xac, 0xad, 0xad, 0xae, 0xae, 0xaf},
{ 0x80, 0x83, 0x85, 0x88, 0x8b, 0x8d, 0x90, 0x92, 0x94, 0x96, 0x98, 0x9a, 0x9b, 0x9d, 0x9f, 0xa0,
0xa1, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa8, 0xa9, 0xaa, 0xab, 0xab, 0xac, 0xad, 0xad, 0xae},
{ 0x80, 0x83, 0x85, 0x88, 0x8a, 0x8c, 0x8f, 0x91, 0x93, 0x95, 0x97, 0x99, 0x9a, 0x9c, 0x9d, 0x9f,
0xa0, 0xa1, 0xa2, 0xa3, 0xa5, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xaa, 0xab, 0xab, 0xac, 0xad},
{ 0x80, 0x82, 0x85, 0x87, 0x89, 0x8c, 0x8e, 0x90, 0x92, 0x94, 0x96, 0x97, 0x99, 0x9b, 0x9c, 0x9d,
0x9f, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa8, 0xa9, 0xaa, 0xaa, 0xab, 0xac},
{ 0x80, 0x82, 0x85, 0x87, 0x89, 0x8b, 0x8d, 0x8f, 0x91, 0x93, 0x95, 0x96, 0x98, 0x99, 0x9b, 0x9c,
0x9e, 0x9f, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa7, 0xa8, 0xa9, 0xa9, 0xaa, 0xab},
{ 0x80, 0x82, 0x84, 0x86, 0x88, 0x8a, 0x8c, 0x8e, 0x90, 0x92, 0x94, 0x95, 0x97, 0x98, 0x9a, 0x9b,
0x9d, 0x9e, 0x9f, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa6, 0xa7, 0xa8, 0xa8, 0xa9, 0xaa},
{ 0x80, 0x82, 0x84, 0x86, 0x88, 0x8a, 0x8c, 0x8e, 0x90, 0x91, 0x93, 0x94, 0x96, 0x97, 0x99, 0x9a,
0x9b, 0x9d, 0x9e, 0x9f, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa5, 0xa6, 0xa7, 0xa7, 0xa8, 0xa9},
{ 0x80, 0x82, 0x84, 0x86, 0x88, 0x8a, 0x8b, 0x8d, 0x8f, 0x90, 0x92, 0x94, 0x95, 0x97, 0x98, 0x99,
0x9b, 0x9c, 0x9d, 0x9e, 0x9f, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa4, 0xa5, 0xa6, 0xa6, 0xa7, 0xa8},
{ 0x80, 0x82, 0x84, 0x86, 0x87, 0x89, 0x8b, 0x8d, 0x8e, 0x90, 0x91, 0x93, 0x94, 0x96, 0x97, 0x98,
0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, 0xa0, 0xa1, 0xa2, 0xa3, 0xa3, 0xa4, 0xa5, 0xa6, 0xa6, 0xa7},
{ 0x80, 0x82, 0x84, 0x85, 0x87, 0x89, 0x8a, 0x8c, 0x8e, 0x8f, 0x91, 0x92, 0x94, 0x95, 0x96, 0x98,
0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, 0xa0, 0xa1, 0xa2, 0xa2, 0xa3, 0xa4, 0xa5, 0xa5, 0xa6},
{ 0x80, 0x82, 0x83, 0x85, 0x87, 0x88, 0x8a, 0x8c, 0x8d, 0x8f, 0x90, 0x92, 0x93, 0x94, 0x96, 0x97,
0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, 0xa0, 0xa1, 0xa2, 0xa2, 0xa3, 0xa4, 0xa5, 0xa5},
{ 0x80, 0x82, 0x83, 0x85, 0x86, 0x88, 0x8a, 0x8b, 0x8d, 0x8e, 0x90, 0x91, 0x92, 0x94, 0x95, 0x96,
0x97, 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, 0xa0, 0xa1, 0xa2, 0xa2, 0xa3, 0xa4, 0xa4},
{ 0x80, 0x82, 0x83, 0x85, 0x86, 0x88, 0x89, 0x8b, 0x8c, 0x8e, 0x8f, 0x90, 0x92, 0x93, 0x94, 0x95,
0x96, 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9e, 0x9f, 0xa0, 0xa1, 0xa2, 0xa2, 0xa3, 0xa4},
{ 0x80, 0x82, 0x83, 0x85, 0x86, 0x87, 0x89, 0x8a, 0x8c, 0x8d, 0x8e, 0x90, 0x91, 0x92, 0x93, 0x95,
0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9e, 0x9f, 0xa0, 0xa1, 0xa1, 0xa2, 0xa3},
{ 0x80, 0x81, 0x83, 0x84, 0x86, 0x87, 0x89, 0x8a, 0x8b, 0x8d, 0x8e, 0x8f, 0x90, 0x92, 0x93, 0x94,
0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9e, 0x9f, 0xa0, 0xa1, 0xa1, 0xa2},
{ 0x80, 0x81, 0x83, 0x84, 0x86, 0x87, 0x88, 0x8a, 0x8b, 0x8c, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93,
0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, 0x9f, 0xa0, 0xa1, 0xa1},
{ 0x80, 0x81, 0x83, 0x84, 0x85, 0x87, 0x88, 0x89, 0x8b, 0x8c, 0x8d, 0x8e, 0x90, 0x91, 0x92, 0x93,
0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, 0x9f, 0xa0, 0xa1},
{ 0x80, 0x81, 0x83, 0x84, 0x85, 0x87, 0x88, 0x89, 0x8a, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92,
0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9c, 0x9d, 0x9e, 0x9f, 0x9f, 0xa0}};
short ST010_Sin(short Theta)
{
return ST010_SinTable[(Theta >> 8) & 0xff];
}
short ST010_Cos(short Theta)
{
return ST010_SinTable[((Theta + 0x4000) >> 8) & 0xff];
}
void ST010_OP01(short x0, short y0, short *x1, short *y1, short *Quadrant, short *Theta)
{
if ((x0 < 0) && (y0 < 0))
{
*x1 = -x0;
*y1 = -y0;
*Quadrant = -0x8000;
}
else if (x0 < 0)
{
*x1 = y0;
*y1 = -x0;
*Quadrant = -0x4000;
}
else if (y0 < 0)
{
*x1 = -y0;
*y1 = x0;
*Quadrant = 0x4000;
}
else
{
*x1 = x0;
*y1 = y0;
*Quadrant = 0x0000;
}
while ((*x1 > 0x1f) || (*y1 > 0x1f))
{
if (*x1 > 1) *x1 >>= 1;
if (*y1 > 1) *y1 >>= 1;
}
if (*y1 == 0) *Quadrant += 0x4000;
*Theta = (ST010_ArcTan[*y1][*x1] << 8) ^ *Quadrant;
}
void ST010_Scale(short Multiplier, short X0, short Y0, int *X1, int *Y1)
{
*X1 = X0 * Multiplier << 1;
*Y1 = Y0 * Multiplier << 1;
}
void ST010_Multiply(short Multiplicand, short Multiplier, int *Product)
{
*Product = Multiplicand * Multiplier << 1;
}
void ST010_Rotate(short Theta, short X0, short Y0, short *X1, short *Y1)
{
*X1 = (Y0 * ST010_Sin(Theta) >> 15) + (X0 * ST010_Cos(Theta) >> 15);
*Y1 = (Y0 * ST010_Cos(Theta) >> 15) - (X0 * ST010_Sin(Theta) >> 15);
}
void ST010_SortDrivers(uint16 Positions, uint16 Places[32], uint16 Drivers[32])
{
bool Sorted;
uint16 Temp;
if (Positions > 1)
{
do
{
int i;
Sorted = true;
for (i = 0; i < Positions - 1; i++)
{
if (Places[i] < Places[i + 1])
{
Temp = Places[i + 1];
Places[i + 1] = Places[i];
Places[i] = Temp;
Temp = Drivers[i + 1];
Drivers[i + 1] = Drivers[i];
Drivers[i] = Temp;
Sorted = false;
}
}
Positions--;
} while (!Sorted);
}
}
#define ST010_WORD(offset) (*((short *)(SRAM+offset)))
//#define ST010_WORD(offset) (SRAM[offset + 1] << 8) | SRAM[offset]
void ST010DoCommand(void)
{
switch(SRAM[0x20])
{
/*
Calculate track data based on direction coords
Input
0x0000-0x0001 : DX (signed)
0x0002-0x0003 : DY (signed)
Output
0x0010-0x0011 : Angle (signed)
*/
case 0x01:
{
SRAM[0x0006] = SRAM[0x0002];
SRAM[0x0007] = SRAM[0x0003];
ST010_OP01(*(short*)&SRAM[0x0000], *(short*)&SRAM[0x0002], (short *)SRAM, (short *)&SRAM[2], (short *)&SRAM[4], (short *)&SRAM[0x10]);
}
break;
//Sorts a bunch of values by weight
case 0x02:
{
ST010_SortDrivers(*(short*)&SRAM[0x0024], (uint16*)&SRAM[0x0040], (uint16*)&SRAM[0x0080]);
}
break;
/*
Two Dimensional Coordinate Scale
Input
0x0000-0x0001 : X0 (signed)
0x0002-0x0003 : Y0 (signed)
0x0004-0x0005 : Multiplier (signed)
Output
0x0010-0x0013 : X1 (signed)
0x0014-0x0017 : Y1 (signed)
*/
case 0x03:
{
ST010_Scale(*(short*)&SRAM[0x0004], *(short*)&SRAM[0x0000], *(short*)&SRAM[0x0002], (int *)&SRAM[0x10], (int *)&SRAM[0x14]);
}
break;
//Calculate the vector length of (x,y)
case 0x04:
{
int16 square, x,y;
x=*((int16*)SRAM);
y=*((int16*)&SRAM[2]);
square=(int16)sqrt((double)(y*y+x*x));
*((int16*)&SRAM[0x10])=square;
break;
}
//Calculate AI orientation based on specific guidelines
case 0x05:
{
int dx,dy;
int16 a1,b1,c1;
uint16 o1;
bool wrap=false;
//Target (x,y) coordinates
int16 ypos_max = ST010_WORD(0x00C0);
int16 xpos_max = ST010_WORD(0x00C2);
//Current coordinates and direction
int32 ypos = SRAM[0xC4]|(SRAM[0xC5]<<8)|(SRAM[0xC6]<<16)|(SRAM[0xC7]<<24);
int32 xpos = SRAM[0xC8]|(SRAM[0xC9]<<8)|(SRAM[0xCA]<<16)|(SRAM[0xCB]<<24);
uint16 rot = SRAM[0xCC]|(SRAM[0xCD]<<8);
//Physics
uint16 speed = ST010_WORD(0x00D4);
uint16 accel = ST010_WORD(0x00D6);
uint16 speed_max = ST010_WORD(0x00D8);
//Special condition acknowledgment
int16 system = ST010_WORD(0x00DA);
int16 flags = ST010_WORD(0x00DC);
//New target coordinates
int16 ypos_new = ST010_WORD(0x00DE);
int16 xpos_new = ST010_WORD(0x00E0);
//Backup speed
uint16 old_speed = speed;
//Mask upper bit
xpos_new &= 0x7FFF;
//Get the current distance
dx = xpos_max-(xpos>>16);
dy = ypos_max-(ypos>>16);
//Quirk: clear and move in9
SRAM[0xD2]=0xFF;
SRAM[0xD3]=0xFF;
SRAM[0xDA]=0;
SRAM[0xDB]=0;
//Grab the target angle
ST010_OP01(dy,dx,&a1,&b1,&c1,(int16 *)&o1);
//Check for wrapping
if (abs(o1-rot)>0x8000)
{
o1+=0x8000;
rot+=0x8000;
wrap=true;
}
//Special case
if (abs(o1-rot)==0x8000)
{
speed = 0x100;
}
//Slow down for sharp curves
else if (abs(o1-rot)>=0x1000)
{
uint32 slow = abs(o1-rot);
slow >>= 4; //Scaling
speed -= slow;
}
//Otherwise accelerate
else
{
speed += accel;
if (speed > speed_max)
{
//Clip speed
speed = speed_max;
}
}
//Prevent negative/positive overflow
if( abs(old_speed-speed)>0x8000)
{
if (old_speed<speed) { speed=0; }
else { speed=0xff00; }
}
//Adjust direction by so many degrees
//Be careful of negative adjustments
if ((o1>rot && (o1-rot)>0x80) || (o1<rot && (rot-o1)>=0x80))
{
if (o1<rot) { rot-=0x280; }
else if (o1>rot) { rot+=0x280; }
}
//Turn off wrapping
if (wrap) { rot-=0x8000; }
//Now check the distances (store for later)
dx = (xpos_max<<16)-xpos;
dy = (ypos_max<<16)-ypos;
dx>>=16;
dy>>=16;
//If we're in so many units of the target, signal it
if ((system && (dy<=6 && dy>=-8) && (dx<=126 && dx>=-128)) ||
(!system && (dx<=6 && dx>=-8) && (dy<=126 && dy>=-128)))
{
//Announce our new destination and flag it
xpos_max = xpos_new&0x7FFF;
ypos_max = ypos_new;
flags |= 0x08;
}
//Update position
xpos -= (ST010_Cos(rot) * 0x400 >> 15) * (speed >> 8) << 1;
ypos -= (ST010_Sin(rot) * 0x400 >> 15) * (speed >> 8) << 1;
//Quirk: mask upper byte
xpos &= 0x1FFFFFFF;
ypos &= 0x1FFFFFFF;
SRAM[0x00C0]=(uint8)(ypos_max);
SRAM[0x00C1]=(uint8)(ypos_max >> 8);
SRAM[0x00C2]=(uint8)(xpos_max);
SRAM[0x00C3]=(uint8)(xpos_max >> 8);
SRAM[0x00C4]=(uint8)(ypos);
SRAM[0x00C5]=(uint8)(ypos >> 8);
SRAM[0x00C6]=(uint8)(ypos >> 16);
SRAM[0x00C7]=(uint8)(ypos >> 24);
SRAM[0x00C8]=(uint8)(xpos);
SRAM[0x00C9]=(uint8)(xpos >> 8);
SRAM[0x00CA]=(uint8)(xpos >> 16);
SRAM[0x00CB]=(uint8)(xpos >> 24);
SRAM[0x00CC]=(uint8)(rot);
SRAM[0x00CD]=(uint8)(rot >> 8);
SRAM[0x00D4]=(uint8)(speed);
SRAM[0x00D5]=(uint8)(speed >> 8);
SRAM[0x00DC]=(uint8)(flags);
SRAM[0x00DD]=(uint8)(flags >> 8);
}
break;
/*
16-bit Multiplication
Input
0x0000-0x0001 : Multiplcand (signed)
0x0002-0x0003 : Multiplier (signed)
Output
0x0010-0x0013 : Product (signed)
*/
case 0x06:
{
ST010_Multiply(*(short*)&SRAM[0x0000], *(short*)&SRAM[0x0002], (int *)&SRAM[0x10]);
}
break;
/*
Mode 7 Raster Data Calculation
Input
0x0000-0x0001 : Angle (signed)
Output
0x00f0-0x024f : Mode 7 Matrix A
0x0250-0x03af : Mode 7 Matrix B
0x03b0-0x050f : Mode 7 Matrix C
0x0510-0x066f : Mode 7 Matrix D
*/
case 0x07:
{
int16 data;
int32 offset = 0;
int16 Theta = ST010_WORD(0x0000);
int32 line;
for (line = 0; line < 176; line++)
{
//Calculate Mode 7 Matrix A/D data
data = ST010_M7Scale[line] * ST010_Cos(Theta) >> 15;
SRAM[0x00f0 + offset]=(uint8)(data);
SRAM[0x00f1 + offset]=(uint8)(data >> 8);
SRAM[0x0510 + offset]=(uint8)(data);
SRAM[0x0511 + offset]=(uint8)(data >> 8);
//Calculate Mode 7 Matrix B/C data
data = ST010_M7Scale[line] * ST010_Sin(Theta) >> 15;
SRAM[0x0250 + offset]=(uint8)(data);
SRAM[0x0251 + offset]=(uint8)(data >> 8);
if (data) { data = ~data; }
SRAM[0x03b0 + offset]=(uint8)(data);
SRAM[0x03b1 + offset]=(uint8)(data >> 8);
offset += 2;
}
//Shift Angle for use with Lookup table
SRAM[0x00] = SRAM[0x01];
SRAM[0x01] = 0x00;
}
break;
/*
Two dimensional Coordinate Rotation
Input
0x0000-0x0001 : X0 (signed)
0x0002-0x0003 : Y0 (signed)
0x0004-0x0005 : Angle (signed)
Output
0x0010-0x0011 : X1 (signed)
0x0012-0x0013 : Y1 (signed)
*/
case 0x08:
{
ST010_Rotate(*(short*)&SRAM[0x0004], *(short*)&SRAM[0x0000], *(short*)&SRAM[0x0002], (short *)&SRAM[0x10], (short *)&SRAM[0x12]);
}
break;
default: break;
}
//Lower signal: op processed
SRAM[0x20]=0;
SRAM[0x21]=0;
}

585
zsnes/src/chips/seta11.c Normal file
View File

@@ -0,0 +1,585 @@
// ST-011 SNES DSP adapted from Morita Shogi 64
//
// notes:
// - the SNES uses DMA to/from 60:0000 and maybe 68:0xxx
// - some code redundancy (helper subroutines for movement projection)
//
// - OPS04/05 have unknown output values (!)
// - OPS06/07 have unknown purposes
//
// - plenty of missing opcodes that don't show up in the only known binary log (st011-demo)
// (play the game until captured/promoted pieces, king checked, endgame)
// - minus emulation cycles (busy signals), bit-perfect to 'st011-demo'
//#define DEBUG_DSP
#ifdef DEBUG_DSP
#include <stdio.h>
int debug1, debug2;
int line_count;
#endif
void (*RunST011)();
void ST011_Command();
unsigned char ST011_DR;
unsigned char ST011_SR;
int ST011_input_length;
#define ST011_ram setaramdata
extern unsigned char *setaramdata;
#define ST011_board ( ST011_ram+0x130 )
int ST011_dma_count;
int ST011_dma_index;
int ST011_king1;
int ST011_king2;
// (x,y)
#define MOVE_UUL -1,-20
#define MOVE_UL -1,-10
#define MOVE_ULAll -9,- 9
#define MOVE_U 0,-10
#define MOVE_UAll 0,- 9
#define MOVE_UR 1,-10
#define MOVE_URAll 9,- 9
#define MOVE_UUR 1,-20
#define MOVE_L -1, 0
#define MOVE_LAll -9, 0
#define MOVE_R 1, 0
#define MOVE_RAll 9, 0
#define MOVE_DDL -1, 20
#define MOVE_DL -1, 10
#define MOVE_DLAll -9, 9
#define MOVE_D 0, 10
#define MOVE_DAll 0, 9
#define MOVE_DR 1, 10
#define MOVE_DRAll 9, 9
#define MOVE_DDR 1, 20
#define MOVE_STOP 127,127
#define MOVE_NOP 0, 0
const int ST011_move_table[8*2][9*2] =
{
// Pawn: one step forward
// - Promoted: same as Gold
{ MOVE_D, MOVE_STOP, MOVE_NOP, MOVE_NOP, MOVE_NOP, MOVE_NOP, MOVE_NOP, MOVE_NOP, MOVE_NOP },
{ MOVE_DR, MOVE_D, MOVE_DL, MOVE_R, MOVE_L, MOVE_U, MOVE_STOP, MOVE_NOP, MOVE_NOP },
// Lance: all steps forward
// - Promoted: same as Gold
{ MOVE_DAll, MOVE_STOP, MOVE_NOP, MOVE_NOP, MOVE_NOP, MOVE_NOP, MOVE_NOP, MOVE_NOP, MOVE_NOP },
{ MOVE_DR, MOVE_D, MOVE_DL, MOVE_R, MOVE_L, MOVE_U, MOVE_STOP, MOVE_NOP, MOVE_NOP },
// Knight: one step side, two forward
// - Promoted: same as Gold
{ MOVE_DDR, MOVE_DDL, MOVE_STOP, MOVE_NOP, MOVE_NOP, MOVE_NOP, MOVE_NOP, MOVE_NOP, MOVE_NOP },
{ MOVE_DR, MOVE_D, MOVE_DL, MOVE_R, MOVE_L, MOVE_U, MOVE_STOP, MOVE_NOP, MOVE_NOP },
// Silver general: one any diagonal, one step forward
// - Promoted: same as Gold
{ MOVE_DR, MOVE_D, MOVE_DL, MOVE_UR, MOVE_UL, MOVE_STOP, MOVE_NOP, MOVE_NOP, MOVE_NOP },
{ MOVE_DR, MOVE_D, MOVE_DL, MOVE_R, MOVE_L, MOVE_U, MOVE_STOP, MOVE_NOP, MOVE_NOP },
// Gold general: one any forward, one sideways or one backward
// - Promoted: N/A
{ MOVE_DR, MOVE_D, MOVE_DL, MOVE_R, MOVE_L, MOVE_U, MOVE_STOP, MOVE_NOP, MOVE_NOP },
{ MOVE_STOP, MOVE_NOP, MOVE_NOP, MOVE_NOP, MOVE_NOP, MOVE_NOP, MOVE_NOP, MOVE_NOP, MOVE_NOP },
// Bishop: any diagonal
// - Promoted: Bishop + King
{ MOVE_DRAll, MOVE_DLAll, MOVE_URAll, MOVE_ULAll, MOVE_STOP, MOVE_NOP, MOVE_NOP, MOVE_NOP, MOVE_NOP },
{ MOVE_DRAll, MOVE_D, MOVE_DLAll, MOVE_R, MOVE_L, MOVE_URAll, MOVE_U, MOVE_ULAll, MOVE_STOP },
// Rook: any vertical, horizontal
// - Promoted: Rook + King
{ MOVE_DAll, MOVE_RAll, MOVE_LAll, MOVE_UAll, MOVE_STOP, MOVE_NOP, MOVE_NOP, MOVE_NOP, MOVE_NOP },
{ MOVE_DR, MOVE_DAll, MOVE_DL, MOVE_RAll, MOVE_LAll, MOVE_UR, MOVE_UAll, MOVE_UL, MOVE_STOP },
// King: one any direction
// - Promoted: N/A
{ MOVE_DR, MOVE_D, MOVE_DL, MOVE_R, MOVE_L, MOVE_UR, MOVE_U, MOVE_UL, MOVE_STOP },
{ MOVE_STOP, MOVE_NOP, MOVE_NOP, MOVE_NOP, MOVE_NOP, MOVE_NOP, MOVE_NOP, MOVE_NOP, MOVE_NOP },
};
void ST011_Reset()
{
RunST011 = &ST011_Command;
ST011_SR=0xff;
}
void ST011_OP01_A()
{
if( ST011_dma_count-- )
{
ST011_board[ ST011_dma_index++ ] = ST011_DR;
}
if( ST011_dma_count == 0 )
{
#ifdef DEBUG_DSP
int lcv1, lcv2;
#endif
int lcv;
for( lcv = 0; lcv < 11; lcv++ )
{
ST011_board[ lcv ] = 0;
}
for( lcv = 11; lcv < 21; lcv++ )
{
ST011_board[ lcv ] = 0x80;
}
ST011_king1 = ST011_board[ 126+21 ];
ST011_king2 = ST011_board[ 127+21 ];
RunST011 = &ST011_Command;
ST011_SR = 0xc4;
#ifdef DEBUG_DSP
// Debug
printf( "OP01\n" );
for( lcv1 = 0; lcv1 < 9; lcv1++ )
{
for( lcv2 = 0; lcv2 < 10; lcv2++ )
{
printf( "%02x ", ST011_board[ lcv1*10 + lcv2 + 21 ] );
}
printf( "\n" );
}
printf( "OP01 END\n\n" );
#endif
}
}
void ST011_OP01()
{
ST011_dma_count = 128;
ST011_dma_index = 0+21;
RunST011 = &ST011_OP01_A;
ST011_SR = 0xa4;
}
void ST011_OP02_A()
{
if( ST011_dma_count-- )
{
ST011_DR = ST011_ram[ ST011_dma_index-- ];
}
if( ST011_dma_count == 0 )
{
#ifdef DEBUG_DSP
int lcv1, lcv2;
#endif
RunST011 = &ST011_Command;
ST011_SR = 0xc4;
#ifdef DEBUG_DSP
// Debug
#define OP02_ROW 10
printf( "OP02\n" );
for( lcv1 = 0; lcv1 < 0x83 / OP02_ROW; lcv1++ )
{
for( lcv2 = 0; lcv2 < OP02_ROW; lcv2++ )
{
printf( "%02x ", ST011_ram[ debug1 - lcv1 * OP02_ROW - lcv2 ] );
}
printf( "\n" );
}
printf( "OP02 END\n\n" );
#endif
}
}
void ST011_OP02()
{
switch( ST011_input_length-- )
{
case 4: ST011_dma_index = ST011_DR; break;
case 3: ST011_dma_index |= ST011_DR << 8; break;
case 2: ST011_dma_count = ST011_DR; break;
case 1:
ST011_dma_count |= ST011_DR << 8;
#ifdef DEBUG_DSP
debug1 = ST011_dma_index;
debug2 = 0;
#endif
RunST011 = &ST011_OP02_A;
ST011_SR = 0xa4;
break;
}
}
void ST011_Project_Moves( int color )
{
int row, col, lcv, index;
int dir;
index = 0x121;
for( lcv = 0; lcv < 0x83; lcv++ )
{
ST011_ram[ index-- ] = 0;
}
index = 0x121 - 21;
if( color == 0x20 )
{
dir = 1;
}
else
{
dir = -1;
}
for( row = 0; row < 9; row++ )
{
for( col = 0; col < 10; col++ )
{
int shogi_piece;
int piece_id;
int lcv_steps, lcv_move;
int move_list[ 9*2 ];
shogi_piece = ST011_board[ row*10+col+21 ];
piece_id = shogi_piece & 0x1f;
if( col == 9 ) continue;
if( shogi_piece == 0x00 ) continue;
if( ( shogi_piece & ~0x1f ) != color ) continue;
for( lcv = 0; lcv < 9*2; lcv++ )
{
move_list[ lcv ] = ST011_move_table[ piece_id >> 1 ][ lcv ];
}
lcv_move = 0;
while( move_list[ lcv_move ] != 0x7f )
{
int pos_x, pos_y;
lcv_steps = 1;
if( move_list[ lcv_move ] == 9 || move_list[ lcv_move ] == -9 )
{
lcv_steps = 9;
if( move_list[ lcv_move ] == 9 )
{
move_list[ lcv_move ] = 1;
}
else
{
move_list[ lcv_move ] = -1;
}
}
if( move_list[ lcv_move+1 ] == 9 || move_list[ lcv_move+1 ] == -9 )
{
lcv_steps = 9;
if( move_list[ lcv_move+1 ] == 9 )
{
move_list[ lcv_move+1 ] = 1;
}
else
{
move_list[ lcv_move+1 ] = -1;
}
}
else
{
move_list[ lcv_move+1 ] /= 10;
}
pos_x = col;
pos_y = row;
while( lcv_steps-- )
{
pos_x += move_list[ lcv_move+0 ];
pos_y += ( move_list[ lcv_move+1 ] * dir );
ST011_ram[ index - pos_y*10 - pos_x ] = 0x80;
if( ST011_board[ pos_y*10 + pos_x + 21 ] ) break;
}
lcv_move += 2;
}
} // end col
} // end row
}
int ST011_Project_Valid_Moves( int color )
{
int row, col, lcv, index;
int dir;
index = 0x556;
if( color == 0x20 )
{
dir = 1;
}
else
{
dir = -1;
}
for( row = 0; row < 9; row++ )
{
for( col = 0; col < 10; col++ )
{
int shogi_piece;
int piece_id;
int lcv_steps, lcv_move;
int move_list[ 9*2 ];
shogi_piece = ST011_board[ row*10+col+21 ];
piece_id = shogi_piece & 0x1f;
if( col == 9 ) continue;
if( shogi_piece == 0x00 ) continue;
if( ( shogi_piece & ~0x1f ) != color ) continue;
for( lcv = 0; lcv < 9*2; lcv++ )
{
move_list[ lcv ] = ST011_move_table[ piece_id >> 1 ][ lcv ];
}
lcv_move = 0;
while( move_list[ lcv_move ] != 0x7f )
{
int pos_x, pos_y;
lcv_steps = 1;
if( move_list[ lcv_move ] == 9 || move_list[ lcv_move ] == -9 )
{
lcv_steps = 9;
if( move_list[ lcv_move ] == 9 )
{
move_list[ lcv_move ] = 1;
}
else
{
move_list[ lcv_move ] = -1;
}
}
if( move_list[ lcv_move+1 ] == 9 || move_list[ lcv_move+1 ] == -9 )
{
lcv_steps = 9;
if( move_list[ lcv_move+1 ] == 9 )
{
move_list[ lcv_move+1 ] = 1;
}
else
{
move_list[ lcv_move+1 ] = -1;
}
}
else
{
move_list[ lcv_move+1 ] /= 10;
}
pos_x = col;
pos_y = row;
while( lcv_steps-- )
{
pos_x += move_list[ lcv_move+0 ];
pos_y += ( move_list[ lcv_move+1 ] * dir );
if( pos_x < 0 ) break;
if( pos_x > 8 ) break;
if( pos_y < 0 ) break;
if( pos_y > 8 ) break;
if( ( ST011_board[ pos_y*10 + pos_x + 21 ] & ~0x1f ) == color ) break;
ST011_ram[ index + 0x000 ] = 21 + row*10 + col;
ST011_ram[ index + 0x001 ] = 0;
ST011_ram[ index + 0x418 ] = 21 + pos_y*10 + pos_x;
ST011_ram[ index + 0x419 ] = 0;
if( pos_y >= 6 )
{
ST011_ram[ index + 0x418 ] |= 0x80;
}
index += 2;
if( ST011_board[ pos_y*10+pos_x+21 ] ) break;
}
lcv_move += 2;
}
} // end col
} // end row
return ( index-0x556 ) >> 1;
}
void ST011_OP04()
{
ST011_Project_Moves( 0x40 );
// unknown outputs
ST011_ram[ 0x12c ] = 0;
ST011_ram[ 0x12d ] = 0;
ST011_ram[ 0x12e ] = 0;
ST011_ram[ 0x12f ] = 0;
RunST011 = &ST011_Command;
ST011_SR = 0xc4;
}
void ST011_OP05()
{
ST011_Project_Moves( 0x20 );
// unknown outputs
ST011_ram[ 0x12c ] = 0;
ST011_ram[ 0x12d ] = 0;
ST011_ram[ 0x12e ] = 0;
ST011_ram[ 0x12f ] = 0;
RunST011 = &ST011_Command;
ST011_SR = 0xc4;
}
void ST011_OP0E()
{
int valid_moves;
valid_moves = ST011_Project_Valid_Moves( 0x20 );
ST011_ram[ 0x12c ] = valid_moves & 0xff;
ST011_ram[ 0x12d ] = ( valid_moves >> 8 ) & 0xff;
RunST011 = &ST011_Command;
ST011_SR = 0xc4;
}
void ST011_Command()
{
#ifdef DEBUG_DSP
printf( "OP%02X @ line %d\n", ST011_DR, line_count );
#endif
// busy
ST011_SR = 0x84;
switch( ST011_DR )
{
// Download shogi playboard to on-board memory
case 0x01:
ST011_OP01();
break;
// Upload shogi analysis data to outside memory
case 0x02:
ST011_input_length = 4;
RunST011 = ST011_OP02;
break;
// Project all moves of player color $40
case 0x04:
ST011_OP04();
break;
// Project all moves of player color $20
case 0x05:
ST011_OP05();
break;
// Unknown - seems to set flags $00,$20,$40,..$e0 for restricted movement lists
case 0x06:
//ST011_OP06();
ST011_SR = 0xc4;
break;
// Unknown - seems to set flags $00,$20,$40,..$e0 for restricted movement lists
case 0x07:
//ST011_OP07();
ST011_SR = 0xc4;
break;
// List valid moves of player color $20
case 0x0E:
ST011_OP0E();
break;
default:
#ifdef DEBUG_DSP
printf( "Unknown OP @ line %d\n", line_count );
#endif
break;
}
}
unsigned short seta11_address;
unsigned char seta11_byte;
void ST011_MapR_68()
{
if (seta11_address < 0x1000)
{
ST011_DR = ST011_ram[seta11_address & 0xfff];
}
seta11_byte = ST011_DR;
}
void ST011_MapW_68()
{
ST011_DR = seta11_byte;
if (seta11_address < 0x1000)
{
ST011_ram[seta11_address & 0xfff] = ST011_DR;
}
}
void ST011_MapR_60()
{
if (seta11_address == 0)
{
RunST011();
}
if (seta11_address == 1)
{
seta11_byte = ST011_SR;
return;
}
seta11_byte = ST011_DR;
}
void ST011_MapW_60()
{
ST011_DR = seta11_byte;
if (seta11_address == 0)
{
RunST011();
}
}

667
zsnes/src/chips/sfxproc.asm Normal file
View File

@@ -0,0 +1,667 @@
;Copyright (C) 1997-2007 ZSNES Team ( zsKnight, _Demo_, pagefault, Nach )
;
;http://www.zsnes.com
;http://sourceforge.net/projects/zsnes
;https://zsnes.bountysource.com
;
;This program is free software; you can redistribute it and/or
;modify it under the terms of the GNU General Public License
;version 2 as published by the Free Software Foundation.
;
;This program is distributed in the hope that it will be useful,
;but WITHOUT ANY WARRANTY; without even the implied warranty of
;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;GNU General Public License for more details.
;
;You should have received a copy of the GNU General Public License
;along with this program; if not, write to the Free Software
;Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
%include "macros.mac"
EXTSYM SfxB,SfxBRAMR,SfxCBR,SfxCFGR,SfxCLSR,SfxCPB,SfxCROM
EXTSYM SfxCarry,SfxMemTable,SfxOverflow,SfxPBR,SfxPIPE,SfxR0,SfxR1,SfxR10
EXTSYM SfxR11,SfxR12,SfxR13,SfxR14,SfxR15,SfxR2,SfxR3,SfxR4,SfxR5,SfxR6
EXTSYM SfxR7,SfxR8,SfxR9,SfxRAMBR,SfxRAMMem,SfxROMBR,SfxSCBR,SfxSCMR,SfxSFR
EXTSYM SfxSignZero,SfxnRamBanks,regptr,regptw,sfxramdata,ChangeOps
EXTSYM SfxPOR,sfxclineloc,UpdatePORSCMR,UpdateCLSR,UpdateSCBRCOLR,SfxAC
EXTSYM sfx128lineloc,sfx160lineloc,sfx192lineloc,sfxobjlineloc,SFXProc
%include "cpu/regs.mac"
%include "cpu/regsw.mac"
%macro AssembleSFXFlags 0
and word[SfxSFR],8F60h
test byte[SfxCarry],1
jz .nosfxcarry
or word[SfxSFR],04h
.nosfxcarry
cmp word[SfxSignZero],0
jne .nozero
or word[SfxSFR],02h
.nozero
test word[SfxSignZero],8000h
jz .noneg
or word[SfxSFR],08h
.noneg
cmp byte[SfxOverflow],0
je .noof
or word[SfxSFR],10h
.noof
cmp byte[SfxB],0
je .bzero
or word[SfxSFR],1000h
.bzero
%endmacro
SECTION .text
NEWSYM initsfxregsr
setreg 3000h*4,reg3000r
setreg 3001h*4,reg3001r
setreg 3002h*4,reg3002r
setreg 3003h*4,reg3003r
setreg 3004h*4,reg3004r
setreg 3005h*4,reg3005r
setreg 3006h*4,reg3006r
setreg 3007h*4,reg3007r
setreg 3008h*4,reg3008r
setreg 3009h*4,reg3009r
setreg 300Ah*4,reg300Ar
setreg 300Bh*4,reg300Br
setreg 300Ch*4,reg300Cr
setreg 300Dh*4,reg300Dr
setreg 300Eh*4,reg300Er
setreg 300Fh*4,reg300Fr
setreg 3010h*4,reg3010r
setreg 3011h*4,reg3011r
setreg 3012h*4,reg3012r
setreg 3013h*4,reg3013r
setreg 3014h*4,reg3014r
setreg 3015h*4,reg3015r
setreg 3016h*4,reg3016r
setreg 3017h*4,reg3017r
setreg 3018h*4,reg3018r
setreg 3019h*4,reg3019r
setreg 301Ah*4,reg301Ar
setreg 301Bh*4,reg301Br
setreg 301Ch*4,reg301Cr
setreg 301Dh*4,reg301Dr
setreg 301Eh*4,reg301Er
setreg 301Fh*4,reg301Fr
setreg 3030h*4,reg3030r
setreg 3031h*4,reg3031r
setreg 3032h*4,reg3032r
setreg 3033h*4,reg3033r
setreg 3034h*4,reg3034r
setreg 3035h*4,reg3035r
setreg 3036h*4,reg3036r
setreg 3037h*4,reg3037r
setreg 3038h*4,reg3038r
setreg 3039h*4,reg3039r
setreg 303Ah*4,reg303Ar
setreg 303Bh*4,reg303Br
setreg 303Ch*4,reg303Cr
setreg 303Dh*4,reg303Dr
setreg 303Eh*4,reg303Er
setreg 303Fh*4,reg303Fr
; set 3100-31FF to cacheregr
mov edi,3100h*4
add edi,[regptr]
mov eax,cacheregr
mov ecx,200h
.loop
mov [edi],eax
add edi,4
dec ecx
jnz .loop
ret
NEWSYM initsfxregsw
setregw 3000h*4,reg3000w
setregw 3001h*4,reg3001w
setregw 3002h*4,reg3002w
setregw 3003h*4,reg3003w
setregw 3004h*4,reg3004w
setregw 3005h*4,reg3005w
setregw 3006h*4,reg3006w
setregw 3007h*4,reg3007w
setregw 3008h*4,reg3008w
setregw 3009h*4,reg3009w
setregw 300Ah*4,reg300Aw
setregw 300Bh*4,reg300Bw
setregw 300Ch*4,reg300Cw
setregw 300Dh*4,reg300Dw
setregw 300Eh*4,reg300Ew
setregw 300Fh*4,reg300Fw
setregw 3010h*4,reg3010w
setregw 3011h*4,reg3011w
setregw 3012h*4,reg3012w
setregw 3013h*4,reg3013w
setregw 3014h*4,reg3014w
setregw 3015h*4,reg3015w
setregw 3016h*4,reg3016w
setregw 3017h*4,reg3017w
setregw 3018h*4,reg3018w
setregw 3019h*4,reg3019w
setregw 301Ah*4,reg301Aw
setregw 301Bh*4,reg301Bw
setregw 301Ch*4,reg301Cw
setregw 301Dh*4,reg301Dw
setregw 301Eh*4,reg301Ew
setregw 301Fh*4,reg301Fw
setregw 3030h*4,reg3030w
setregw 3031h*4,reg3031w
setregw 3032h*4,reg3032w
setregw 3033h*4,reg3033w
setregw 3034h*4,reg3034w
setregw 3035h*4,reg3035w
setregw 3036h*4,reg3036w
setregw 3037h*4,reg3037w
setregw 3038h*4,reg3038w
setregw 3039h*4,reg3039w
setregw 303Ah*4,reg303Aw
setregw 303Bh*4,reg303Bw
setregw 303Ch*4,reg303Cw
setregw 303Dh*4,reg303Dw
setregw 303Eh*4,reg303Ew
setregw 303Fh*4,reg303Fw
; set 3100-31FF to cacheregw
mov edi,3100h*4
add edi,[regptw]
mov eax,cacheregw
mov ecx,200h
.loop
mov [edi],eax
add edi,4
dec ecx
jnz .loop
ret
NEWSYM cacheregr
or byte[cachewarning],1
ret
NEWSYM cacheregw
or byte[cachewarning],2
ret
SECTION .bss
NEWSYM cachewarning, resb 1
SECTION .text
; SFX Registers
NEWSYM reg3000r
mov al,[SfxR0]
ret
NEWSYM reg3001r
mov al,[SfxR0+1]
ret
NEWSYM reg3002r
mov al,[SfxR1]
ret
NEWSYM reg3003r
mov al,[SfxR1+1]
ret
NEWSYM reg3004r
mov al,[SfxR2]
ret
NEWSYM reg3005r
mov al,[SfxR2+1]
ret
NEWSYM reg3006r
mov al,[SfxR3]
ret
NEWSYM reg3007r
mov al,[SfxR3+1]
ret
NEWSYM reg3008r
mov al,[SfxR4]
ret
NEWSYM reg3009r
mov al,[SfxR4+1]
ret
NEWSYM reg300Ar
mov al,[SfxR5]
ret
NEWSYM reg300Br
mov al,[SfxR5+1]
ret
NEWSYM reg300Cr
mov al,[SfxR6]
ret
NEWSYM reg300Dr
mov al,[SfxR6+1]
ret
NEWSYM reg300Er
mov al,[SfxR7]
ret
NEWSYM reg300Fr
mov al,[SfxR7+1]
ret
NEWSYM reg3010r
mov al,[SfxR8]
ret
NEWSYM reg3011r
mov al,[SfxR8+1]
ret
NEWSYM reg3012r
mov al,[SfxR9]
ret
NEWSYM reg3013r
mov al,[SfxR9+1]
ret
NEWSYM reg3014r
mov al,[SfxR10]
ret
NEWSYM reg3015r
mov al,[SfxR10+1]
ret
NEWSYM reg3016r
mov al,[SfxR11]
ret
NEWSYM reg3017r
mov al,[SfxR11+1]
ret
NEWSYM reg3018r
mov al,[SfxR12]
ret
NEWSYM reg3019r
mov al,[SfxR12+1]
ret
NEWSYM reg301Ar
mov al,[SfxR13]
ret
NEWSYM reg301Br
mov al,[SfxR13+1]
ret
NEWSYM reg301Cr
mov al,[SfxR14]
ret
NEWSYM reg301Dr
mov al,[SfxR14+1]
ret
NEWSYM reg301Er
mov al,[SfxR15]
ret
NEWSYM reg301Fr
mov al,[SfxR15+1]
ret
; Other SFX stuff
NEWSYM reg3030r
AssembleSFXFlags
mov al,[SfxSFR]
ret
NEWSYM reg3031r
cmp byte[SfxAC],1
je .alwaysclear
cmp dword[ChangeOps],-350*240
jl .noclear
.alwaysclear
and byte[SfxSFR+1],07fh ; clear IRQ flag
jmp .cleared
.noclear
cmp dword[ChangeOps],-350*240*4
jge .clear
mov dword[ChangeOps],-350*240*4
jmp .cleared
.clear
add dword[ChangeOps],350*240
.cleared
mov al,[SfxSFR+1]
ret
SECTION .bss
.test resb 1
SECTION .text
NEWSYM reg3032r ; Unused
xor al,al
ret
NEWSYM reg3033r ; BRAMR Backup Ram Read only on/off (bits 1-15 unused)
mov al,[SfxBRAMR]
ret
NEWSYM reg3034r ; PBR (Program Bank)
mov al,[SfxPBR]
ret
NEWSYM reg3035r ; Unused
xor al,al
ret
NEWSYM reg3036r ; ROMBR (Gamepak Rom Bank Register)
mov al,[SfxROMBR]
ret
NEWSYM reg3037r ; CFGR (Control Flags Register)
mov al,[SfxCFGR]
ret
NEWSYM reg3038r ; SCBR (Screen Bank Register)
mov al,[SfxSCBR]
ret
NEWSYM reg3039r ; CLSR (Clock Speed Register)
mov al,[SfxCLSR]
ret
NEWSYM reg303Ar ; SCMR (Screen Mode Register)
mov al,[SfxSCMR]
test byte[SfxPOR],10h
jnz .objmode
mov al,[SfxSCMR]
and al,00100100b ; 4 + 32
cmp al,4
je .lines160
cmp al,32
je .lines192
cmp al,36
je .objmode
mov eax,[sfx128lineloc]
jmp .donelines
.lines160
mov eax,[sfx160lineloc]
jmp .donelines
.lines192
mov eax,[sfx192lineloc]
jmp .donelines
.objmode
mov eax,[sfxobjlineloc]
.donelines
mov [sfxclineloc],eax
ret
NEWSYM reg303Br ; VCR (Version Code Register)
mov al,20h
ret
NEWSYM reg303Cr ; RAMBR (Ram bank register)
mov al,[SfxRAMBR]
ret
NEWSYM reg303Dr ; Unused
xor al,al
ret
NEWSYM reg303Er ; CBR (Cache Base Register), lower byte
mov al,[SfxCBR]
ret
NEWSYM reg303Fr ; CBR (Cache Base Register), upper byte
mov al,[SfxCBR+1]
ret
; SFX Write Registers
NEWSYM reg3000w
mov [SfxR0],al
ret
NEWSYM reg3001w
mov [SfxR0+1],al
ret
NEWSYM reg3002w
mov [SfxR1],al
ret
NEWSYM reg3003w
mov [SfxR1+1],al
ret
NEWSYM reg3004w
mov [SfxR2],al
ret
NEWSYM reg3005w
mov [SfxR2+1],al
ret
NEWSYM reg3006w
mov [SfxR3],al
ret
NEWSYM reg3007w
mov [SfxR3+1],al
ret
NEWSYM reg3008w
mov [SfxR4],al
ret
NEWSYM reg3009w
mov [SfxR4+1],al
ret
NEWSYM reg300Aw
mov [SfxR5],al
ret
NEWSYM reg300Bw
mov [SfxR5+1],al
ret
NEWSYM reg300Cw
mov [SfxR6],al
ret
NEWSYM reg300Dw
mov [SfxR6+1],al
ret
NEWSYM reg300Ew
mov [SfxR7],al
ret
NEWSYM reg300Fw
mov [SfxR7+1],al
ret
NEWSYM reg3010w
mov [SfxR8],al
ret
NEWSYM reg3011w
mov [SfxR8+1],al
ret
NEWSYM reg3012w
mov [SfxR9],al
ret
NEWSYM reg3013w
mov [SfxR9+1],al
ret
NEWSYM reg3014w
mov [SfxR10],al
ret
NEWSYM reg3015w
mov [SfxR10+1],al
ret
NEWSYM reg3016w
mov [SfxR11],al
ret
NEWSYM reg3017w
mov [SfxR11+1],al
ret
NEWSYM reg3018w
mov [SfxR12],al
ret
NEWSYM reg3019w
mov [SfxR12+1],al
ret
NEWSYM reg301Aw
mov [SfxR13],al
ret
NEWSYM reg301Bw
mov [SfxR13+1],al
ret
NEWSYM reg301Cw
mov [SfxR14],al
ret
NEWSYM reg301Dw
mov [SfxR14+1],al
ret
NEWSYM reg301Ew
mov [SfxR15],al
ret
NEWSYM reg301Fw
mov [SfxR15+1],al
; start execution
push edx
mov edx,[SfxPBR]
mov edx,[SfxMemTable+edx*4]
add edx,[SfxR15]
mov dl,[edx]
mov [SfxPIPE],dl
pop edx
inc word[SfxR15]
or byte[SfxSFR],20h
or dword[SfxSFR],08000h ; Set IRQ Flag
mov dword[SFXProc],1
; call StartSFXret
ret
; Other SFX stuff
NEWSYM reg3030w
mov [SfxSFR],al
mov byte[SfxAC],1
mov dh,10
ret
NEWSYM reg3031w
mov [SfxSFR+1],al
ret
NEWSYM reg3032w ; Unused
ret
NEWSYM reg3033w ; BRAMR Backup Ram Read only on/off (bits 1-15 unused)
and al,0FEh
mov [SfxBRAMR],al
ret
NEWSYM reg3034w ; PBR (Program Bank)
mov [SfxPBR],al
xor ebx,ebx
mov bl,al
mov ebx,[SfxMemTable+ebx*4]
mov [SfxCPB],ebx
ret
NEWSYM reg3035w ; Unused
ret
NEWSYM reg3036w ; ROMBR (Gamepak Rom Bank Register)
mov [SfxROMBR],al
xor ebx,ebx
mov bl,al
mov ebx,[SfxMemTable+ebx*4]
mov [SfxCROM],ebx
ret
NEWSYM reg3037w ; CFGR (Control Flags Register)
mov [SfxCFGR],al
ret
NEWSYM reg3038w ; SCBR (Screen Bank Register)
mov [SfxSCBR],al
call UpdateSCBRCOLR
ret
NEWSYM reg3039w ; CLSR (Clock Speed Register)
and al,0FEh
mov [SfxCLSR],al
call UpdateCLSR
ret
NEWSYM reg303Aw ; SCMR (Screen Mode Register)
mov [SfxSCMR],al
call UpdatePORSCMR
ret
NEWSYM reg303Bw ; VCR (Version Code Register)
ret
NEWSYM reg303Cw ; RAMBR (Ram bank register)
mov bl,[SfxnRamBanks]
dec bl
and al,bl
mov ebx,[SfxnRamBanks]
dec ebx
and eax,ebx
mov [SfxRAMBR],eax
xor ebx,ebx
mov bl,al
shl ebx,16
add ebx,[sfxramdata]
mov [SfxRAMMem],ebx
ret
NEWSYM reg303Dw ; Unused
ret
NEWSYM reg303Ew ; CBR (Cache Base Register), lower byte
mov [SfxCBR],al
ret
NEWSYM reg303Fw ; CBR (Cache Base Register), upper byte
mov [SfxCBR+1],al
ret
NEWSYM sfxaccessbankr8
mov ebx,[sfxramdata]
mov al,[ebx+ecx]
xor ebx,ebx
ret
NEWSYM sfxaccessbankw8
mov ebx,[sfxramdata]
mov [ebx+ecx],al
xor ebx,ebx
ret
NEWSYM sfxaccessbankr16
mov ebx,[sfxramdata]
mov ax,[ebx+ecx]
xor ebx,ebx
ret
NEWSYM sfxaccessbankw16
mov ebx,[sfxramdata]
mov [ebx+ecx],ax
xor ebx,ebx
ret
NEWSYM sfxaccessbankr8b
mov ebx,[sfxramdata]
mov al,[ebx+ecx+65536]
xor ebx,ebx
ret
NEWSYM sfxaccessbankw8b
mov ebx,[sfxramdata]
mov [ebx+ecx+65536],al
xor ebx,ebx
ret
NEWSYM sfxaccessbankr16b
mov ebx,[sfxramdata]
mov ax,[ebx+ecx+65536]
xor ebx,ebx
ret
NEWSYM sfxaccessbankw16b
mov ebx,[sfxramdata]
mov [ebx+ecx+65536],ax
xor ebx,ebx
ret
NEWSYM sfxaccessbankr8c
mov ebx,[sfxramdata]
mov al,[ebx+ecx+65536*2]
xor ebx,ebx
ret
NEWSYM sfxaccessbankw8c
mov ebx,[sfxramdata]
mov [ebx+ecx+65536*2],al
xor ebx,ebx
ret
NEWSYM sfxaccessbankr16c
mov ebx,[sfxramdata]
mov ax,[ebx+ecx+65536*2]
xor ebx,ebx
ret
NEWSYM sfxaccessbankw16c
mov ebx,[sfxramdata]
mov [ebx+ecx+65536*2],ax
xor ebx,ebx
ret
NEWSYM sfxaccessbankr8d
mov ebx,[sfxramdata]
mov al,[ebx+ecx+65536*3]
xor ebx,ebx
ret
NEWSYM sfxaccessbankw8d
mov ebx,[sfxramdata]
mov [ebx+ecx+65536*3],al
xor ebx,ebx
ret
NEWSYM sfxaccessbankr16d
mov ebx,[sfxramdata]
mov ax,[ebx+ecx+65536*3]
xor ebx,ebx
ret
NEWSYM sfxaccessbankw16d
mov ebx,[sfxramdata]
mov [ebx+ecx+65536*3],ax
xor ebx,ebx
ret

View File

@@ -0,0 +1,133 @@
;Copyright (C) 1997-2007 ZSNES Team ( zsKnight, _Demo_, pagefault, Nach )
;
;http://www.zsnes.com
;http://sourceforge.net/projects/zsnes
;https://zsnes.bountysource.com
;
;This program is free software; you can redistribute it and/or
;modify it under the terms of the GNU General Public License
;version 2 as published by the Free Software Foundation.
;
;This program is distributed in the hope that it will be useful,
;but WITHOUT ANY WARRANTY; without even the implied warranty of
;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;GNU General Public License for more details.
;
;You should have received a copy of the GNU General Public License
;along with this program; if not, write to the Free Software
;Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
%include "macros.mac"
EXTSYM setaramdata,ST010DoCommand
SECTION .data
NEWSYM SetaCmdEnable, dd 0 ; Seta ST010/ST011 command enable register. Maybe also status.
SECTION .text
;; TODO - should return ROM for > 8000h
NEWSYM setaaccessbankr8
mov ebx,[setaramdata]
and ecx,0fffh
mov al,[ebx+ecx]
xor ebx,ebx
ret
NEWSYM setaaccessbankw8
test ecx,8000h
jnz .nosetenablew8 ; ignore ROM writes
and ecx,0fffh
mov ebx,[setaramdata]
mov [ebx+ecx],al
cmp byte[ebx+021h], 80h
jnz .nosetenablew8
pushad
call ST010DoCommand
popad
.nosetenablew8
xor ebx,ebx
ret
;; We ignore the case where it wraps into ROM reads - should never happen
NEWSYM setaaccessbankr16
mov ebx,[setaramdata]
and ecx,0fffh
mov ax,[ebx+ecx]
xor ebx,ebx
ret
NEWSYM setaaccessbankw16
test ecx,8000h
jnz .nosetenablew16 ; ignore ROM writes
cmp ecx,7fffh
jne .noromw16
mov [setaramdata+0fffh],al ; only write ram part in, not rom part
jmp short .nosetenablew16
.noromw16
and ecx,0fffh
mov ebx,[setaramdata]
cmp ecx,0fffh
jne .nowrapw16
mov [ebx+ecx],al
xchg ah,al
mov [ebx],al
jmp short .nosetenablew16
.nowrapw16
mov [ebx+ecx],ax
cmp byte[ebx+021h], 80h
jnz .nosetenablew16
pushad
call ST010DoCommand
popad
.nosetenablew16
xor ebx,ebx
ret
NEWSYM setaaccessbankr8a
xor al,al
cmp ecx,4000h
jae .nosetenabler8a
and ecx, 3
mov al,[SetaCmdEnable+ecx]
.nosetenabler8a
xor ebx,ebx
ret
NEWSYM setaaccessbankw8a
cmp ecx,4000h
jae .nosetenablew8a
and ecx, 03h
mov [SetaCmdEnable+ecx],al
.nosetenablew8a
xor ebx,ebx
ret
NEWSYM setaaccessbankr16a
xor ax,ax
cmp ecx,4000h
jae .nosetenabler16a
and ecx,3
mov al,[SetaCmdEnable+ecx]
xchg ah,al
inc ecx
and ecx,3
mov al,[SetaCmdEnable+ecx]
.nosetenabler16a
xor ebx,ebx
ret
NEWSYM setaaccessbankw16a
cmp ecx,4000h
jae .nosetenablew16a
mov ebx,[setaramdata]
and ecx,3
mov [ebx+ecx],al
xchg ah,al
inc ecx
and ecx,3
mov [ebx+ecx],al
.nosetenablew16a
xor ebx,ebx
ret

View File

@@ -0,0 +1,136 @@
;Copyright (C) 1997-2007 ZSNES Team ( zsKnight, _Demo_, pagefault, Nach )
;
;http://www.zsnes.com
;http://sourceforge.net/projects/zsnes
;https://zsnes.bountysource.com
;
;This program is free software; you can redistribute it and/or
;modify it under the terms of the GNU General Public License
;version 2 as published by the Free Software Foundation.
;
;This program is distributed in the hope that it will be useful,
;but WITHOUT ANY WARRANTY; without even the implied warranty of
;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;GNU General Public License for more details.
;
;You should have received a copy of the GNU General Public License
;along with this program; if not, write to the Free Software
;Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
%include "macros.mac"
EXTSYM seta11_address,seta11_byte,setaramdata,ST011_DR
EXTSYM ST011_MapR_60,ST011_MapW_60,ST011_MapW_68;ST011_MapR_68
SECTION .text
NEWSYM Seta11Read8_68
mov ebx,[setaramdata]
and ecx,0fffh
mov al,[ebx+ecx]
mov [ST011_DR],al
xor ebx,ebx
ret
NEWSYM Seta11Write8_68
test ecx,8000h
jnz .nosetenablew8 ; ignore ROM writes
mov [seta11_address],cx
mov [seta11_byte],al
pushad
call ST011_MapW_68
popad
.nosetenablew8
ret
NEWSYM Seta11Read16_68
mov ebx,[setaramdata]
and ecx,0fffh
mov ax,[ebx+ecx]
mov [ST011_DR],ah
xor ebx,ebx
ret
NEWSYM Seta11Write16_68
test ecx,8000h
jnz .nosetenablew16 ; ignore ROM writes
mov [seta11_address],cx
mov [seta11_byte],al
mov [seta11temp],ah
pushad
call ST011_MapW_68
mov ah,[seta11temp]
mov [seta11_byte],ah
inc word[seta11_address]
call ST011_MapW_68
popad
.nosetenablew16
ret
NEWSYM Seta11Read8_60
xor al,al
cmp ecx,4000h
jae .nosetenabler8
and ecx,3
mov [seta11_address],cx
pushad
call ST011_MapR_60
popad
mov al,[seta11_byte]
.nosetenabler8
ret
NEWSYM Seta11Write8_60
cmp ecx,4000h
jae .nosetenablew8
and ecx,3
mov [seta11_address],cx
mov [seta11_byte],al
pushad
call ST011_MapW_60
popad
.nosetenablew8
ret
NEWSYM Seta11Read16_60
xor ax,ax
cmp ecx,4000h
jae .nosetenabler16
and ecx,3
mov [seta11_address],cx
pushad
call ST011_MapR_60
mov al,[seta11_byte]
mov [seta11temp],al
inc word[seta11_address]
and word[seta11_address],3
call ST011_MapR_60
popad
mov al,[seta11temp]
mov ah,[seta11_byte]
.nosetenabler16
ret
NEWSYM Seta11Write16_60
cmp ecx,4000h
jae .nosetenablew16
and ecx,3
mov [seta11_address],cx
mov [seta11_byte],al
mov [seta11temp],ah
pushad
call ST011_MapW_60
mov ah,[seta11temp]
mov [seta11_byte],ah
inc word[seta11_address]
and word[seta11_address],3
call ST011_MapW_60
popad
.nosetenablew16
ret
SECTION .bss
NEWSYM seta11temp, resb 1

1497
zsnes/src/config.guess vendored Executable file

File diff suppressed because it is too large Load Diff

8
zsnes/src/config.h.in Normal file
View File

@@ -0,0 +1,8 @@
#undef TIME_WITH_SYS_TIME
#undef HAVE_SYS_TIME_H
#undef HAVE_DIRENT_H
#undef HAVE_SYS_NDIR_H
#undef HAVE_SYS_DIR_H
#undef HAVE_NDIR_H
#undef HAVE_MEMCPY
#undef HAVE_UNISTD_H

1608
zsnes/src/config.sub vendored Executable file

File diff suppressed because it is too large Load Diff

7190
zsnes/src/configure vendored Executable file

File diff suppressed because it is too large Load Diff

387
zsnes/src/configure.in Normal file
View File

@@ -0,0 +1,387 @@
dnl - Process this file with autoconf to produce a configure script.
dnl
dnl Copyright (C) 1997-2007 ZSNES Team ( zsKnight, _Demo_, pagefault, Nach )
dnl
dnl http://www.zsnes.com
dnl http://sourceforge.net/projects/zsnes
dnl https://zsnes.bountysource.com
dnl
dnl This program is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU General Public License
dnl version 2 as published by the Free Software Foundation.
dnl
dnl This program is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
dnl GNU General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with this program; if not, write to the Free Software
dnl Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
AC_INIT([zsnes], [], [http://www.zsnes.com])
AC_PREREQ(2.50)
AC_CONFIG_SRCDIR(init.asm)
AC_CONFIG_HEADER(config.h)
VERSION=1.51
CFLAGS="$CFLAGS -pipe -I. -I/usr/local/include -I/usr/include"
dnl - You might wanna change -I/usr/include if you're trying to do this with
dnl Mingw, because it doesnt have a standard file tree. Maybe if ming do this
dnl else do -I/usr/include. Or some shit. You figure it out.
LDFLAGS="$LDFLAGS -L/usr/local/lib -L/usr/lib"
dnl - Same thing here.
dnl - Where are our compilers, and who are we compiling for?
AC_CANONICAL_TARGET
AC_PROG_INSTALL
AC_PROG_CC
AC_PROG_CXX
AC_ARG_WITH(nasm-prefix,
[ --with-nasm-prefix=PFX Prefix where nasm is installed (optional)],
nasm_prefix="$withval",
nasm_prefix="")
AC_CHECK_TOOL(NASMPATH,nasm,"no",$nasm_prefix:$PATH)
if test x$NASMPATH = xno; then
AC_MSG_ERROR(You need NASM installed to compile ZSNES)
fi
AC_ARG_WITH(zconf-path,
[ --with-zconf-path=PATH Path where ZSNES looks for zsnesl.cfg (default is .zsnes)],
ZCONF="$withval",
ZCONF="")
CFLAGS="$CFLAGS -D__UNIXSDL__"
NFLAGS="$NFLAGS -w-orphan-labels -D__UNIXSDL__"
PSRFLAGS="$PSRFLAGS -D__UNIXSDL__"
MMLIB_FILES="\$(MMLIB_D)/mm.o"
STRIP="-s"
case x$target in
*-*-linux*)
NFLAGS="$NFLAGS -f elf -DELF"
MMLIB_FILES="$MMLIB_FILES \$(MMLIB_D)/linux.o"
;;
*-*-beos*)
CFLAGS="$CFLAGS -D__BEOS__"
NFLAGS="$NFLAGS -D__BEOS__ -f elf -DELF"
;;
*-*-*bsd*)
CFLAGS="$CFLAGS -D__BSDSDL__"
NFLAGS="$NFLAGS -D__BSDSDL__ -f elf -DELF"
;;
*-*-darwin* )
CFLAGS="$CFLAGS -D__MACOSX__ -D__OPENGL__ -arch i386 -mdynamic-no-pic -mstackrealign -fno-unit-at-a-time"
NFLAGS="$NFLAGS -D__MACOSX__ -D__OPENGL__ -f macho -DMACHO"
PSRFLAGS="$PSRFLAGS -D__OPENGL__"
MMLIB_FILES="$MMLIB_FILES \$(MMLIB_D)/osx.o"
STRIP=""
LDFLAGS="$LDFLAGS -framework Carbon -framework IOKit -framework Foundation -framework OpenGL -mdynamic-no-pic -read_only_relocs suppress -undefined dynamic_lookup"
GL_DRAW="\$(PORT_D)/gl_draw.o"
found_opengl=yes
;;
*-*-cygwin* | *-*-*ming*)
NFLAGS="$NFLAGS -f win32"
;;
*)
AC_MSG_ERROR(This target is not supported)
;;
esac
if test x$ZCONF != x; then
CFLAGS="$CFLAGS -DZCONF=\"\\\"$ZCONF\\\"\""
fi
dnl - Library checks (requisites marked *, others optionnal):
dnl - libSDL*, zlib*, libpng, curses, libao, OpenGL, JMAlib
dnl - libsdl stuff
AM_PATH_SDL(1.2.0,,[AC_MSG_ERROR(SDL >= 1.2.0 is required)])
dnl - zlib stuff
AM_PATH_ZLIB(1.2.3,,[AC_MSG_ERROR(zlib >= 1.2.3 is required)])
CFLAGS="$CFLAGS $ZLIB_CFLAGS"
LDFLAGS="$LDFLAGS $ZLIB_LIBS"
dnl - libpng stuff
AM_PATH_LIBPNG(1.2.0,,)
CFLAGS="$CFLAGS $SDL_CFLAGS"
LDFLAGS="$LDFLAGS $SDL_LIBS"
if test x$with_libpng != xyes; then
CFLAGS="$CFLAGS -DNO_PNG"
NFLAGS="$NFLAGS -DNO_PNG"
PSRFLAGS="$PSRFLAGS -DNO_PNG"
else
CFLAGS="$CFLAGS $LIBPNG_CFLAGS"
LDFLAGS="$LDFLAGS $LIBPNG_LIBS"
fi
dnl - debugger stuff
AC_ARG_ENABLE(debugger,
[ --disable-debugger Build without the zsnes debugger],
,
enable_debugger=yes)
AC_MSG_CHECKING(if you want the zsnes debugger)
AC_MSG_RESULT($enable_debugger)
if test x$enable_debugger != xyes; then
CFLAGS="$CFLAGS -DNO_DEBUGGER"
NFLAGS="$NFLAGS -DNO_DEBUGGER"
PSRFLAGS="$PSRFLAGS -DNO_DEBUGGER"
DEBUGGER_FILES=""
else
DEBUGGER_FILES="debugasm.o debugger.o"
AC_CHECK_LIB(curses, initscr, found_curses=yes,found_curses=no)
AC_CHECK_LIB(ncurses, initscr, found_ncurses=yes,found_ncurses=no)
AC_CHECK_LIB(pdcurses, initscr, found_pdcurses=yes,found_pdcurses=no)
if test x$found_curses = xyes; then
LDFLAGS="$LDFLAGS -lcurses"
else
if test x$found_ncurses = xyes; then
CFLAGS="$CFLAGS -DNCURSES"
LDFLAGS="$LDFLAGS -lncurses"
else
if test x$found_pdcurses = xyes; then
LDFLAGS="$LDFLAGS -lpdcurses"
else
AC_MSG_ERROR(A curses library is required to use the debugger)
DEBUGGER_FILES=""
fi
fi
fi
fi
dnl - libao stuff
AC_ARG_ENABLE(libao,
[ --enable-libao Build with libao support],
want_ao=$enableval,
want_ao=no)
AC_MSG_CHECKING(if you want libao support)
AC_MSG_RESULT($want_ao)
if test x$want_ao = xyes; then
AC_CHECK_LIB(ao, ao_initialize, got_ao=yes, got_ao=no)
if test x$got_ao = xyes; then
CFLAGS="$CFLAGS -D__LIBAO__"
LDFLAGS="$LDFLAGS -lao"
else
AC_MSG_ERROR(Couldn't find libao)
fi
fi
dnl - opengl stuff
if test x$found_opengl != xyes; then
AC_ARG_ENABLE(opengl,
[ --disable-opengl Build without OpenGL support],
,
enable_opengl=yes)
AC_ARG_WITH(
opengl-prefix,
[ --with-opengl-prefix=PFX Prefix where OpenGL is installed (optional)],
opengl_prefix="$withval",
opengl_prefix="")
if test x$enable_opengl != xno; then
AC_PATH_X
if test x$opengl_prefix != x; then
CFLAGS="$CFLAGS -I$opengl_prefix/include"
LDFLAGS-"$LDFLAGS -L$opengl_prefix/lib"
fi
if test x$x_libraries != x; then
LDFLAGS="$LDFLAGS -L$x_libraries"
fi
AC_CHECK_LIB(GL, glGetError, found_opengl=yes,found_opengl=no)
fi
AC_MSG_CHECKING(for OpenGL)
if test x$enable_opengl != xno; then
if test x$found_opengl = xyes; then
LDFLAGS="$LDFLAGS -lGL"
CFLAGS="$CFLAGS -D__OPENGL__"
NFLAGS="$NFLAGS -D__OPENGL__"
PSRFLAGS="$PSRFLAGS -D__OPENGL__"
GL_DRAW="\$(PORT_D)/gl_draw.o"
fi
AC_MSG_RESULT($found_opengl)
else
AC_MSG_RESULT(disabled by user)
fi
fi
dnl - jma stuff
AC_ARG_ENABLE(jma,
[ --disable-jma Build without JMA support],
,
enable_jma=yes)
AC_MSG_CHECKING(for JMA support)
AC_MSG_RESULT($enable_jma)
if test x$enable_jma != xyes; then
CFLAGS="$CFLAGS -DNO_JMA"
NFLAGS="$NFLAGS -DNO_JMA"
PSRFLAGS="$PSRFLAGS -DNO_JMA"
fi
dnl - Various debug and optimization option checks
AM_ARCH_DETECT()
AC_ARG_ENABLE(debug,
[ --enable-debug Build GDB friendly binary (zsnesd)],
debug=$enableval,
debug=no)
AC_MSG_CHECKING(if you want gdb friendly executable)
AC_MSG_RESULT($debug)
if test x$debug = xyes; then
dnl - It is easier to debug zsnes with no optimization enabled.
ZSNESEXE="zsnesd"
PSR_TEMP=""
CFLAGS="$CFLAGS -Wall -W -DDEBUG -O0 -fno-omit-frame-pointer -gstabs3"
NFLAGS="$NFLAGS -DDEBUG -g -F stabs -s -O0"
else
ZSNESEXE="zsnes"
PSR_TEMP=" rm -f t_\$*.c"
CFLAGSBAK="$CFLAGS"
AC_ARG_VAR(force_arch, [Force architecture to optimize GCC/G++ for])
AC_MSG_CHECKING(which cpu architecture to optimize for)
if test x$force_arch != x; then
CFLAGS="$CFLAGS -march=$force_arch"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]])],
[AC_MSG_RESULT(forcing $force_arch)],
[AC_MSG_RESULT($force_arch ??)
AC_MSG_WARN(incorrect force_arch parameter)
force_arch=""
CFLAGS="$CFLAGSBAK"
AC_MSG_CHECKING(for autodetected architecture)])
else
if test x$ARCH_INFO = x; then
case x$target in
i686-*-*)
AC_MSG_RESULT(guessing i686)
CFLAGS="$CFLAGS -march=i686"
;;
i586-*-*)
AC_MSG_RESULT(guessing i586)
CFLAGS="$CFLAGS -march=i586"
;;
i486-*-*)
AC_MSG_RESULT(guessing i486)
CFLAGS="$CFLAGS -march=i486"
;;
*)
AC_MSG_RESULT(guessing i386)
CFLAGS="$CFLAGS -march=i386"
AC_MSG_WARN([This is not what you want, use --target or force-arch])
;;
esac
else
AC_MSG_RESULT($ARCH_INFO)
CFLAGS="$CFLAGS -march=$ARCH_INFO"
fi
fi
AC_ARG_ENABLE(release,
[ --enable-release Build ultra-optimized release binary (zsnes)],
release=$enableval,
release=no)
AC_MSG_CHECKING(if you want crazy optimizations)
AC_MSG_RESULT($release)
if test x$release = xyes; then
if test x$force_arch = x; then
AC_MSG_WARN([If you intend to distribute this binary, make sure you use force_arch and set to i586 (or whichever CPU Arch you intend for)])
fi
CFLAGS="$CFLAGS -O3 -fomit-frame-pointer -fprefetch-loop-arrays -fforce-addr $STRIP -D__RELEASE__"
NFLAGS="$NFLAGS -O99999999 -D__RELEASE__"
else
CFLAGS="$CFLAGS -O3 -fomit-frame-pointer $STRIP"
NFLAGS="$NFLAGS -O1"
fi
fi
CXXFLAGS="$CFLAGS -fno-rtti"
if test x$enable_jma != xno; then
JMA_FILES="\$(JMA_D)/7zlzma.o \$(JMA_D)/crc32.o \$(JMA_D)/iiostrm.o\
\$(JMA_D)/inbyte.o \$(JMA_D)/jma.o \$(JMA_D)/lzma.o\
\$(JMA_D)/lzmadec.o \$(JMA_D)/winout.o \$(JMA_D)/zsnesjma.o"
ZC="$CXX"
ZCFLAGS="$CXXFLAGS"
else
JMA_FILES=""
ZC="$CC"
ZCFLAGS="$CFLAGS"
fi
dnl - Check for header files
AC_HEADER_STDC
AC_HEADER_MAJOR
dnl - Create Makefile
AC_SUBST(VERSION)
AC_SUBST(NASMPATH)
AC_SUBST(ZC)
AC_SUBST(ZCFLAGS)
AC_SUBST(PSRFLAGS)
AC_SUBST(NFLAGS)
AC_SUBST(ZSNESEXE)
AC_SUBST(GL_DRAW)
AC_SUBST(JMA_FILES)
AC_SUBST(MMLIB_FILES)
AC_SUBST(DEBUGGER_FILES)
AC_SUBST(PSR_TEMP)
AC_CONFIG_FILES(Makefile)
touch -t 198001010000 makefile.dep
AC_OUTPUT
dnl - Info output
echo
echo
echo ZSNES v$VERSION
echo
echo "SDL support Version `$SDL_CONFIG --version`"
echo "NASM support `nasm -v`"
echo "zlib support Version $ZLIB_VERSION"
echo $ECHO_N "PNG support $ECHO_C"
if test x$with_libpng = xyes; then
echo "${ECHO_T}Yes, version $LIBPNG_VERSION"
elif test x$enable_libpng = xno; then
echo "${ECHO_T}Disabled by user"
else
echo "${ECHO_T}Disabled, library not found"
fi
echo $ECHO_N "OpenGL support $ECHO_C"
if test x$found_opengl = xyes; then
echo "${ECHO_T}Yes"
elif test x$enable_opengl = xno; then
echo "${ECHO_T}Disabled by user"
else
echo "${ECHO_T}Disabled, library not found"
fi
echo $ECHO_N "JMA support $ECHO_C"
if test x$enable_jma = xno; then
echo "${ECHO_T}Disabled by user"
else
echo "${ECHO_T}Yes"
fi
echo $ECHO_N "ZSNES debugger $ECHO_C"
if test x$enable_debugger = xno; then
echo "${ECHO_T}Disabled"
else
echo "${ECHO_T}Enabled"
fi
echo
echo The binary will be installed in $prefix/bin
echo
echo $ECHO_N "Configure complete, now type '$ECHO_C"
case x$target in
*-*-*bsd*)
echo $ECHO_N "${ECHO_T}g$ECHO_C"
;;
*)
;;
esac
echo "${ECHO_T}make' and pray."
echo

1693
zsnes/src/cpu/65816d.inc Normal file

File diff suppressed because it is too large Load Diff

1707
zsnes/src/cpu/65816dc.inc Normal file

File diff suppressed because it is too large Load Diff

810
zsnes/src/cpu/address.inc Normal file
View File

@@ -0,0 +1,810 @@
;Copyright (C) 1997-2007 ZSNES Team ( zsKnight, _Demo_, pagefault, Nach )
;
;http://www.zsnes.com
;http://sourceforge.net/projects/zsnes
;https://zsnes.bountysource.com
;
;This program is free software; you can redistribute it and/or
;modify it under the terms of the GNU General Public License
;version 2 as published by the Free Software Foundation.
;
;This program is distributed in the hope that it will be useful,
;but WITHOUT ANY WARRANTY; without even the implied warranty of
;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;GNU General Public License for more details.
;
;You should have received a copy of the GNU General Public License
;along with this program; if not, write to the Free Software
;Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
;*******************************************************
; Address Modes
;*******************************************************
; 1. Immediate Addressing -- # - DONE IN PROGRAM
%macro addr_I_8br 0
mov al,[esi]
inc esi
%endmacro
%macro addr_I_16br 0
mov eax,[esi]
add esi,2
%endmacro
; 2. Absolute -- a (TESTED)
%macro addr_a_8br 0
mov cx,[esi]
mov bl,[xdb]
add esi,2
call dword near [memtabler8+ebx*4]
%endmacro
%macro addr_a_16br 0
mov cx,[esi]
mov bl,[xdb]
add esi,2
call dword near [memtabler16+ebx*4]
%endmacro
%macro addr_a_8bw 0
mov cx,[esi]
mov bl,[xdb]
add esi,2
call dword near [memtablew8+ebx*4]
%endmacro
%macro addr_a_16bw 0
mov cx,[esi]
mov bl,[xdb]
add esi,2
call dword near [memtablew16+ebx*4]
%endmacro
; 3. Absolute Long -- al
%macro addr_al_8br 0
mov cx,[esi]
mov bl,[esi+2]
add esi,3
call dword near [memtabler8+ebx*4]
%endmacro
%macro addr_al_16br 0
mov cx,[esi]
mov bl,[esi+2]
add esi,3
call dword near [memtabler16+ebx*4]
%endmacro
%macro addr_al_8bw 0
mov cx,[esi]
mov bl,[esi+2]
add esi,3
call dword near [memtablew8+ebx*4]
%endmacro
%macro addr_al_16bw 0
mov cx,[esi]
mov bl,[esi+2]
add esi,3
call dword near [memtablew16+ebx*4]
%endmacro
; 4. Direct -- d (TESTED)
%macro addr_d_8br 0
mov bl,[esi]
mov ecx,[xd]
inc esi
call dword near [DPageR8]
%endmacro
%macro addr_d_16br 0
mov bl,[esi]
mov ecx,[xd]
inc esi
call dword near [DPageR16]
%endmacro
%macro addr_d_8bw 0
mov bl,[esi]
mov ecx,[xd]
inc esi
call dword near [DPageW8]
%endmacro
%macro addr_d_16bw 0
mov bl,[esi]
mov ecx,[xd]
inc esi
call dword near [DPageW16]
%endmacro
; 5. Accumulator -- A
%macro addr_A_8br 0
mov al,[xa]
%endmacro
%macro addr_A_16br 0
mov eax,[xa]
%endmacro
%macro addr_A_8bw 0
mov [xa],al
%endmacro
%macro addr_A_16bw 0
mov [xa],ax
%endmacro
; 7. Direct Indirect Indexed -- (d),y
%macro addr_BdBCy_8br 0
mov bl,[esi]
mov ecx,[xd]
inc esi
call dword near [DPageR16]
mov cx,ax
mov bl,[xdb]
add cx,[xy]
jnc .np
inc bl
.np
call dword near [memtabler8+ebx*4]
%endmacro
%macro addr_BdBCy_16br 0
mov bl,[esi]
mov ecx,[xd]
inc esi
call dword near [DPageR16]
mov cx,ax
mov bl,[xdb]
add cx,[xy]
jnc .np
inc bl
.np
call dword near [memtabler16+ebx*4]
%endmacro
%macro addr_BdBCy_8bw 0
push ax
mov bl,[esi]
mov ecx,[xd]
inc esi
call dword near [DPageR16]
mov cx,ax
mov bl,[xdb]
add cx,[xy]
jnc .np
inc bl
.np
pop ax
call dword near [memtablew8+ebx*4]
%endmacro
%macro addr_BdBCy_16bw 0
push ax
mov bl,[esi]
mov ecx,[xd]
inc esi
call dword near [DPageR16]
mov cx,ax
mov bl,[xdb]
add cx,[xy]
jnc .np
inc bl
.np
pop ax
call dword near [memtablew16+ebx*4]
%endmacro
; 8. Direct Indirect Indexed Long -- [d],y
%macro addr_LdLCy_8br 0
mov ecx,[xd]
mov bl,[esi]
add cx,bx
inc esi
push cx
call membank0r16
pop cx
add cx,2
push ax
call membank0r8
mov bl,al
pop ax
mov cx,ax
add cx,[xy]
jnc .np
inc bl
.np
call dword near [memtabler8+ebx*4]
%endmacro
%macro addr_LdLCy_16br 0
mov ecx,[xd]
mov bl,[esi]
add cx,bx
inc esi
push cx
call membank0r16
pop cx
add cx,2
push ax
call membank0r8
mov bl,al
pop ax
mov cx,ax
add cx,[xy]
jnc .np
inc bl
.np
call dword near [memtabler16+ebx*4]
%endmacro
%macro addr_LdLCy_8bw 0
push ax
mov ecx,[xd]
mov bl,[esi]
add cx,bx
inc esi
push cx
call membank0r16
pop cx
add cx,2
push ax
call membank0r8
mov bl,al
pop ax
mov cx,ax
add cx,[xy]
pop ax
jnc .np
inc bl
.np
call dword near [memtablew8+ebx*4]
%endmacro
%macro addr_LdLCy_16bw 0
push ax
mov ecx,[xd]
mov bl,[esi]
add cx,bx
inc esi
push cx
call membank0r16
pop cx
add cx,2
xor bl,bl
push ax
call membank0r8
mov bl,al
pop ax
mov cx,ax
add cx,[xy]
pop ax
jnc .np
inc bl
.np
call dword near [memtablew16+ebx*4]
%endmacro
; 9. Direct Indexed Indirect -- (d,x)
%macro addr_BdCxB_8br 0
mov ecx,[xd]
mov bl,[esi]
add cx,bx
inc esi
add cx,[xx]
call membank0r16
mov cx,ax
mov bl,[xdb]
call dword near [memtabler8+ebx*4]
%endmacro
%macro addr_BdCxB_16br 0
mov ecx,[xd]
mov bl,[esi]
add cx,bx
inc esi
add cx,[xx]
call membank0r16
mov cx,ax
mov bl,[xdb]
call dword near [memtabler16+ebx*4]
%endmacro
%macro addr_BdCxB_8bw 0
push ax
mov ecx,[xd]
mov bl,[esi]
add cx,bx
inc esi
add cx,[xx]
call membank0r16
mov cx,ax
mov bl,[xdb]
pop ax
call dword near [memtablew8+ebx*4]
%endmacro
%macro addr_BdCxB_16bw 0
push ax
mov ecx,[xd]
mov bl,[esi]
add cx,bx
inc esi
add cx,[xx]
call membank0r16
mov cx,ax
mov bl,[xdb]
pop ax
call dword near [memtablew16+ebx*4]
%endmacro
; 10. Direct Indexed With X -- d,x
%macro addr_dCx_8br 0
mov ecx,[xd]
mov bl,[esi]
add cx,bx
inc esi
add cx,[xx]
call membank0r8
%endmacro
%macro addr_dCx_16br 0
mov ecx,[xd]
mov bl,[esi]
add cx,bx
inc esi
add cx,[xx]
call membank0r16
%endmacro
%macro addr_dCx_8bw 0
mov ecx,[xd]
mov bl,[esi]
add cx,bx
inc esi
add cx,[xx]
call membank0w8
%endmacro
%macro addr_dCx_16bw 0
mov ecx,[xd]
mov bl,[esi]
add cx,bx
inc esi
add cx,[xx]
call membank0w16
%endmacro
; 11. Direct Indexed With Y -- d,y
%macro addr_dCy_8br 0
mov ecx,[xd]
mov bl,[esi]
add cx,bx
inc esi
add cx,[xy]
call membank0r8
%endmacro
%macro addr_dCy_16br 0
mov ecx,[xd]
mov bl,[esi]
add cx,bx
inc esi
add cx,[xy]
call membank0r16
%endmacro
%macro addr_dCy_8bw 0
mov ecx,[xd]
mov bl,[esi]
add cx,bx
inc esi
add cx,[xy]
call membank0w8
%endmacro
%macro addr_dCy_16bw 0
mov ecx,[xd]
mov bl,[esi]
add cx,bx
inc esi
add cx,[xy]
call membank0w16
%endmacro
; 12. Absolute Indexed With X -- a,x
%macro addr_aCx_8br 0
mov cx,[esi]
mov bl,[xdb]
add esi,2
add cx,[xx]
jnc .np
inc bl
.np
call dword near [memtabler8+ebx*4]
%endmacro
%macro addr_aCx_16br 0
mov cx,[esi]
mov bl,[xdb]
add esi,2
add cx,[xx]
jnc .np
inc bl
.np
call dword near [memtabler16+ebx*4]
%endmacro
%macro addr_aCx_8bw 0
mov cx,[esi]
mov bl,[xdb]
add esi,2
add cx,[xx]
jnc .np
inc bl
.np
call dword near [memtablew8+ebx*4]
%endmacro
%macro addr_aCx_16bw 0
mov cx,[esi]
mov bl,[xdb]
add esi,2
add cx,[xx]
jnc .np
inc bl
.np
call dword near [memtablew16+ebx*4]
%endmacro
; 13. Absolute Indexed With Y -- a,y
%macro addr_aCy_8br 0
mov cx,[esi]
mov bl,[xdb]
add esi,2
add cx,[xy]
jnc .np
inc bl
.np
call dword near [memtabler8+ebx*4]
%endmacro
%macro addr_aCy_16br 0
mov cx,[esi]
mov bl,[xdb]
add esi,2
add cx,[xy]
jnc .np
inc bl
.np
call dword near [memtabler16+ebx*4]
%endmacro
%macro addr_aCy_8bw 0
mov cx,[esi]
mov bl,[xdb]
add esi,2
add cx,[xy]
jnc .np
inc bl
.np
call dword near [memtablew8+ebx*4]
%endmacro
%macro addr_aCy_16bw 0
mov cx,[esi]
mov bl,[xdb]
add esi,2
add cx,[xy]
jnc .np
inc bl
.np
call dword near [memtablew16+ebx*4]
%endmacro
; 14. Absolute Long Indexed With X -- al,x
%macro addr_alCx_8br 0
mov cx,[esi]
mov bl,[esi+2]
add esi,3
add cx,[xx]
jnc .np
inc bl
.np
call dword near [memtabler8+ebx*4]
%endmacro
%macro addr_alCx_16br 0
mov cx,[esi]
mov bl,[esi+2]
add esi,3
add cx,[xx]
jnc .np
inc bl
.np
call dword near [memtabler16+ebx*4]
%endmacro
%macro addr_alCx_8bw 0
mov cx,[esi]
mov bl,[esi+2]
add esi,3
add cx,[xx]
jnc .np
inc bl
.np
call dword near [memtablew8+ebx*4]
%endmacro
%macro addr_alCx_16bw 0
mov cx,[esi]
mov bl,[esi+2]
add esi,3
add cx,[xx]
jnc .np
inc bl
.np
call dword near [memtablew16+ebx*4]
%endmacro
; 18. Direct Indirect -- (d)
; ___________________
; Instruction: | opcode | offset |
; ~~~~~~~~~~~~~~~~~~~
; | Direct Register |
; + | offset |
; ---------------------
; | 00 | direct address |
; then:
; | 00 | (direct address) |
; + | DB |
; -------------------------------
; Address: | effective address |
%macro addr_BdB_8br 0
mov bl,[esi]
mov ecx,[xd]
inc esi
call dword near [DPageR16]
mov cx,ax
mov bl,[xdb]
call dword near [memtabler8+ebx*4]
%endmacro
%macro addr_BdB_16br 0
mov bl,[esi]
mov ecx,[xd]
inc esi
call dword near [DPageR16]
mov cx,ax
mov bl,[xdb]
call dword near [memtabler16+ebx*4]
%endmacro
%macro addr_BdB_8bw 0
push ax
mov bl,[esi]
mov ecx,[xd]
inc esi
call dword near [DPageR16]
mov cx,ax
mov bl,[xdb]
pop ax
call dword near [memtablew8+ebx*4]
%endmacro
%macro addr_BdB_16bw 0
push ax
mov bl,[esi]
mov ecx,[xd]
inc esi
call dword near [DPageR16]
mov cx,ax
mov bl,[xdb]
pop ax
call dword near [memtablew16+ebx*4]
%endmacro
; 19. Direct Indirect Long -- [d]
; ___________________
; Instruction: | opcode | offset |
; ~~~~~~~~~~~~~~~~~~~
; | Direct Register |
; + | offset |
; ---------------------
; | 00 | direct address |
; then:
; -------------------------------
; Address: | (direct address) |
%macro addr_LdL_8br 0
mov bl,[esi]
mov ecx,[xd]
inc esi
add cx,bx
push cx
call membank0r16
pop cx
add cx,2
push ax
call membank0r8
mov bl,al
pop ax
mov cx,ax
call dword near [memtabler8+ebx*4]
%endmacro
%macro addr_LdL_16br 0
mov bl,[esi]
mov ecx,[xd]
inc esi
add cx,bx
push cx
call membank0r16
pop cx
add cx,2
push ax
call membank0r8
mov bl,al
pop ax
mov cx,ax
call dword near [memtabler16+ebx*4]
%endmacro
%macro addr_LdL_8bw 0
push ax
mov bl,[esi]
mov ecx,[xd]
inc esi
add cx,bx
push cx
call membank0r16
pop cx
add cx,2
push ax
call membank0r8
mov bl,al
pop ax
mov cx,ax
pop ax
call dword near [memtablew8+ebx*4]
%endmacro
%macro addr_LdL_16bw 0
push ax
mov bl,[esi]
mov ecx,[xd]
inc esi
add cx,bx
push cx
call membank0r16
pop cx
add cx,2
push ax
call membank0r8
mov bl,al
pop ax
mov cx,ax
pop ax
call dword near [memtablew16+ebx*4]
%endmacro
; 22. Stack Relative -- d,s
%macro addr_dCs_8br 0
mov bl,[esi]
mov cx,[xs]
inc esi
add cx,bx
call membank0r8
%endmacro
%macro addr_dCs_16br 0
mov bl,[esi]
mov cx,[xs]
inc esi
add cx,bx
call membank0r16
%endmacro
%macro addr_dCs_8bw 0
mov bl,[esi]
mov cx,[xs]
inc esi
add cx,bx
call membank0w8
%endmacro
%macro addr_dCs_16bw 0
mov bl,[esi]
mov cx,[xs]
inc esi
add cx,bx
call membank0w16
%endmacro
; 23. Stack Relative Indirect Indexed -- (d,s),y (TESTED)
%macro addr_BdCsBCy_8br 0
mov bl,[esi]
mov cx,[xs]
inc esi
add cx,bx
call membank0r16
mov cx,ax
mov bl,[xdb]
add cx,[xy]
jnc .np
inc bl
.np
call dword near [memtabler8+ebx*4]
%endmacro
%macro addr_BdCsBCy_16br 0
mov bl,[esi]
mov cx,[xs]
inc esi
add cx,bx
call membank0r16
mov cx,ax
mov bl,[xdb]
add cx,[xy]
jnc .np
inc bl
.np
call dword near [memtabler16+ebx*4]
%endmacro
%macro addr_BdCsBCy_8bw 0
push ax
mov bl,[esi]
mov cx,[xs]
inc esi
add cx,bx
call membank0r16
mov cx,ax
mov bl,[xdb]
pop ax
add cx,[xy]
jnc .np
inc bl
.np
call dword near [memtablew8+ebx*4]
%endmacro
%macro addr_BdCsBCy_16bw 0
push ax
mov bl,[esi]
mov cx,[xs]
inc esi
add cx,bx
call membank0r16
mov cx,ax
mov bl,[xdb]
pop ax
add cx,[xy]
jnc .np
inc bl
.np
call dword near [memtablew16+ebx*4]
%endmacro

795
zsnes/src/cpu/address2.inc Normal file
View File

@@ -0,0 +1,795 @@
;Copyright (C) 1997-2007 ZSNES Team ( zsKnight, _Demo_, pagefault, Nach )
;
;http://www.zsnes.com
;http://sourceforge.net/projects/zsnes
;https://zsnes.bountysource.com
;
;This program is free software; you can redistribute it and/or
;modify it under the terms of the GNU General Public License
;version 2 as published by the Free Software Foundation.
;
;This program is distributed in the hope that it will be useful,
;but WITHOUT ANY WARRANTY; without even the implied warranty of
;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;GNU General Public License for more details.
;
;You should have received a copy of the GNU General Public License
;along with this program; if not, write to the Free Software
;Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
EXTSYM DPageR8,DPageR16,DPageW8,DPageW16
;*******************************************************
; Address Modes
;*******************************************************
; 1. Immediate Addressing -- # - DONE IN PROGRAM
%macro addr_I_8br 0
mov al,[esi]
inc esi
%endmacro
%macro addr_I_16br 0
mov eax,[esi]
add esi,2
%endmacro
; 2. Absolute -- a (TESTED)
%macro addr_a_8br 0
mov cx,[esi]
mov bl,[xdb]
add esi,2
call dword near [memtabler8+ebx*4]
%endmacro
%macro addr_a_16br 0
mov cx,[esi]
mov bl,[xdb]
add esi,2
call dword near [memtabler16+ebx*4]
%endmacro
%macro addr_a_8bw 0
mov cx,[esi]
mov bl,[xdb]
add esi,2
call dword near [memtablew8+ebx*4]
%endmacro
%macro addr_a_16bw 0
mov cx,[esi]
mov bl,[xdb]
add esi,2
call dword near [memtablew16+ebx*4]
%endmacro
; 3. Absolute Long -- al
%macro addr_al_8br 0
mov cx,[esi]
mov bl,[esi+2]
add esi,3
call dword near [memtabler8+ebx*4]
%endmacro
%macro addr_al_16br 0
mov cx,[esi]
mov bl,[esi+2]
add esi,3
call dword near [memtabler16+ebx*4]
%endmacro
%macro addr_al_8bw 0
mov cx,[esi]
mov bl,[esi+2]
add esi,3
call dword near [memtablew8+ebx*4]
%endmacro
%macro addr_al_16bw 0
mov cx,[esi]
mov bl,[esi+2]
add esi,3
call dword near [memtablew16+ebx*4]
%endmacro
; 4. Direct -- d (TESTED)
%macro addr_d_8br 0
mov bl,[esi]
mov ecx,[xd]
inc esi
call dword near [DPageR8]
%endmacro
%macro addr_d_16br 0
mov bl,[esi]
mov ecx,[xd]
inc esi
call dword near [DPageR16]
%endmacro
%macro addr_d_8bw 0
mov bl,[esi]
mov ecx,[xd]
inc esi
call dword near [DPageW8]
%endmacro
%macro addr_d_16bw 0
mov bl,[esi]
mov ecx,[xd]
inc esi
call dword near [DPageW16]
%endmacro
; 5. Accumulator -- A
%macro addr_A_8br 0
mov al,[xa]
%endmacro
%macro addr_A_16br 0
mov eax,[xa]
%endmacro
%macro addr_A_8bw 0
mov [xa],al
%endmacro
%macro addr_A_16bw 0
mov [xa],ax
%endmacro
; 7. Direct Indirect Indexed -- (d),y
%macro addr_BdBCy_8br 0
mov bl,[esi]
mov ecx,[xd]
inc esi
call dword near [DPageR16]
mov cx,ax
mov bl,[xdb]
add cx,[xy]
jnc .np
inc bl
.np
call dword near [memtabler8+ebx*4]
%endmacro
%macro addr_BdBCy_16br 0
mov bl,[esi]
mov ecx,[xd]
inc esi
call dword near [DPageR16]
mov cx,ax
mov bl,[xdb]
add cx,[xy]
jnc .np
inc bl
.np
call dword near [memtabler16+ebx*4]
%endmacro
%macro addr_BdBCy_8bw 0
push ax
mov bl,[esi]
mov ecx,[xd]
inc esi
call dword near [DPageR16]
mov cx,ax
mov bl,[xdb]
add cx,[xy]
jnc .np
inc bl
.np
pop ax
call dword near [memtablew8+ebx*4]
%endmacro
%macro addr_BdBCy_16bw 0
push ax
mov bl,[esi]
mov ecx,[xd]
inc esi
call dword near [DPageR16]
mov cx,ax
mov bl,[xdb]
add cx,[xy]
jnc .np
inc bl
.np
pop ax
call dword near [memtablew16+ebx*4]
%endmacro
; 8. Direct Indirect Indexed Long -- [d],y
%macro addr_LdLCy_8br 0
mov ecx,[xd]
mov bl,[esi]
inc esi
push cx
call dword near [DPageR16]
pop cx
add cx,2
push ax
call dword near [DPageR8]
mov bl,al
pop ax
mov cx,ax
add cx,[xy]
jnc .np
inc bl
.np
call dword near [memtabler8+ebx*4]
%endmacro
%macro addr_LdLCy_16br 0
mov ecx,[xd]
mov bl,[esi]
inc esi
push cx
call dword near [DPageR16]
pop cx
add cx,2
push ax
call dword near [DPageR8]
mov bl,al
pop ax
mov cx,ax
add cx,[xy]
jnc .np
inc bl
.np
call dword near [memtabler16+ebx*4]
%endmacro
%macro addr_LdLCy_8bw 0
push ax
mov ecx,[xd]
mov bl,[esi]
inc esi
push cx
call dword near [DPageR16]
pop cx
add cx,2
push ax
call dword near [DPageR8]
mov bl,al
pop ax
mov cx,ax
add cx,[xy]
pop ax
jnc .np
inc bl
.np
call dword near [memtablew8+ebx*4]
%endmacro
%macro addr_LdLCy_16bw 0
push ax
mov ecx,[xd]
mov bl,[esi]
inc esi
push cx
call dword near [DPageR16]
pop cx
add cx,2
xor bl,bl
push ax
call dword near [DPageR8]
mov bl,al
pop ax
mov cx,ax
add cx,[xy]
pop ax
jnc .np
inc bl
.np
call dword near [memtablew16+ebx*4]
%endmacro
; 9. Direct Indexed Indirect -- (d,x)
%macro addr_BdCxB_8br 0
mov ecx,[xd]
mov bl,[esi]
inc esi
add cx,[xx]
call dword near [DPageR16]
mov cx,ax
mov bl,[xdb]
call dword near [memtabler8+ebx*4]
%endmacro
%macro addr_BdCxB_16br 0
mov ecx,[xd]
mov bl,[esi]
inc esi
add cx,[xx]
call dword near [DPageR16]
mov cx,ax
mov bl,[xdb]
call dword near [memtabler16+ebx*4]
%endmacro
%macro addr_BdCxB_8bw 0
push ax
mov ecx,[xd]
mov bl,[esi]
inc esi
add cx,[xx]
call dword near [DPageR16]
mov cx,ax
mov bl,[xdb]
pop ax
call dword near [memtablew8+ebx*4]
%endmacro
%macro addr_BdCxB_16bw 0
push ax
mov ecx,[xd]
mov bl,[esi]
inc esi
add cx,[xx]
call dword near [DPageR16]
mov cx,ax
mov bl,[xdb]
pop ax
call dword near [memtablew16+ebx*4]
%endmacro
; 10. Direct Indexed With X -- d,x
%macro addr_dCx_8br 0
mov ecx,[xd]
mov bl,[esi]
inc esi
add cx,[xx]
call dword near [DPageR8]
%endmacro
%macro addr_dCx_16br 0
mov ecx,[xd]
mov bl,[esi]
inc esi
add cx,[xx]
call dword near [DPageR16]
%endmacro
%macro addr_dCx_8bw 0
mov ecx,[xd]
mov bl,[esi]
inc esi
add cx,[xx]
call dword near [DPageW8]
%endmacro
%macro addr_dCx_16bw 0
mov ecx,[xd]
mov bl,[esi]
inc esi
add cx,[xx]
call dword near [DPageW16]
%endmacro
; 11. Direct Indexed With Y -- d,y
%macro addr_dCy_8br 0
mov ecx,[xd]
mov bl,[esi]
inc esi
add cx,[xy]
call dword near [DPageR8]
%endmacro
%macro addr_dCy_16br 0
mov ecx,[xd]
mov bl,[esi]
inc esi
add cx,[xy]
call dword near [DPageR16]
%endmacro
%macro addr_dCy_8bw 0
mov ecx,[xd]
mov bl,[esi]
inc esi
add cx,[xy]
call dword near [DPageW8]
%endmacro
%macro addr_dCy_16bw 0
mov ecx,[xd]
mov bl,[esi]
inc esi
add cx,[xy]
call dword near [DPageW16]
%endmacro
; 12. Absolute Indexed With X -- a,x
%macro addr_aCx_8br 0
mov cx,[esi]
mov bl,[xdb]
add esi,2
add cx,[xx]
jnc .np
inc bl
.np
call dword near [memtabler8+ebx*4]
%endmacro
%macro addr_aCx_16br 0
mov cx,[esi]
mov bl,[xdb]
add esi,2
add cx,[xx]
jnc .np
inc bl
.np
call dword near [memtabler16+ebx*4]
%endmacro
%macro addr_aCx_8bw 0
mov cx,[esi]
mov bl,[xdb]
add esi,2
add cx,[xx]
jnc .np
inc bl
.np
call dword near [memtablew8+ebx*4]
%endmacro
%macro addr_aCx_16bw 0
mov cx,[esi]
mov bl,[xdb]
add esi,2
add cx,[xx]
jnc .np
inc bl
.np
call dword near [memtablew16+ebx*4]
%endmacro
; 13. Absolute Indexed With Y -- a,y
%macro addr_aCy_8br 0
mov cx,[esi]
mov bl,[xdb]
add esi,2
add cx,[xy]
jnc .np
inc bl
.np
call dword near [memtabler8+ebx*4]
%endmacro
%macro addr_aCy_16br 0
mov cx,[esi]
mov bl,[xdb]
add esi,2
add cx,[xy]
jnc .np
inc bl
.np
call dword near [memtabler16+ebx*4]
%endmacro
%macro addr_aCy_8bw 0
mov cx,[esi]
mov bl,[xdb]
add esi,2
add cx,[xy]
jnc .np
inc bl
.np
call dword near [memtablew8+ebx*4]
%endmacro
%macro addr_aCy_16bw 0
mov cx,[esi]
mov bl,[xdb]
add esi,2
add cx,[xy]
jnc .np
inc bl
.np
call dword near [memtablew16+ebx*4]
%endmacro
; 14. Absolute Long Indexed With X -- al,x
%macro addr_alCx_8br 0
mov cx,[esi]
mov bl,[esi+2]
add esi,3
add cx,[xx]
jnc .np
inc bl
.np
call dword near [memtabler8+ebx*4]
%endmacro
%macro addr_alCx_16br 0
mov cx,[esi]
mov bl,[esi+2]
add esi,3
add cx,[xx]
jnc .np
inc bl
.np
call dword near [memtabler16+ebx*4]
%endmacro
%macro addr_alCx_8bw 0
mov cx,[esi]
mov bl,[esi+2]
add esi,3
add cx,[xx]
jnc .np
inc bl
.np
call dword near [memtablew8+ebx*4]
%endmacro
%macro addr_alCx_16bw 0
mov cx,[esi]
mov bl,[esi+2]
add esi,3
add cx,[xx]
jnc .np
inc bl
.np
call dword near [memtablew16+ebx*4]
%endmacro
; 18. Direct Indirect -- (d)
; ___________________
; Instruction: | opcode | offset |
; ~~~~~~~~~~~~~~~~~~~
; | Direct Register |
; + | offset |
; ---------------------
; | 00 | direct address |
; then:
; | 00 | (direct address) |
; + | DB |
; -------------------------------
; Address: | effective address |
%macro addr_BdB_8br 0
mov bl,[esi]
mov ecx,[xd]
inc esi
call dword near [DPageR16]
mov cx,ax
mov bl,[xdb]
call dword near [memtabler8+ebx*4]
%endmacro
%macro addr_BdB_16br 0
mov bl,[esi]
mov ecx,[xd]
inc esi
call dword near [DPageR16]
mov cx,ax
mov bl,[xdb]
call dword near [memtabler16+ebx*4]
%endmacro
%macro addr_BdB_8bw 0
push ax
mov bl,[esi]
mov ecx,[xd]
inc esi
call dword near [DPageR16]
mov cx,ax
mov bl,[xdb]
pop ax
call dword near [memtablew8+ebx*4]
%endmacro
%macro addr_BdB_16bw 0
push ax
mov bl,[esi]
mov ecx,[xd]
inc esi
call dword near [DPageR16]
mov cx,ax
mov bl,[xdb]
pop ax
call dword near [memtablew16+ebx*4]
%endmacro
; 19. Direct Indirect Long -- [d]
; ___________________
; Instruction: | opcode | offset |
; ~~~~~~~~~~~~~~~~~~~
; | Direct Register |
; + | offset |
; ---------------------
; | 00 | direct address |
; then:
; -------------------------------
; Address: | (direct address) |
%macro addr_LdL_8br 0
mov bl,[esi]
mov ecx,[xd]
inc esi
push cx
call dword near [DPageR16]
pop cx
add cx,2
push ax
call dword near [DPageR8]
mov bl,al
pop ax
mov cx,ax
call dword near [memtabler8+ebx*4]
%endmacro
%macro addr_LdL_16br 0
mov bl,[esi]
mov ecx,[xd]
inc esi
push cx
call dword near [DPageR16]
pop cx
add cx,2
push ax
call dword near [DPageR8]
mov bl,al
pop ax
mov cx,ax
call dword near [memtabler16+ebx*4]
%endmacro
%macro addr_LdL_8bw 0
push ax
mov bl,[esi]
mov ecx,[xd]
inc esi
push cx
call dword near [DPageR16]
pop cx
add cx,2
push ax
call dword near [DPageR8]
mov bl,al
pop ax
mov cx,ax
pop ax
call dword near [memtablew8+ebx*4]
%endmacro
%macro addr_LdL_16bw 0
push ax
mov bl,[esi]
mov ecx,[xd]
inc esi
push cx
call dword near [DPageR16]
pop cx
add cx,2
push ax
call dword near [DPageR8]
mov bl,al
pop ax
mov cx,ax
pop ax
call dword near [memtablew16+ebx*4]
%endmacro
; 22. Stack Relative -- d,s
%macro addr_dCs_8br 0
mov bl,[esi]
mov cx,[xs]
inc esi
add cx,bx
call membank0r8
%endmacro
%macro addr_dCs_16br 0
mov bl,[esi]
mov cx,[xs]
inc esi
add cx,bx
call membank0r16
%endmacro
%macro addr_dCs_8bw 0
mov bl,[esi]
mov cx,[xs]
inc esi
add cx,bx
call membank0w8
%endmacro
%macro addr_dCs_16bw 0
mov bl,[esi]
mov cx,[xs]
inc esi
add cx,bx
call membank0w16
%endmacro
; 23. Stack Relative Indirect Indexed -- (d,s),y (TESTED)
%macro addr_BdCsBCy_8br 0
mov bl,[esi]
mov cx,[xs]
inc esi
add cx,bx
call membank0r16
mov cx,ax
mov bl,[xdb]
add cx,[xy]
jnc .np
inc bl
.np
call dword near [memtabler8+ebx*4]
%endmacro
%macro addr_BdCsBCy_16br 0
mov bl,[esi]
mov cx,[xs]
inc esi
add cx,bx
call membank0r16
mov cx,ax
mov bl,[xdb]
add cx,[xy]
jnc .np
inc bl
.np
call dword near [memtabler16+ebx*4]
%endmacro
%macro addr_BdCsBCy_8bw 0
push ax
mov bl,[esi]
mov cx,[xs]
inc esi
add cx,bx
call membank0r16
mov cx,ax
mov bl,[xdb]
pop ax
add cx,[xy]
jnc .np
inc bl
.np
call dword near [memtablew8+ebx*4]
%endmacro
%macro addr_BdCsBCy_16bw 0
push ax
mov bl,[esi]
mov cx,[xs]
inc esi
add cx,bx
call membank0r16
mov cx,ax
mov bl,[xdb]
pop ax
add cx,[xy]
jnc .np
inc bl
.np
call dword near [memtablew16+ebx*4]
%endmacro

408
zsnes/src/cpu/addrni.inc Normal file
View File

@@ -0,0 +1,408 @@
;Copyright (C) 1997-2007 ZSNES Team ( zsKnight, _Demo_, pagefault, Nach )
;
;http://www.zsnes.com
;http://sourceforge.net/projects/zsnes
;https://zsnes.bountysource.com
;
;This program is free software; you can redistribute it and/or
;modify it under the terms of the GNU General Public License
;version 2 as published by the Free Software Foundation.
;
;This program is distributed in the hope that it will be useful,
;but WITHOUT ANY WARRANTY; without even the implied warranty of
;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;GNU General Public License for more details.
;
;You should have received a copy of the GNU General Public License
;along with this program; if not, write to the Free Software
;Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
;*******************************************************
; Address Modes
;*******************************************************
; 1. Immediate Addressing -- # - DONE IN PROGRAM
%macro addr_I_8brni 0
mov al,[esi]
%endmacro
%macro addr_I_16brni 0
mov ax,[esi]
%endmacro
; 2. Absolute -- a (TESTED)
%macro addr_a_8brni 0
mov cx,[esi]
mov bl,[xdb]
call dword near [memtabler8+ebx*4]
%endmacro
%macro addr_a_16brni 0
mov cx,[esi]
mov bl,[xdb]
call dword near [memtabler16+ebx*4]
%endmacro
; 3. Absolute Long -- al
%macro addr_al_8brni 0
mov cx,[esi]
mov bl,[esi+2]
call dword near [memtabler8+ebx*4]
%endmacro
%macro addr_al_16brni 0
mov cx,[esi]
mov bl,[esi+2]
call dword near [memtabler16+ebx*4]
%endmacro
; 4. Direct -- d (TESTED)
%macro addr_d_8brni 0
mov bl,[esi]
mov ecx,[xd]
call dword near [DPageR8]
%endmacro
%macro addr_d_16brni 0
mov bl,[esi]
mov ecx,[xd]
call dword near [DPageR16]
%endmacro
; 5. Accumulator -- A
%macro addr_A_8brni 0
mov al,[xa]
%endmacro
%macro addr_A_16brni 0
mov ax,[xa]
%endmacro
; 7. Direct Indirect Indexed -- (d),y
%macro addr_BdBCy_8brni 0
mov bl,[esi]
mov ecx,[xd]
call dword near [DPageR16]
mov cx,ax
mov bl,[xdb]
add cx,[xy]
jnc .npb
inc bl
.npb
call dword near [memtabler8+ebx*4]
%endmacro
%macro addr_BdBCy_16brni 0
mov bl,[esi]
mov ecx,[xd]
call dword near [DPageR16]
mov cx,ax
mov bl,[xdb]
add cx,[xy]
jnc .npb
inc bl
.npb
call dword near [memtabler16+ebx*4]
%endmacro
; 8. Direct Indirect Indexed Long -- [d],y
%macro addr_LdLCy_8brni 0
mov ecx,[xd]
mov bl,[esi]
add cx,bx
push cx
call membank0r16
pop cx
add cx,2
push ax
call membank0r8
mov bl,al
pop ax
mov cx,ax
add cx,[xy]
jnc .npb
inc bl
.npb
call dword near [memtabler8+ebx*4]
%endmacro
%macro addr_LdLCy_16brni 0
mov ecx,[xd]
mov bl,[esi]
add cx,bx
push cx
call membank0r16
pop cx
add cx,2
push ax
call membank0r8
mov bl,al
pop ax
mov cx,ax
add cx,[xy]
jnc .npb
inc bl
.npb
call dword near [memtabler16+ebx*4]
%endmacro
; 9. Direct Indexed Indirect -- (d,x)
%macro addr_BdCxB_8brni 0
mov ecx,[xd]
mov bl,[esi]
add cx,bx
add cx,[xx]
call membank0r16
mov cx,ax
mov bl,[xdb]
call dword near [memtabler8+ebx*4]
%endmacro
%macro addr_BdCxB_16brni 0
mov ecx,[xd]
mov bl,[esi]
add cx,bx
add cx,[xx]
call membank0r16
mov cx,ax
mov bl,[xdb]
call dword near [memtabler16+ebx*4]
%endmacro
; 10. Direct Indexed With X -- d,x
%macro addr_dCx_8brni 0
mov ecx,[xd]
mov bl,[esi]
add cx,bx
add cx,[xx]
call membank0r8
%endmacro
%macro addr_dCx_16brni 0
mov ecx,[xd]
mov bl,[esi]
add cx,bx
add cx,[xx]
call membank0r16
%endmacro
; 11. Direct Indexed With Y -- d,y
%macro addr_dCy_8brni 0
mov ecx,[xd]
mov bl,[esi]
add cx,bx
add cx,[xy]
call membank0r8
%endmacro
%macro addr_dCy_16brni 0
mov ecx,[xd]
mov bl,[esi]
add cx,bx
add cx,[xy]
call membank0r16
%endmacro
; 12. Absolute Indexed With X -- a,x
%macro addr_aCx_8brni 0
mov cx,[esi]
mov bl,[xdb]
add cx,[xx]
jnc .npb
inc bl
.npb
call dword near [memtabler8+ebx*4]
%endmacro
%macro addr_aCx_16brni 0
mov cx,[esi]
mov bl,[xdb]
add cx,[xx]
jnc .npb
inc bl
.npb
call dword near [memtabler16+ebx*4]
%endmacro
; 13. Absolute Indexed With Y -- a,y
%macro addr_aCy_8brni 0
mov cx,[esi]
mov bl,[xdb]
add cx,[xy]
jnc .npb
inc bl
.npb
call dword near [memtabler8+ebx*4]
%endmacro
%macro addr_aCy_16brni 0
mov cx,[esi]
mov bl,[xdb]
add cx,[xy]
jnc .npb
inc bl
.npb
call dword near [memtabler16+ebx*4]
%endmacro
; 14. Absolute Long Indexed With X -- al,x
%macro addr_alCx_8brni 0
mov cx,[esi]
mov bl,[esi+2]
add cx,[xx]
jnc .npb
inc bl
.npb
call dword near [memtabler8+ebx*4]
%endmacro
%macro addr_alCx_16brni 0
mov cx,[esi]
mov bl,[esi+2]
add cx,[xx]
jnc .npb
inc bl
.npb
call dword near [memtabler16+ebx*4]
%endmacro
; 18. Direct Indirect -- (d)
; ___________________
; Instruction: | opcode | offset |
; ~~~~~~~~~~~~~~~~~~~
; | Direct Register |
; + | offset |
; ---------------------
; | 00 | direct address |
; then:
; | 00 | (direct address) |
; + | DB |
; -------------------------------
; Address: | effective address |
%macro addr_BdB_8brni 0
mov bl,[esi]
mov ecx,[xd]
call dword near [DPageR16]
mov cx,ax
mov bl,[xdb]
call dword near [memtabler8+ebx*4]
%endmacro
%macro addr_BdB_16brni 0
mov bl,[esi]
mov ecx,[xd]
call dword near [DPageR16]
mov cx,ax
mov bl,[xdb]
call dword near [memtabler16+ebx*4]
%endmacro
; 19. Direct Indirect Long -- [d]
; ___________________
; Instruction: | opcode | offset |
; ~~~~~~~~~~~~~~~~~~~
; | Direct Register |
; + | offset |
; ---------------------
; | 00 | direct address |
; then:
; -------------------------------
; Address: | (direct address) |
%macro addr_LdL_8brni 0
mov bl,[esi]
mov ecx,[xd]
add cx,bx
push cx
call membank0r16
pop cx
add cx,2
push ax
call membank0r8
mov bl,al
pop ax
mov cx,ax
call dword near [memtabler8+ebx*4]
%endmacro
%macro addr_LdL_16brni 0
mov bl,[esi]
mov ecx,[xd]
add cx,bx
push cx
call membank0r16
pop cx
add cx,2
push ax
call membank0r8
mov bl,al
pop ax
mov cx,ax
call dword near [memtabler16+ebx*4]
%endmacro
; 22. Stack Relative -- d,s
%macro addr_dCs_8brni 0
mov bl,[esi]
mov cx,[xs]
add cx,bx
call membank0r8
%endmacro
%macro addr_dCs_16brni 0
mov bl,[esi]
mov cx,[xs]
add cx,bx
call membank0r16
%endmacro
; 23. Stack Relative Indirect Indexed -- (d,s),y (TESTED)
%macro addr_BdCsBCy_8brni 0
mov bl,[esi]
mov cx,[xs]
add cx,bx
call membank0r16
mov cx,ax
mov bl,[xdb]
add cx,[xy]
jnc .npb
inc bl
.npb
call dword near [memtabler8+ebx*4]
%endmacro
%macro addr_BdCsBCy_16brni 0
mov bl,[esi]
mov cx,[xs]
add cx,bx
call membank0r16
mov cx,ax
mov bl,[xdb]
add cx,[xy]
jnc .npb
inc bl
.npb
call dword near [memtabler16+ebx*4]
%endmacro

1310
zsnes/src/cpu/dma.asm Normal file

File diff suppressed because it is too large Load Diff

2836
zsnes/src/cpu/dsp.asm Normal file

File diff suppressed because it is too large Load Diff

5203
zsnes/src/cpu/dspproc.asm Normal file

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More